Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('vendor/autoload.php');
- \Stripe\Stripe::setApiKey('sk_test_');
- $session = \Stripe\Checkout\Session::create([
- 'success_url' => 'https://example.com/success',
- 'cancel_url' => 'https://example.com/cancel',
- 'payment_method_types' => ['card'],
- 'line_items' => [
- [
- 'name' => 'T-shirt',
- 'description' => 'Comfortable cotton t-shirt',
- 'amount' => 1500,
- 'currency' => 'usd',
- 'quantity' => 2,
- ],
- ],
- ]);
- $payment_intent = \Stripe\PaymentIntent::update(
- $session->payment_intent,
- ['metadata' => ['order_id' => '6735']]
- );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement