#moses-ApplePayGooglePay

1 messages · Page 1 of 1 (latest)

limber star
rapid oyster
brisk gazelle
#

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

rapid oyster
#

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
});
limber star
#

Yes that could work too. I meant the page above is easier to just visit by the device's browser

rapid oyster
#

That snippet is not whether the device supports it, more that the device has payment/cards already setup and valid ready to go.

limber star
#

Yes, same with the page I would say. The page having a button implemented in same way

rapid oyster
#

Yeah, took a while to figure out that Google / Apple buttons are only present if already setup in that users browser / device

limber star