Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'vendor/autoload.php';
- \Stripe\Stripe::setApiKey('sk_xxxxx');
- $email = 'test+test@stripe.com';
- $token = 'tok_visa';
- $customer = \Stripe\Customer::create(array(
- 'email' => $email,
- 'source' => $token,
- ));
- \Stripe\InvoiceItem::create([
- 'amount' => 2500,
- 'currency' => 'usd',
- 'customer' => $customer->id,
- 'description' => 'Refundable Deposit',
- ]);
- $subscription = \Stripe\Subscription::create([
- 'customer' => $customer->id,
- 'tax_percent' => 8.25,
- 'items' => [
- [
- 'plan' => 'plan_GAGTxxxxxk',
- ]
- ]
- ]);
- echo $subscription;
- echo '<h1>Successfully charged $29.95!</h1>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement