Skip to content

Instantly share code, notes, and snippets.

@mdaley
Created June 2, 2015 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdaley/cc68d797f1dd2bd0229f to your computer and use it in GitHub Desktop.
Save mdaley/cc68d797f1dd2bd0229f to your computer and use it in GitHub Desktop.
Alipay stripe example
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="https://checkout.stripe.com/checkout.js"></script>
<button id="customButton">Purchase</button>
<script>
var handler = StripeCheckout.configure({
key: 'pk_test_6pRNASCoBOKtIshFeQd4XMUh',
image: '/img/documentation/checkout/marketplace.png',
alipay: "true",
// locale: "zh-CN",
currency: "CNY",
token: function(token) {
// Use the token to create the charge with a server-side script.
// You can access the token ID with `token.id`
}
})
$('#customButton').on('click', function(e) {
// Open Checkout with further options
handler.open({
name: 'mixrad.io',
image: 'https://i.webapps.microsoft.com/r/image/view/-/3706312/highRes/1/-/MixRadio-icon-Mix-Radio--jpg.jpg',
description: 'MixRadio Premium Subscription',
amount: 499
});
e.preventDefault();
});
// Close Checkout on page navigation
$(window).on('popstate', function() {
handler.close();
});
</script>
@leon0707
Copy link

leon0707 commented Feb 8, 2018

Unfortunately, stripe disabled alipay in checkout

@JosephNC
Copy link

You can use the Stripe Element to achieve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment