#aasdfasa3

1 messages · Page 1 of 1 (latest)

upper meadowBOT
sturdy wigeon
#

Can you share the details of how you're integrating this?

iron cedar
#

Thanks for messaging back so quickly!

Here is my HTML:

            <form id="payment-form">
                <div id="stripe-payment-wrapper" style="padding-bottom: 16px;">
                    <div id="payment-element"></div>
                    <div id="link-authentication-element"></div>
                </div>
            </form>

Here is my JS:

    $(document).ready(function() {
        let stripe = Stripe('{{PSConfig.api_stripe_key}}');
        let elements = stripe.elements({clientSecret: '{{stripe_client_secret}}'});
        let style = {
            base: {
                color: '#32325d',
                lineHeight: '20px',
                fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
                fontSmoothing: 'antialiased',
                '::placeholder': {
                    color: '#aaa'
                }
            },
            invalid: {
                color: '#fa755a',
                iconColor: '#fa755a'
            }
        };
        let widthPx = screen.width*window.devicePixelRatio;
        if (widthPx >= 780)
            style.base.fontSize = '18px';
        else if (widthPx > 700)
            style.base.fontSize = '16px';
        const paymentElement = elements.create('payment');
        paymentElement.mount('#payment-element');
});

And my backend code creates a simple PaymentIntent:

        import stripe
        stripe.api_key = PSConfig.api_stripe_secret
        intent = stripe.PaymentIntent.create(
            amount=100,
            currency='usd',
            automatic_payment_methods={
                'enabled': True,
            },
        )
#

It shows the Payment Element and Link Authentication Element, but when I enter my email address, it does nothing.

sturdy wigeon
#

Ok thanks, let me take a look at my own implementation here

iron cedar
#

Looks like my JS got cut off.

I have this in it too:

        const linkAuthenticationElement = elements.create("linkAuthentication", {defaultValues: {email: "", billingDetails: {phone: "+1XXXXXXXXX"}}});
        linkAuthenticationElement.mount("#link-authentication-element");
        let card = elements.create('card', {style: style});
sturdy wigeon
#

ok, i've done some testing on my end and do see this, so lets try to get some more detail on yours

#

to confirm, are you using an email address that you've already completed payment with and saved for later with Link?

iron cedar
#

Yes, my personal email address. Would you like it?

sturdy wigeon
#

No, I don't need that

upper meadowBOT
sturdy wigeon
#

Once you complete payment with the Link registration with an email, it should prompt for the one time code when entered later

#

If you did this in live mode and signed up for real, that's not refelcted in test mode

#

Have you completed payment & registration with that email on your account in test mode?

iron cedar
sturdy wigeon
#

Sure, because that email has been registered for link on the account behind that demo 🙂

#

But it should work if you complete the payment with your email, including the link signup flow (use a fake phone, doesn't need to be real)

#

then if you load up your demo again and enter the same email, you should ge tthe OTP prompt

iron cedar
#

Ahh, that makes sense! I'll give that a try and see if I can get it working.

Just to be clear though, in production, it will pop up right away, if the user has a Link account already. Correct?

sturdy wigeon
#

Correct!

#

In live mode this is global across Stripe, the segmentation by account is a test mode only behaviour

iron cedar
#

Great! I'll give it a try shortly, but it all makes sense now.