Skip to content

Instantly share code, notes, and snippets.

@matthewarkin
Last active August 29, 2015 14:05
Show Gist options
  • Save matthewarkin/c42555ab715dc6db428d to your computer and use it in GitHub Desktop.
Save matthewarkin/c42555ab715dc6db428d to your computer and use it in GitHub Desktop.
Output of Stripe Args
{
billing_address_apt: "",
billing_address_city: "San Francisco",
billing_address_country: "United States",
billing_address_country_code: "US",
billing_address_line1: "1231 Market St",
billing_address_state: "CA",
billing_address_zip: "94103",
billing_name: "Matthew Arkin",
shipping_address_apt: "",
shipping_address_city: "San Francisco",
shipping_address_country: "United States",
shipping_address_country_code: "US",
shipping_address_line1: "1231 Market St",
shipping_address_state: "CA",
shipping_address_zip: "94103",
shipping_name: "Matthew Arkin",
}
<script src="https://checkout.stripe.com/checkout.js"></script>
<button id="myStripeButton">Pay with Card</button>
<script>
var handler = StripeCheckout.configure({
key: 'pk_test_6pRNASCoBOKtIshFeQd4XMUh',
image: 'https://stripe.com/img/documentation/checkout/marketplace.png',
token: function(token, args) {
// Use the token to create the charge with a server-side script.
// You can access the token ID with `token.id`
// args will contain all the billing and shipping info.
// The billing info is automatically attached to the token and card.
}
});
document.getElementById('myStripeButton').addEventListener('click', function(e) {
// Open Checkout with further options
handler.open({
name: 'Demo Site',
description: '2 widgets ($20.00)',
amount: 2000,
shippingAddress: true,
billingAddress: true,
});
e.preventDefault();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment