Skip to content

Instantly share code, notes, and snippets.

@vanbo
Last active June 9, 2016 13:52
Show Gist options
  • Select an option

  • Save vanbo/34b6cb7e73d1a10d4f759d86566b6261 to your computer and use it in GitHub Desktop.

Select an option

Save vanbo/34b6cb7e73d1a10d4f759d86566b6261 to your computer and use it in GitHub Desktop.
Charge
<?php
\Stripe\Stripe::setApiKey('the_key');
// I do set this usually, but tried without it, too
\Stripe\Stripe::setApiVersion('2016-03-07');
$card = array(
'number' => '4242424242424242',
'exp_month' => 5,
'exp_year' => date('Y') + 1
);
$c = \Stripe\Charge::create(
array(
'amount' => 100,
'currency' => 'usd',
'card' => $card
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment