Skip to content

Instantly share code, notes, and snippets.

@adamjstevenson
Last active October 6, 2015 16:49
Show Gist options
  • Save adamjstevenson/373cb6cc730f9b20c70d to your computer and use it in GitHub Desktop.
Save adamjstevenson/373cb6cc730f9b20c70d to your computer and use it in GitHub Desktop.
Passing shipping information with a charge in PHP
<?
\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