#ilyeselb

1 messages ยท Page 1 of 1 (latest)

sonic saffronBOT
vagrant sleet
#

Hi! Let me help you with this.

unborn kestrel
#

it is because of this param payment_settings: {
save_default_payment_method: 'on_subscription',
},

#

?

vagrant sleet
#

i dont want it to be saved
What do you mean by this? Saved where?

unborn kestrel
#

Let me explain ,
the user can set his payment method before doing any payment

#

so i save it for him with the setup intent

#

now im a user but i dont want my card saved in the app

#

i fill the form to buy subscription

#

but its saving it asweelll to the custumer

#

because im retreving the custoomer paymentMEthod

#

and it appears there

#

i was wondering if it was because of this param on subscription creation

#

payment_settings: {
save_default_payment_method: 'on_subscription',
},

#

but if i dont set the default pm , is the subscription gonna be paid again in one month ? automatically

vagrant sleet
unborn kestrel
#

you didnt understand me right haha ?

#

no i dont have an exemple

vagrant sleet
#

If a Payment Method was used by a Customer it will be attached to it, but unless it was set up for future usage you won't be able to reuse it.

unborn kestrel
#

by future usage what do you

#

mean

#

?

#

chargin autmatically , or usiing the saved pm to pay other invoices

vagrant sleet
unborn kestrel
#

okay , but here im using paymentMEthod.list({custmerID]

#

im getting every paymentmethod used for subscritpion payment

vagrant sleet
#

What are you expecting to get instead?

unborn kestrel
#

only the one that i saved for future usage

#

with

#

saved with setup Intent

#

Now what IM GETTING IS THAT EVRY TIME I CREATE A SUBSCRITPION

vagrant sleet
#

I understand now, thanks.

unborn kestrel
#

a pm is saved and retreved

vagrant sleet
#

Let me check.

unborn kestrel
#

do you want a customer id ?

#

i can have it

#

the one that i test with

half thicket
#

Hi there ๐Ÿ‘‹ jumping in as my teammate needs to step away soon.

#

There isn't a parameter that you can provide when listing Payment Methods to only list ones that were processed via a Setup Intent. Do you have flows other than your Setup Intent ones that create Payment Methods? If so, you may need to add a way to track those.

unborn kestrel
#

no im createing subscription with deffered payment

#

collect payment before intent method

#

and its saving the pm

#

this is what im doing

half thicket
#

Sorry, I don't think I'm grasping the concern here. Are you trying to figure out how to adapt your flow to reuse an existing saved payment method rather than collecting a new one from your customer?

unborn kestrel
#

But sorry you never saw , that every payment have the save payment methode button where you can save your card and using it after inn other payment wothout clllecting any info

#

thats what im trying to explain since the beging

#

never mind i will check myself thank you

half thicket
#

I'm really sorry, I don't know what save payment method button you're referring to. I'm trying to understand what you're asking, but it's not clicking for me yet, and I'm sorry about that.

unborn kestrel
#

its okay loook in amazon we can do that

#

add a payment mothod then it saved there and i can use it directly

#

i did that with save paymentMEthod method , that save pm with payment intent

#

and retreve it with paymentMethod.list

#

but when i pay for a subscription with filling a form

#

it save the pm automatically

half thicket
#

Gotcha, so you're trying to create a new subscription using an existing payment method? In that case, you won't present a form to your customer to collect payment method details.

Instead, if it's a returning user that wants to reuse an existing payment method, you:

  1. List their available payment methods, and surface that list to the customer so they can select the one they want to use
  2. Create a new subscription for them, but when doing so you pass the ID of the selected payment method to the Subscriptions default_payment_method field:
    https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method
    then the customer doesn't need to be sent through the process to collect new payment method details.
unborn kestrel
#

okay this is what im doing , for paying subscription with saved card

  • the issue that im asking about , is when i dont want to pay with that card , i pay with filling the form
    when the payment is done , the payment method used , is automaticaly saved , how can i prvent that
half thicket
#

Saved on the Subscription? Why are you wanting to avoid that? What payment method are you hoping will be used for the Subscription's future payments if you don't save the one being provided?

unborn kestrel
#

normalluy in every payment , the user have the choice to save his payment method during the payment

#

so he can use it in other payments

half thicket
#

But Subscriptions require having access to a payment method if you're letting them charge automatically, otherwise the recurring payments will fail.

#

So if you're creating Subscriptions it typically makes sense to save the payment method so it will be used for future payments for that subscription.

unborn kestrel
#

okay thank you

unborn kestrel
#

for 3DS authentication required card

#

its failing to pay

#

what is the alternative

half thicket
#

Can you elaborate? Failing to pay as in the 3DS challenge isn't being surfaced/handled correctly? You want to have your flow ready to handle 3DS, it's used across most of Europe and is growing in popularity in other regions.

unborn kestrel
#

the invoice of that subscritpion still open

#

and not paid affter creating it with defaultPm (3DS auth one)

#

i will manage that by returning the error and confirming the card in the client its okay its seems that stripe dosent have an alternativ for that

half thicket
#

Did the payment encounter a failure?

unborn kestrel
#

and im creting the subscription with defaultPm and offSession: true

#

the invoice id

#

in_1Nt9SqGyOBDbEOMCrT3KfTrW

half thicket
#

offSession isn't a parameter for Subscriptions. Taking a closer look at the Invoice.

#

I see, you used a test card that always requires 3DS to be completed in order for payemnts to be successful. So that's testing/catching the scenarios where an issuer may require authentication, even if the card has been set up or used in the past. Getting the associated client secret, bringing the customer back on session, and doing a client-side confirmation of the Invoice's intent would be a good approach for that.

unborn kestrel
#

yes thats what i was thinking about thanks,

#

do we have have an error response that i can base my self on

#

to redirect the client to confirmPayment ?

half thicket
#

I think so, double checking

#

Yup, it looks like when you're creating the Subscriptions you're expanding latest_invoice.payment_intent, so the response should contian the Payment Intent for the Invoice and you can check its state. So you can look at latest_invoice.payment_intent.status looking for when that is set to requires_action.

unborn kestrel
#

gracias , its was helpfull

#

sorry for this amount of time

#

that i took from you

#

and have a good day

half thicket
#

No worries, I'm glad I was able to help!

#

Hope you have a great day and weekend ๐Ÿ˜„

unborn kestrel
#

you too