Created
June 2, 2015 15:47
-
-
Save mdaley/cc68d797f1dd2bd0229f to your computer and use it in GitHub Desktop.
Alipay stripe example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
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
Unfortunately, stripe disabled alipay in checkout