#arslan_express-checkout-element

1 messages ¡ Page 1 of 1 (latest)

heavy oakBOT
#

👋 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.

tranquil haloBOT
wild reef
#

The Payment Request is a browser API, not something Stripe builds. It does not accept Metadata

lime locust
#

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?

wild reef
#

Not by itself, no

#

What integration are you building?

lime locust
wild reef
#

How are you collecting payment?

lime locust
#

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

wild reef
#

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.

lime locust
#

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?

wild reef
#

The PaymentRequest doesn't auto-magically generate a Payment Intent. At some point in your integration, you have to create one

lime locust
#

Ok sure. Btw, do you have a better way to add a custom google/apple pay button?

wild reef
#

Honestly I would just use Express Checkout Element and restrict the available wallets to only Apple/Google Pay

lime locust
#

That sounds good! How do you restrict the available wallets?

wild reef
lime locust
#

thanks, will check out

wild reef
#

It doesn't have to. You can initiliaze the elements with or without a client secret

lime locust
#

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?

wild reef
#

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