#.abishek
1 messages · Page 1 of 1 (latest)
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')
Hi there, you can follow this guide to start your integration https://stripe.com/docs/elements/express-checkout-element#create-an-express-checkout-element
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
https://stripe.com/docs/elements/express-checkout-element#try-demo do you see Express Checkout Element if you visit this demo page?
I see the pay with link and paypal button
but when I try it locally, the element doesn't get bound
Do you see any errors in console?
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?
Looks like you didn't specify a mode
i added that but now I get this error
Uncaught IntegrationError: Invalid options for elements(): Expected either mode or clientSecret, but not both.
remove clientSecret
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