#moses-ApplePayGooglePay
1 messages · Page 1 of 1 (latest)
Visit this page and test the button https://stripe.com/docs/stripe-js/elements/payment-request-button
Programmatically we used this
I see using the custom button, how to determine if the current device supports payment, such as if the user'S VPN is in the US, or if the device is too old
e.g.
const stripe = Stripe(stripeClientToken);
const paymentRequest = stripe.paymentRequest({
country: "AU",
currency: "aud",
total: { label: "Total", amount: youramounthere },
});
paymentRequest.canMakePayment().then(({ applePay, googlePay }) => {
//use applePay and googlePay bools
});
Yes that could work too. I meant the page above is easier to just visit by the device's browser
That snippet is not whether the device supports it, more that the device has payment/cards already setup and valid ready to go.
Yes, same with the page I would say. The page having a button implemented in same way
Yeah, took a while to figure out that Google / Apple buttons are only present if already setup in that users browser / device