#Danik

1 messages · Page 1 of 1 (latest)

radiant nestBOT
vagrant oasis
#

Hi there, can you share with me the code on how you create and mount the link_authentication_element?

radiant meteor
#

Hi, yeah sure

#

First of all, I want to stay with the "AutomatedPaymentMethod.Enabled = true", so customers will have all the available payment method. Secondly, I if customers use the Card payment method, then there should be available the Link payment they previously saved on any other Stripe-integrated websites.

#

That's my goal

vagrant oasis
#

Give me some time to read your code and I'll get back to you soon

radiant meteor
#

Yeah, no problem )

vagrant oasis
#

Hmm, are you creating a SetupIntent instead of a PaymentIntent in your backend?

radiant meteor
vagrant oasis
#

can you check if you backend is returning a valid paymentIntent client secret?

radiant meteor
#

yes it does

#

pi_3Lp3pTIjD9jLTt0t1MjFo9Q7

#

for example

vagrant oasis
#

This is paymentIntent ID, not client secret.

radiant meteor
#

pi_3Lp4hNIjD9jLTt0t1QgXfjDf_secret_WWL6aeibwWrDR2ozJP989rKG3

#

this one I captured after AJAX-call

#

on client side JavaScript

vagrant oasis
#

Do you see any errors in browser console log?

radiant meteor
#

This error don't seem to be related to Stripe

vagrant oasis
#

Is the payment element showing up in your page?

radiant meteor
#

yes it is

vagrant oasis
#

Ok, I think I know the problem

#

you need to pass link as one of the payment_method_types when creating a paymentIntent

radiant meteor
#

But I use AutomatedPaymentMethods.Enabled = true

#

Should I turn it off?

#

Enabled = false?

vagrant oasis
radiant meteor
#

Yes it is turned on by default

#

I checked it today

vagrant oasis
#

Hmm, can you remove the automatic_payment_methods, and explictly set a payment_method_types that includes link ?

radiant meteor
#

ok I'll try it

#

but we prefer to use Automatic payments

#

my company wants to manage them from the dashboard

vagrant oasis
#

Hmm wait

#

Your account country is JP where Link is not yet available

radiant meteor
#

oh ok )

#

is there any alternatives to the Link?

#

I want to autofill credit cards

vagrant oasis
#

There's a link in the page for you to sign up for early access

#

Checkout can also help you pre-fill the credit cards if you specify a customer that has credit card attached it it.

radiant meteor
#

Can you provide an example?

#

I have both Customer Id and Payment Method Id with saved credit card

#

but can't figure out how to pass them to the PaymentIntent

#

so it will be pre-filled

vagrant oasis
#

To use Stripe Checkout, you need to create a Checkout Session instead of a PaymentIntent

radiant meteor
#

ok, I'll check it thank you

vagrant oasis
radiant meteor
#

I have another question.
Is there a way somehow to capture the event when customer switches from one PaymentMethod to another on web-page:

#

I want to capture this event on JavaScript code.

#

Client-side

#

So I could show additional UI elements to the user.

#

For example, if the "Card" element is active, I show "Pay with previously saved card" button, if another iDEAL is active I hide it and etc...

vagrant oasis
#

No there's no API to capture such tab switching events

radiant meteor
#

ok, thank you anyways