#omar alhity-subscription-data

1 messages ยท Page 1 of 1 (latest)

urban lynx
#

Hi ๐Ÿ‘‹ would you be able to elaborate a bit on what you're trying to accomplish?

summer wave
#

after customer subscribe

#

i want to insert in database amount & session_id & customer_id

#

how to get it from sucsess page

#

$_GET['session_id']
$_GET['amount_m']
$_GET['customer_id'] ?

urban lynx
#

Gotcha, thank you for that clarification. You can use this approach to append the ID of the checkout session to the success_url , which your success page can then consume.
https://stripe.com/docs/payments/checkout/custom-success-page

However, that approach relies on your customer successfully landing on and fully loading your success page in order for the information to be logged in your database, which we don't recommend as it puts your process at risk of being interrupted if your customer is unable to do so. For example, if the customer is on their phone on a train, and after hitting "subscribe" they go into a tunnel and lose service, they won't be able to load your success page and their order won't be logged in your database.

Instead we recommend leveraging webhooks for this part of your process:
https://stripe.com/docs/webhooks

summer wave
#

and what i want to customer portal to display billing

#

customer_id ?

#

$customer = \Stripe\Customer::retrieve($session->customer);

#

$customer->id;

#

can i get in this way ?

#

create-poratl-session.php?customer_id

urban lynx