#.abishek

1 messages · Page 1 of 1 (latest)

pulsar escarpBOT
foggy glade
#

I have the following code

const options = {
    clientSecret: key,
}
this.elements = this.stripeObject.elements(options);

if (enableStripeLink) {
    const linkAuthenticationElement = this.elements.create("linkAuthentication", {
        defaultValues: {
            email: prefillEmail
        }
    });
    linkAuthenticationElement.mount("#link-authentication-element");
}

const paymentElementOptions = {
    layout: layoutType,
};

const paymentElement = this.elements.create("payment", paymentElementOptions);
paymentElement.mount("#payment-element");

const expressCheckoutElement = this.elements.create('expressCheckout', {
    buttonType: {
        applePay: 'buy',
        googlePay: 'buy',
        paypal: 'buynow'
    }
})

expressCheckoutElement.mount('#express-checkout-element')
minor mirage
foggy glade
#

the expressCheckout element on the DOM is always empty. Am i missing something. I followed the instructions there

#

and this is what I see

#

I don't see the elements for expressCheckout

#

I am trying to add link, payment elements and express checkout

#

link and payment elements work, can't seem to get the express checkout to render

minor mirage
foggy glade
#

I see the pay with link and paypal button

#

but when I try it locally, the element doesn't get bound

minor mirage
#

Do you see any errors in console?

foggy glade
#

only warnings, no errors

#

ok, I see an error

Uncaught IntegrationError: In order to use the Express Checkout Element, you must specify a `mode` on stripe.elements() instead of `clientSecret`.
#

so I cannot use client secret with express checkout?

minor mirage
#

Looks like you didn't specify a mode

foggy glade
#

i added that but now I get this error

Uncaught IntegrationError: Invalid options for elements(): Expected either mode or clientSecret, but not both.
minor mirage
#

remove clientSecret

foggy glade
#

then that doesn't help because I am trying to associate a price object/subscription and express checkout for that

#

thats why I used the clientSecret

#

so, looks like I cannot use express checkout for subscriptions

pulsar escarpBOT