#akdj16

1 messages ยท Page 1 of 1 (latest)

placid elmBOT
dire jay
#

Hi there!

#

Can you give more details about your setup in this new thread?

#

Also what exactly doesn't work? Do you get an error message?

silent maple
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

languid comet
#

yes, I firstly created a setupIntent in the backend with payload payment_method_types= ['bancontact'], then in the frontend, i called the method confirmSetupIntent with paymentMethodType="bancontact" and paymentMethodData= { billingDetails: { name: ibanOwner, email: userEmail } } . When the payment method is attached to the customer. I tried to retrieve the setupIntent + expand 'latest_attempt' in the backend side with the setupIntentId provided by the frontend. And finally I get the error when I tried to update the customer with invoice_settings: { default_payment_method: generated_sepa_debit, },. the generated_sepa_debit is found in latest_attempt

#

the error message is : "PaymentMethods of type 'bancontact' cannot be saved to customers."

silent maple
#

do you have the request id?

languid comet
#

yesterday I tested with the customer cus_Mo1adwkTtYvOEs, request which failed is req_v6smwgtH7tmnY3

silent maple
#

do you have a request id where it was successful previously?

languid comet
#

I can try to find one

#

cus_MdXCTSVkrsqENs this customer created one month ago

#

req_MVlSjlb7eRKgNS this request?

silent maple
#

let me check

#

sorry for keeping you waiting

#

req_MVlSjlb7eRKgNS this is SEPA and not bancontact

languid comet
#

but on the customer page, when i open the pm_1LuGMQC36MeQgD8rDfAxi6cU, it shows a setupintent id seti_1LuGMJC36MeQgD8rwWZpDEjn , inside it is indicated as bancontact

silent maple
#

I meant that you're attaching the Bancontact instead of the underlying generated SEPA

#

just give me a moment please

silent maple
#

I still haven't figured this out yet

#

sorry for the delayed response

dense burrow
#

Hi there ๐Ÿ‘‹ apologies for the delay. I'm jumping in to lend a hand, please bear with me a moment while I catch up on the context here.

dense burrow
#

Actually, the PaymentMethod pm_1M4PdkC36MeQgD8rX3IkwpVd generated a sepa_debit one pm_1M4PdtC36MeQgD8rEAlvVd1A which is already attached to the customer cus_Mo1adwkTtYvOEs.
When creating the setup_intent you've already specified the customerId :
https://dashboard.stripe.com/test/logs/req_nEyQW8Aj7VHHEq
So the resulting PaymentMethod, will be attached automatically to the customer, no need to call attach API later

#

In other words, now you can use the attached PaymentMethod to the customer cus_Mo1adwkTtYvOEs for your payments

void pondBOT
#

This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact

spark aurora
#

@languid comet

languid comet
#

hi

spark aurora
#

How can I help?

languid comet
#

about the message of @dense burrow I know it is attached to the customer, but what I want is to set it as default payment method

#

because customer can also have card as the same time attached

spark aurora
languid comet
#

yes, that what I did, and I received the error message is : "PaymentMethods of type 'bancontact' cannot be saved to customers."

spark aurora
languid comet
#

I am a little confused now, why it is a paymentIntent? and not a setupIntent that have to be created?

#

I used the generated_sepa_debit in the setupIntent instead of the one in the paymentIntent

spark aurora
#

Can you please share which pm_xxx object you want to set as the default?

spark aurora
languid comet
#

in the document

#

pm_1M4PdkC36MeQgD8rX3IkwpVd to set

spark aurora
#

You can ignore that for the most part. I was highlighting that Bancontact PMs are single use and can't be saved/attached to a Customer object. Which is why you saw this error:

"PaymentMethods of type 'bancontact' cannot be saved to customers."

The part of that doc I was highlighting is that when you use a Setup Intent with Bancontact, we generate a re-usueable SEPA PM object which is attached to the related customer.

spark aurora
#

pm_1M4PdtC36MeQgD8rEAlvVd1A is the re-usable SEPA debit PM that is already attached to cus_Mo1adwkTtYvOEs

languid comet
#

oh ok so can I set the pm_1M4PdtC36MeQgD8rEAlvVd1A re-usable sepa as default?

spark aurora
#

Yes, exactly!

languid comet
#

do you mean that the generated_sepa_debit is pm_1M4PdtC36MeQgD8rEAlvVd1A ?

#

I need to reverify in my code, I think in my code, it shows that the generated_sepa_debit is pm_1M4PdkC36MeQgD8rX3IkwpVd

spark aurora
#

Yes, that's the re-usable SEPA PM we generated from the Bancontact details

#

pm_1M4PdtC36MeQgD8rEAlvVd1A is definitely the SEPA PM

languid comet
#

ok

#

let me try again

#

because I wrote something like:

       latestAttempt.payment_method_details.type === PaymentMethod.Bancontact
          ? (latestAttempt.payment_method_details.bancontact
              ?.generated_sepa_debit as string)
          : (setupIntent.payment_method as string),

but I get the error

#

in the payload of update customer

spark aurora
#

Can you share a req_xxx ID?

languid comet
#

I need to rerun the workflow with a new customer, i will be back in a few minutes

languid comet
#

I succeeded this time, I found out the bug in my code

#

thank you again!

molten rapids
#

Nice! Glad you could solve it. ynoj is out right now but I will pass that on. Thanks for the update!