#knock2hell_unexpected
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- knock2hell_sub-pending-updates, 1 hour ago, 143 messages
- knock2hell_code, 5 hours ago, 44 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1244975998814912543
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
What's the sub_xxx ID that fails to renew?
sub_1PLO7wSCiougwFxyIlahI8Fq
i use this code to create subscription
subscription = stripe.Subscription.create(
customer=customer_id,
items=[{'price': price_id}],
default_payment_method=payment_method_id,
expand=['latest_invoice.payment_intent'],
discounts=[{'promotion_code': coupon_code}] if coupon_code else [],
)
and use simulation time to check
Looks like authentication/3DS was requested by the bank on the most recent invoice, as per the payment_action_required event: https://dashboard.stripe.com/test/events/evt_1PLOBRSCiougwFxyqVzC2FSY
Which is expected with the 3184 test card that you used to make the initial invoice payment:
This card requires authentication on all transactions, regardless of how the card is set up.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
but if user create a subscription why he need to go through 3ds every time
like if you purchase Netflix subscription, you dont need to go through 3ds it automatically charge and renew
That's just how that card works. It's a test card which purpose is to force 3DS requirement for every payment
how it will work in real like
You probably want to test with 4000002500003155 instead which behaves more inline with what you describe:
This card requires authentication for off-session payments unless you set it up for future payments. After you set it up, off-session payments no longer require authentication.
To be clear though, 3DS/auth can be requested for recurring/off-session payments even if the initial once succeeds. So you integration needs to handle that
Your code to create the subscription is fine, but you'll likely need to add new code to handle the scenario I just described
so how can i handle it
Well you can enable our emails which we'll send to the customer if their payment(s)n fail: https://docs.stripe.com/billing/revenue-recovery/customer-emails#failed-payment-notifications
Or you can implement something similar yourself where you listen for invoice.pament_failed events and notify the customer, bring them back online to your site and then retry the invoice payment via Stripe.js which will handle the 3DS/auth flow for the payment
ok let me try
Your integration as it is now will work fine with the 4000002500003155 card: we'll do 3DS/auth for the first payment which will correctly setup the card for recurring payments to succeed
But these test cards are designed to emulate payment scenarios that can happen in your live integration. In this case a recurring payment decline/failure
i created setup intent(usage='off_session') then created payment method(verify 3ds) and attached it to a customer with default payment then i created a subscription and verify 3ds
the subscription is created and active
Well, that's the wrong way to do things
But regardless of how you save/setup the 3184 it will always require auth/3DS for every payment as per the description
what is right way
so i have to verify 3ds at the beginning only
The Setup Intent is redundant as the save/setup will be handled by the intent generated by the subscription. See: https://docs.stripe.com/billing/subscriptions/build-subscriptions?platform=web&ui=elements#collect-payment
Well, you can't guarantee that 3DS/auth will only occur on the initial payment as I've stated throughout
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
ok
Could you please summarise for me what's the latest question?
is customer need to verify 3ds or subscription renew
It's unlikely that 3DS will be required if the Payment Method was set up correctly, but it's not 100% guaranteed.
also if user updates the default payment method then he will charge with a new default payment method or old payment method that attach to subscription
How did you try the 4242 card exactly?
it works, it took some time
also if user updates the default payment method then he will charge with a new default payment method or old payment method that attach to subscription
are you there
?
user updates the default payment method
Where exactly?
If you update the Subscription.default_payment_method it will be charged on the next billing date: https://docs.stripe.com/api/subscriptions/update#update_subscription-default_payment_method
if i update the update customer's default payment method does it automatically charge charge from it
for renewal of subscription
You mean Customer.invoice_settings.default_payment_method? https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
If so, no, if Subscription.default_payment_method is set, it will take precedence.
Hi there ๐ jumping in as my teammate needs to step away soon. If a Payment Intent was created from an Invoice, the ID of the Invoice is stored in the invoice field on the intent:
https://docs.stripe.com/api/payment_intents/object#payment_intent_object-invoice
The Payment Intent you shared was not created by an Invoice, so there is no Invoice object associated with it.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can i create invoice for an amount and pay directly with default payment method
Yup, we have several guides for walking through that, depending on how exactly you want to accomplish that, which you can find and read through here:
https://docs.stripe.com/invoicing
This is a good starting point for an API based integration:
https://docs.stripe.com/invoicing/integration