#binod-sepa-subscription

1 messages · Page 1 of 1 (latest)

gray lark
#

Hello! what do you need help with?

upper mesa
#

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

gray lark
#

Can you give some clear example ids of all those objects so we can help?

upper mesa
#

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 } } );

gray lark
#

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

upper mesa
#

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

cerulean forge
#

Hi @upper mesa! Some IDs would be helpful. Could you please share the ID of the customer or subscription?

upper mesa
#

this is customer id cus_LblqomI7tppLs4

#

and this is request id req_1u2HMECo8CBI6X

cerulean forge
#

Thanks, taking a look now 🙂

upper mesa
#

sure

cerulean forge
#

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

upper mesa
#

how do I allow it?

cerulean forge
#

If you want to charge automatically, then you have to update your collection_method to charge_automatically after collecting the SEPA debit payment method.

upper mesa
#

which API should I use to update collection_method ?

cerulean forge
upper mesa
#

okay, just update collection_method or some other properties as well?

gray lark
#

Just that one

#

basically you switch to charge_automatically so that future invoices get paid by the default payment method automatically

upper mesa
#

ok, what happens if there is not enough balance?

gray lark
#

Then the payment will fail and then the subscription will be canceled

upper mesa
#

is there an API to fetch attached default payment method?

#

using customer ID

gray lark
#

?

#

not sure in which context

upper mesa
#

I want to set collection method to send_invoice for iDeal if default payment is not present so.

gray lark
upper mesa
#

I got an error The payment method type idealcannot be used with subscriptions that have thecollection_methodset tocharge_automatically``

gray lark
#

Can you share the request id?

upper mesa
#

okay, that issue has been resolved

gray lark
#

Maybe you do need to flip payment_settings[payment_method_types] to ['sepa_debit'] in that case otherwise

upper mesa
#

but, still not charging automatically. Invoice is being created with open status

gray lark
#

Can you try and provide actionable information each time? Relevant code, example request id, exact invoice/subscription ids, etc.

upper mesa
#

request ID is req_bFvawy3vk2C5XY

#

also calling this API const result = await stripe.invoices.sendInvoice( updated.latest_invoice.id );

gray lark
#

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?

eternal meadow
#

Yep! Here to assist

gray lark
#

thanks a lot

upper mesa
#

even if I don't use sendInvoice, invoice is being created with open status

#

request ID is req_mclCe5nzisuIwY

eternal meadow
#

So, if I understand correctly, you're trying to create a subscription using a SEPA payment method that advances automatically?

upper mesa
#

yes

#

because, SEPA payment ID is already attached to customer's default payment method

#

am I missing something?

eternal meadow
#

I'm confused about what you are expecting on this Subscription. It's cancelled, so no payment attempt is going to be made

upper mesa
#

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

#

??

eternal meadow
#

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)?

upper mesa
#

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??

eternal meadow
eternal meadow
# upper mesa hello??

Please be patient. The server is busy and you're not the only person with questions

upper mesa
#

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

eternal meadow
#

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

upper mesa
#

this is the latest ID req_bYWhk2vWOmUwZL

eternal meadow
#

That's the Pay Invoice method. I mean the Subscription update event that causes an Invoice to be created in an open status

upper mesa
#

req_z5ykdJbSToznki

eternal meadow
#

Digging now and will circle back

upper mesa
#

ok

#

please be quick, it's been almost 2 hours. I have been asking same question

eternal meadow
#

@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.

upper mesa
#

got this error Invoices with pending payments waiting to clear cannot be paid, voided, or marked uncollectible.

eternal meadow
#

Request ID?

upper mesa
#

req_Yzn1B6Mf4LrnGy

eternal meadow
#

That is the request to pay the Invoice.

Try to update the Subscription like you were before, but remove payment_behavior: default_incomplete

upper mesa
#

Yes, I got the error after removing that line

#

this is subscription update ID req_p0qHHF0w5glWwl

eternal meadow
#

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