#afenster

1 messages · Page 1 of 1 (latest)

echo valleyBOT
quick wagon
#

Hi, first to confirm a Payment you will need a frontend implementation (JS) instead of .NET

zealous garden
#

We are using Payment Element to make payments. However, we save the customer/PaymentMethod. My case here is the user selected to reuse their card ending in XXXX. This calls our .Net API which creates a PaymentIntent, adds Customer and PaymentMethod and then tries to confirm.

quick wagon
#

Ah okie that makes sense 👍

#

In that case it's good. And yes the return_url would be required since you chose automatic_payment_methods which is an option to let Stripe use available PaymentMethods from Dashboard. If you already know the type of the Payment Method, you can opt out of that parameter and specify card directly

zealous garden
#

Are you saying I can do a hybrid: selecting automatic payment methods for some things (like Apple Pay) but also specifying card payments directly?

#

And also, if I were to opt out of automatic payment methods, how do I specify what payment types I will allow?

quick wagon
#

Not sure what you mean for hybrid. You either specify automatic_payment_methods or payment_method_types when creating a PaymentIntent

#

payment_method_types will default to card if you don't specify anything tho

zealous garden
#

OK. So in this case, when I know that we are reusing a Card, I can just specify Card when I create the PaymentIntent? And then I can confirm with no webhook?

#

That is, how do I opt out of automatic payment methods?

quick wagon
#

Yes. You opt out just by not specifying the automatic_payment_methods parameter, or set it enabled = false

zealous garden
#

Aha! My function to create a PaymentIntent is setting AutomaticPaymentMethods enabled = true. So in this case, I just set it to false when creating the PaymentIntent? And then I can get a confirmation response immediately?

quick wagon
#

I think so! Let's try it in Test mode

zealous garden
#

How is that done?

#

OK, I tested it in my code and it worked. But I'm curious what you mean by trying it in Test mode.

quick wagon
#

I just mean in Test mode you can test anything

zealous garden
#

OK. It's working. Thank you for that.

#

One last question: if I was providing a return_url in my .Net code, what is that? Is that the url for my webhook?

quick wagon
#

No, that's the return_url in case you use a redirect-based URL. It's unrelated to webhook

zealous garden
#

OK, thank you. This was very helpful. Been struggling on this point.

#

Have a good night. If you're celebrating Thanksgiving, have a good one.