#tiffany-applepay
1 messages ยท Page 1 of 1 (latest)
hello, don't test them in private browsing, that returns a false positive in that canMakePayment() is always true in private browsing mode even if you aren't actually set up for Apple Pay
but if a user is set up correctly, then they can still use Apple Pay in private browsing
Thanks! I am still getting null in safari and false in chrome. My payment methods have been verified on other sites that they are setup correctly.. I'm just at a loss at this point
Hello! Can you give us a link to the page with the issue so we can investigate on our end?
it is unfortunately behind a VPN
can i share some code or run some recommended tests? console logs? network results?
First thing to do is make sure Apple Pay/Google Pay works in the browsers you're using. If you go here do you see an Apple Pay/Google Pay button above the "HTML + JS" tab? https://stripe.com/docs/stripe-js/elements/payment-request-button
Okay, that's good! Next, on your own page, do you see any errors or warnings in the web dev console when you visit the page where the Apple/Google Pay button should show up?
Yes on Safari I have an error that says Either your wallet has not been setup or your domain is not registered with Apple Pay
What about in Chrome with Google Pay?
But you did see a Google Pay button on https://stripe.com/docs/stripe-js/elements/payment-request-button in Chrome?
No I see a Pay Now button
Ah, okay, so that means you don't have a Google Pay card set up in Chrome that's compatible with Stripe.
So that's why Google Pay isn't working.
For Apple Pay it's likely an issue with your Apple Pay domain. Are you using Connect?
what is connect
ok I'm using a real card in google pay
do I need to use a test card
Connect is our product for marketplaces: https://stripe.com/connect
Is Elements the same thing
There's no way to add a test card to an Apple Pay or Google Pay wallet, but you can test with live cards in Stripe's test mode without being charged.
No, Elements is separate.
Let's focus on one payment method at a time, either Apple Pay or Google Pay; which do you want to start with?
Lets get Google pay working I guess. Seems the simplest
so I do have a live card in my payment method
Okay, so with Google Pay it's important to understand that cards saved locally in Chrome do not count as Google Pay cards. Do you see at least one card here? https://pay.google.com/gp/w/u/0/home/paymentmethods
in Chrome
ooh ok checking now
I do not
ok I will add one and be back
ok I have one added now
Okay, if you go back to https://stripe.com/docs/stripe-js/elements/payment-request-button do you see a Google Pay button now?
No, I still get the Pay Now button
Chrome on desktop is a little strange with Google Pay. Sometimes it doesn't work correctly in the beginning. Can you try going to this test page, click on Buy, cancel out of the payment sheet, then reload the Stripe page above and see if Google Pay appears? https://rsolomakhin.github.io/pr/gp2/
ok
same button
on the test site I get "Can make payment" then "No enrolled instrument"
is that normal
it does pull up the payment sheet w/ my card available there
Hm. Maybe restart Chrome and try again?
Hm. What card brand is it? Visa? MasterCard?
Mastercard
If you go to chrome://settings/payments do you see your card listed there with "Google Pay" next to it?
whew!
Okay, now for Apple Pay...
ok I'm checking on my site now
If you go to https://dashboard.stripe.com/settings/payments/apple_pay do you see your domain listed there under Web domains?
Yes
Okay, hm. It's going to get more difficult to figure out what's wrong if I can't see your site. Can you share the code you're using to initialize Stripe.js and create the Payment Request and Payment Request Button?
Thanks! Does the publishable key you're using start with pk_test_?
also for chrome & google pay.. when I said it's working on my site now I mispoke. I meant to say it is working on Stripes site. I'm getting an Apple Pay error on my chrome on my personal site:
the stripe key? it does, yes
Oh, okay, let's go back to Google Pay then... so it's working on Stripe's site, but not yours?
yes correct
i am getting true back for Google Pay now
but it looks like it goes on to try apple pay
and returns null.
I'm assuming that is in my code
Yeah, that's expected. I think you need to modify your code to account for that possibility.
Probably best to fix that before continuing.
So I managed to get an apple pay button but I do see a 400 code from stripe in my console
Can you share more details?
Yes
I have a lot of console logs but here is the screen shot of the error
this.paymentRequest.canMakePayment().then(result => {
console.log('result' + result);
if (result) {
this.checkoutService.supportBrowserAppleGoogle = result;
// if (result.applePay === true && this.featuresService.featureIsOn('web_stripe_apple_pay')) {
// prButton.mount('#apple-pay-button');
// console.log('apple pay stripe');
// }
if (result.googlePay === true
// && this.featuresService.featureIsOn('web_stripe_google_pay')
) {
prButton.mount('#google-pay-button');
console.log('google pay stripe');
}
} else {
this.checkoutService.supportBrowserAppleGoogle = { applePay: false, googlePay: false };
console.log('else2');
}
Here is the code from that same area
that 400 is irrelevant, you can just ignore it
it's something we use for metrics and some requests are blocked but it's fine
ok yay! So Rubeus helped me get the Google pay working and then we were going to move on to Apple
awesome! Rubeus is a wizard ๐
YES I could tell
so I'm still getting a null on the apple pay side of things
we verified my payment is working w/ the Stripe site that shows the button at the top
it could be many things. We'll need to see the page live to help you debug
is it really impossible for us to see it? I'm really confused why you'd put an Apple Pay button on a website behind a VPN in the first place and how Apple would register/verify the domain
And sure we can try, but that will be like pulling teeth ๐ฆ
It's my companies testing environments.. I dont have a say in it.
It'll enventually be pushed up to production and on a live site
but has to pass QA
we have our verification file public
Damn okay.
@mortal pasture could you try https://4242.io/apple-pay-domain-checker/ by any chance?
yea lemme try that! I didnt know that existed
yeah it's not official but we've found it helpful to debug
yea it says my domain is not setup correctly
hmm.
do I need to include the https?
no
could that be because it is behind a VPN?
but it does means something is not registered properly
ok I tried both ways
Are you sure the domain is registered in your account settings?
ok.. I dont have access to the Stripe login ๐
I will get with a lead dev tomorrow and have him login
can you send me a link to the steps
do you have any specific id for the account like a request id req_123 or a token id tok_123?
I can use it to double check if something is registered
hmm...
lemme see
would that be a pk_test?
thats the key ..
would the token id be in my code somewhere? or I could console log it potentially?
I meant any Stripe id about your integration. It's hard to say what, depends on so many factor, but your code must be creating a PaymentIntent or PaymentMethod or Charge or Token or Source or any other relevant object id you could share that wouldn't be your Test API key
setupButton() {
this.elements = this.stripe?.elements();
this.paymentRequest?.on('token', ({ token }) => {
this.token = token;
console.log('token ' + this.token);
});
^this?
yes the token id, the tok_123
ok.. I havent actually had my code get that far so I havent had it print out yet
I'll see if I can move that call up
might be easier to come back to this tomorrow at this point though since Google Pay got unblocked and for Apple Pay it's likely a domain registration issue
ok I can do that too.. I'm waiting on my pipeline to build
after moving up the token build
sounds good
Yea I wasnt able to get that id
I'll hop back on tomorrow
Thanks for your help!
sure thing!
Hello again!
Hey Rubeus, you helped me get my Google pay button working yesterday evening and now I'm still struggling w/ Apple Pay. I used this site to test my registration and it says it is not setup correctly. However, it is in the Apple Pay section of the dashboard
Are you sure the domains are an exact match? www.example.com does not match example.com, for example.
@mortal pasture Just confirming you saw the message above?
yes i did thanks!
question - would it be an issue that our test site doesnt use live keys, only prod does?
Is there somewhere I can check on that?
There are numerous places it may come into play... can you provide a request ID from your account? It can be any request ID, just something for me to use to view your account and the Apple Pay domains there. Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
I dont have access to the dashboard ๐ฆ
If you don't have access to the Dashboard there's no way to continue debugging this without having access to the site.
Well... do you have access to the API?
I'm told we may be usng connects for client billing
but on the ui we use elements
for sure we use elements on the web/ui side
Connect is Stripe's ability to link Stripe accounts together and move money from one to the other. It's not a UI element like Elements or anything like that, it's a broad foundation/concept you build on.
When someone pays with Apple Pay where does the money go? Does it land in your Stripe account or does it land in a connected account?
oof. I do not know that. I'm just one of the many devs..
what would I need to do differently if we do use Connects?
It depends on the funds flow, the type of connected account, etc.
It might be the case that you need to add the Apple Pay domain via the API to the connected account using your platform's API key and the connected account's ID.
If might be the case that you need to add the Apple Pay domain directly to your platform account.
Without knowing the type of connected accounts you're using and the funds flows involved (like direct vs. destination charges) it's impossible for me to tell you what to do, I'm afraid.
Is there any way you can loop in someone with more context?
Yea I'm reaching out to a colleague .. he's been w/ the company longer so he may know some of this
it lands in a connected account (e.g the biz gets paid not us)
looks like we have over 1000 connected accounts
Are they Standard accounts using direct charges?
we dont know the answer to that... they are accounts signed up w/ Stripe.. ?
All Stripe accounts are accounts signed up with Stripe. ๐
lol
Okay... let's see... are you specifying a connected account ID when initializing Stripe.js?
Yes, they have a stripe key/business key we use
from my colleague - looks like Standard if I'm looking at the right things
Okay, in that case you need to use your platform's secret API key + each connected account's ID to add the Apple Pay domain to each connected account you want to use that domain with.
seriously? woah.
can that be done thru the API call or in the dashboard
It must be done through the API. It's not possible to do this via the Dashboard because Connect is involved.
Happy to help! Let me know how it goes!
Do we need to be setup with payment intents to use this function?
Are you asking whether you need to use Payment Intents to use the Payment Request Button in general?
No, specifically to setup our domain on this step: Use the Payment Request Button with Stripe Connect if we use Charges API functionality, and not the Payment Intents API functionality
No, using Charges or Payment Intents shouldn't matter for the specific stpe of registering your apple pay domain
okay thank you!
Is this.something ok to do on a test site w/ a test account in test mode?
When testing apple pay you need to register the domain in live mode w/ your live keys, so the connected account has to also be connected in live mode
oh no ๐ฉ we do not generally have that capability
Hey, I'm back again!
Hey Rubeus!
Apple Pay domains must be added in live mode. If you can't add them using your live mode key you can't test them.
After checking again, I do think we can test this. I didnt realize we had live test accts we can use