Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('config.php');
- $token = $_POST['stripeToken'];
- $stripeinfo = \Stripe\Token::retrieve($token);
- $email = $stripeinfo->email;
- $customer = \Stripe\Customer::create(array(
- 'email' => $email,
- 'source' => $token,
- ]);
- \Stripe\InvoiceItem::create([
- 'amount' => 2500,
- 'currency' => 'usd',
- 'customer' => '$customer.id',
- 'description' => 'Refundable Deposit',
- ]);
- \Stripe\Subscription::create([
- 'customer' => '$customer.id',
- 'items' => [
- [
- 'plan' => 'plan_test',
- 'tax_percent' => 8.25,
- ],
- ]
- ]);
- ));
- echo '<h1>Successfully charged $29.95!</h1>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement