Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. require_once('vendor/autoload.php');
  4.  
  5.  
  6. \Stripe\Stripe::setApiKey('sk_test_');
  7.  
  8. $session = \Stripe\Checkout\Session::create([
  9.   'success_url' => 'https://example.com/success',
  10.   'cancel_url' => 'https://example.com/cancel',
  11.   'payment_method_types' => ['card'],
  12.   'line_items' => [
  13.     [
  14.       'name' => 'T-shirt',
  15.       'description' => 'Comfortable cotton t-shirt',
  16.       'amount' => 1500,
  17.       'currency' => 'usd',
  18.       'quantity' => 2,
  19.     ],
  20.   ],
  21. ]);
  22.  
  23. $payment_intent = \Stripe\PaymentIntent::update(
  24.   $session->payment_intent,
  25.   ['metadata' => ['order_id' => '6735']]
  26. );
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement