Last active
October 6, 2015 16:49
-
-
Save adamjstevenson/373cb6cc730f9b20c70d to your computer and use it in GitHub Desktop.
Passing shipping information with a charge in PHP
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
<? | |
\Stripe\Charge::create(array( | |
"amount" => 400, | |
"currency" => "usd", | |
"source" => $_POST['stripeToken'], // obtained with Stripe.js. | |
"description" => "Charge for [email protected]", | |
"shipping" => array( | |
"name" => $_POST['stripeShippingName'], | |
"address" => array( | |
"line1" => $_POST['stripeShippingAddressLine1'], | |
"apt" => $_POST['stripeShippingAddressApt'], | |
"postal_code" => $_POST['stripeShippingAddressZip'], | |
"city" => $_POST['stripeShippingAddressCity'], | |
"state" => $_POST['stripeShippingAddressState'], | |
"country" => $_POST['stripeShippingAddressCountry'] | |
) | |
) | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment