#Nishu
1 messages · Page 1 of 1 (latest)
Can you share with me the checkout session IDs of these two scenarios ?
Yes
cs_live_a1BidyWqiL3gVBhI8CDTa2f8pJH9SBSAgDPo2l6VzAA019WO7W9t2a8J7Z
cs_live_a1kKG50gzOzHIIVm2jCuAcrxJMtr4ZrXNN1dWpwCngQj13dkgXuPqHGiyl
sorry if i'm being a little sloppy here, i'm just trying things out
I have PI and customer IDs for both cases, if that'll help to understand the situation a little bit better, thanks!
by the way, does posting it here makes sensitive info public?
OK, let me explain:
For cs_live_a1BidyWqiL3gVBhI8CDTa2f8pJH9SBSAgDPo2l6VzAA019WO7W9t2a8J7Z, it was created with customer_creation: "if_required"
https://dashboard.stripe.com/logs/req_IyB11pmSk5xYAu , so no customer is created.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
For cs_live_a1kKG50gzOzHIIVm2jCuAcrxJMtr4ZrXNN1dWpwCngQj13dkgXuPqHGiyl, it was created without customer_creation, which default value is always for API version 2019-05-16, and that's why it results in creating a customer.
i see, so with 1st one, a customer is created but as a guest, and the card is being saved, for the 2nd time no "customer_creation" param passed, so the customer is created, but the card is not saved, is that correct? does saving the card related to this or is it something else? thanks!
No, for 1/ no customer is created. a guest customer is not an actual customer.
2/ the payment method is not saved because setup_future_usage is not set. https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i see, thanks! so for the 1st case, although the real customer is not created (guest), the card info is being saved because of "setup_future_usage"? is that the checkbox from the customer's end while making payments using Stripe Checkout?
or should i explicitly pass "setup_future_usage", under "payment_intent_data" for that?
You need to explicitly set the setup_future_usage
understood, thanks!
so i've added setup_future_usage with off_session as we would like to charge that card later, now I've tried this in test mode and with test card (4242), so i'm seeing customer ID in both charge.succeeded and payment_intent.succeeded webhook call returns, and I can see the card in payment methods section of that customer, but when i'm trying to create charge using that customer ID, i'm getting "Cannot charge a customer that has no active card", what am I doing wrong here?
should i pass the customer ID in here?
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
thanks!, this is the checkout: req_0PHZJqSabmKo2Z
and this is for the charge:
req_vkxDup0HQC0Ql7
OK, you need to use PaymentIntent API, not Charges API, see details in https://stripe.com/docs/payments/save-and-reuse?platform=web#charge-saved-payment-method