#xvk-prbutton
1 messages · Page 1 of 1 (latest)
hello, let's start here:
1/ are you using Safari "private" browsing mode?
2/ go here https://stripe.com/docs/stripe-js/elements/payment-request-button
in Safari in a regular window and let me know if you see the Apple Pay button or not
I'm not in private browsing, and do see the button for apple pay there
ok now in the docs link I sent, what happens if you click the Apple Pay button?
does the modal stay or does it disappear
the modal works fine
the issue isnt collecting payment with apple pay, its that the function to detect which payment methods are available is returning incorrect values
yeah I understand, I'm just starting at a place to rule things out
looking at my own integration one sec
ok tried on my integration, works as expected in that it returns
on Safari
now to narrow down more
how are you initializing Stripe.js and PaymentRequest Button in your code?
Or PaymentElement if you're using that
let me check. its been a while
we're importing a module
import { PaymentRequest, Stripe } from '@stripe/stripe-js';
sure and how are you initializing PaymentRequest in your code
useOnMount(() => {
paymentRequestRef.current = stripe.paymentRequest(paymentRequestOptions);
});
later, in an effect,
paymentRequestRef.current
?.canMakePayment()
.then((result) => {
setAvailablePaymentMethods(result || NoPaymentMethodsAvailable);
})
I'm interested in what paymentRequestOptions are
can you log those out to console and paste them here
i can post stuff here later today, have to do the whole ngrok thing to have apple pay work on local. thanks for your help, feel free to ignore this thread for now
sure, when you come back with more info, feel free to ask another developer to reopen this thread for you