SHARE
TWEET

Untitled

a guest Nov 13th, 2019 178 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.         require 'vendor/autoload.php';
  3.         \Stripe\Stripe::setApiKey('sk_xxxxx');
  4.  
  5.         $email = 'test+test@stripe.com';
  6.         $token = 'tok_visa';
  7.  
  8.         $customer = \Stripe\Customer::create(array(
  9.             'email' => $email,
  10.             'source'  => $token,
  11.         ));
  12.  
  13.         \Stripe\InvoiceItem::create([
  14.         'amount' => 2500,
  15.         'currency' => 'usd',
  16.         'customer' => $customer->id,
  17.         'description' => 'Refundable Deposit',
  18.         ]);
  19.  
  20.  
  21.  
  22.         $subscription = \Stripe\Subscription::create([
  23.         'customer' => $customer->id,
  24.         'tax_percent' => 8.25,
  25.         'items' => [
  26.         [
  27.             'plan' => 'plan_GAGTxxxxxk',            
  28.         ]
  29.         ]
  30.         ]);
  31.  
  32.         echo $subscription;
  33.         echo '<h1>Successfully charged $29.95!</h1>';
  34.         ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top