This upgrades from the legacy version of Stripe's checkout system to the new version: > The legacy version of Checkout presented customers with a modal dialog > that collected card information, and returned a token or a source to > your website. In contrast, the new version of Checkout is a smart > payment page hosted by Stripe that creates payments or subscriptions. It > supports Apple Pay, Dynamic 3D Secure, and many other features. Basic overview of the new system: * We send the user to a checkout page on Stripe. * Stripe collects payment and sends us a webhook notification when the order is complete. * We receive the webhook notification and upgrade the user. Docs: * https://stripe.com/docs/payments/checkout * https://stripe.com/docs/payments/checkout/migration#client-products * https://stripe.com/docs/payments/handling-payment-events * https://stripe.com/docs/payments/checkout/fulfill-orders
56 lines
1.4 KiB
JSON
56 lines
1.4 KiB
JSON
{
|
|
"id": "evt_000",
|
|
"object": "event",
|
|
"api_version": "2020-08-27",
|
|
"created": 1608705740,
|
|
"data": {
|
|
"object": {
|
|
"id": "cs_test_000",
|
|
"object": "checkout.session",
|
|
"allow_promotion_codes": null,
|
|
"amount_subtotal": 2000,
|
|
"amount_total": 2000,
|
|
"billing_address_collection": null,
|
|
"cancel_url": "http://localhost/user_upgrade/new",
|
|
"client_reference_id": "user_12345",
|
|
"currency": "usd",
|
|
"customer": "cus_000",
|
|
"customer_email": null,
|
|
"livemode": false,
|
|
"locale": null,
|
|
"metadata": {
|
|
"purchaser_id": "12345",
|
|
"recipient_id": "12345",
|
|
"purchaser_name": "user_12345",
|
|
"recipient_name": "user_12345",
|
|
"upgrade_type": "gold_upgrade",
|
|
"is_gift": "false",
|
|
"level": "30"
|
|
},
|
|
"mode": "payment",
|
|
"payment_intent": "pi_000",
|
|
"payment_method_types": [
|
|
"card"
|
|
],
|
|
"payment_status": "paid",
|
|
"setup_intent": null,
|
|
"shipping": null,
|
|
"shipping_address_collection": null,
|
|
"submit_type": null,
|
|
"subscription": null,
|
|
"success_url": "http://localhost/user_upgrade?user_id=12345",
|
|
"total_details": {
|
|
"amount_discount": 0,
|
|
"amount_tax": 0
|
|
}
|
|
}
|
|
},
|
|
"livemode": false,
|
|
"pending_webhooks": 3,
|
|
"request": {
|
|
"id": null,
|
|
"idempotency_key": null
|
|
},
|
|
"type": "checkout.session.completed"
|
|
}
|