#binod-sepa-subscription
1 messages · Page 1 of 1 (latest)
I am using SEPA with iDeal is subscription
I am using setupIntents and customers.update API to link SEPA with customer
but, after setting default payment setting for customer, SEPA details are not being used
Can you give some clear example ids of all those objects so we can help?
you mean request ID?
im using this code to setup payment const setupIntent = await stripe.setupIntents.create({ payment_method_types: ['sepa_debit'], customer: customer_id, });
and this one to attach SEPA as default payment for customer return stripe.customers.update( body.customer_id, { invoice_settings: { default_payment_method: body.default_payment_method } } );
Well any relevant id that you can give us to help you debug since right now you said "does not work" but you didn't say what didn't work yet.
request ids would help or the customer id at least
let me give you a context, I am creating subscription using Card and iDeal. In case of iDeal I am also setting up SEPA as a default payment method. Now what I expect is when I upgrade/downgrade subscription, it should automatically pay with SEPA details right? But, I am still getting invoice from iDeal to pay.
Since I have attached SEPA with customer, I don't understand why its not being paid by SEPA
Hi @upper mesa! Some IDs would be helpful. Could you please share the ID of the customer or subscription?
Thanks, taking a look now 🙂
sure
It looks like you're creating the subscription with payment_method_types=[ideal] and collection_method=send_invoice, which means we will not automatically charge the default_payment_method -- https://dashboard.stripe.com/test/logs/req_dbGUvfS8COPkwj -- you'll have to allow your subscription to take sepa_debit
how do I allow it?
If you want to charge automatically, then you have to update your collection_method to charge_automatically after collecting the SEPA debit payment method.
which API should I use to update collection_method ?
You can use the Subscription update API to do that: https://stripe.com/docs/api/subscriptions/update#update_subscription-collection_method
okay, just update collection_method or some other properties as well?
Just that one
basically you switch to charge_automatically so that future invoices get paid by the default payment method automatically
ok, what happens if there is not enough balance?
Then the payment will fail and then the subscription will be canceled
?
not sure in which context
you set the default payment method yourself earlier so it's on the Customer, so you can call https://stripe.com/docs/api/customers/retrieve to look at it
I want to set collection method to send_invoice for iDeal if default payment is not present so.
cool then https://stripe.com/docs/api/customers/retrieve (or caching it in your database) is best
I got an error The payment method type idealcannot be used with subscriptions that have thecollection_methodset tocharge_automatically``
Can you share the request id?
okay, that issue has been resolved
Maybe you do need to flip payment_settings[payment_method_types] to ['sepa_debit'] in that case otherwise
but, still not charging automatically. Invoice is being created with open status
Can you try and provide actionable information each time? Relevant code, example request id, exact invoice/subscription ids, etc.
request ID is req_bFvawy3vk2C5XY
also calling this API const result = await stripe.invoices.sendInvoice( updated.latest_invoice.id );
why do you use sendInvoice since the goal is to move off of send_invoice entirely I'm confugsed
@eternal meadow can you take over now?
Yep! Here to assist
thanks a lot
even if I don't use sendInvoice, invoice is being created with open status
request ID is req_mclCe5nzisuIwY
So, if I understand correctly, you're trying to create a subscription using a SEPA payment method that advances automatically?
yes
because, SEPA payment ID is already attached to customer's default payment method
am I missing something?
I'm confused about what you are expecting on this Subscription. It's cancelled, so no payment attempt is going to be made
I just cancelled it
I just want automatically charge when SEPA is attached with customer
which is not happening. It's only creating invoice with open status not paid
??
I think the issue is that, since the payment for the subscription had already been tried with another payment method, we would normally automatically retry payment, but payments are never automatically retried for SEPA DD.
Have you been able to get it to work for new subscriptions?
If so, can you try updating an existing subscription with a SEPA DD payment method and try calling stripe.Invoice.pay() on the Invoice attached to the Subscription (using the SEPA DD payment method ID)?
I didnt get it. If customer has SEPA DD attached, it should automatically charge right?
didnt find this method as well stripe.Invoice.pay()
hello??
Sorry, that's for Python specifically. Here's the method I'm talking about: https://stripe.com/docs/api/invoices/pay
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Please be patient. The server is busy and you're not the only person with questions
I also tried node API
not working
only issue is invoice is being created as open instead of paid
this is the request ID req_B9jcv0GD6uqKcW
So paying the invoice as a separate call works. Can you replicate the behavior you're seeing once more and post the request ID for it? I want to check in on something
this is the latest ID req_bYWhk2vWOmUwZL
That's the Pay Invoice method. I mean the Subscription update event that causes an Invoice to be created in an open status
req_z5ykdJbSToznki
Digging now and will circle back
@upper mesa #994279187437330442 message
Please be patient. The server is busy and you're not the only person with questions
@upper mesa can you attempt to update the subscription as you did above, but remove this line?
‘payment_behavior: default_incomplete’
payment_behavior: default_incomplete causes the subscription to await explicit confirmation of the invoice’s payment intent.
got this error Invoices with pending payments waiting to clear cannot be paid, voided, or marked uncollectible.
Request ID?
req_Yzn1B6Mf4LrnGy
That is the request to pay the Invoice.
Try to update the Subscription like you were before, but remove payment_behavior: default_incomplete
Yes, I got the error after removing that line
this is subscription update ID req_p0qHHF0w5glWwl
I'm looking at the request you sent me (req_p0qHHF0w5glWwl) and there is no error. The request successfully updated the subscription and advanced it to paid