#arslan_express-checkout-element
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1228450949354225734
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
The Payment Request is a browser API, not something Stripe builds. It does not accept Metadata
Is there any way around. Because Stripe builds the abstraction on top, right? Does it generate a paymentIntent id under the hood? Does it even trigger the Webhook?
Wanted to add a custom button for google/apple pay
How are you collecting payment?
I mean I have the normal stripe element with card (and it also shows the wallet). I have a serverless lambda function which generates the paymentID and then I mount it using the SDK. I also want to add a custom button that just hits google pay/apple pay
Okay so what I am telling you is there is no way currently to add metadata to the PaymentRequest object and we are extremely unlikely to implement this. If you want to add some metadata to these purchases I recommend sending it back to your servers to add to the Payment Intent.
Ok sounds good, how would that work. Where can I find the Payment Intent associated with the PaymentRequest object? Btw, does it trigger the webhook?
The PaymentRequest doesn't auto-magically generate a Payment Intent. At some point in your integration, you have to create one
Ok sure. Btw, do you have a better way to add a custom google/apple pay button?
Honestly I would just use Express Checkout Element and restrict the available wallets to only Apple/Google Pay
That sounds good! How do you restrict the available wallets?
https://docs.stripe.com/elements/express-checkout-element
We cover restricting wallet types here: https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#wallet-control
You can do it both in your Account settings and in the JavaScript when you create the Element
thanks, will check out
https://docs.stripe.com/elements/express-checkout-element#create-an-express-checkout-element => doesn't stripe.elements accept a clientSecret?
Ok, but I could initialize it with the client secret, this way it's linked to the payment Id, right? Then it would be just like the normal elements
And can I use the same client secret for both the normal card integration and stripe express?
You use the client_secret to create an elements object. You would then use the same elements object to create both the Payment Element and the Express Checkout Element. That would like both of them to one Payment Intent