#tiffany-applepay

1 messages ยท Page 1 of 1 (latest)

tulip meteor
#

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

mortal pasture
#

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

modern skiff
#

Hello! Can you give us a link to the page with the issue so we can investigate on our end?

mortal pasture
#

it is unfortunately behind a VPN

#

can i share some code or run some recommended tests? console logs? network results?

modern skiff
mortal pasture
#

Yes I do

#

on Safari I see Apple Pay on Chrome I see a Pay Now button

modern skiff
#

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?

mortal pasture
#

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

modern skiff
#

What about in Chrome with Google Pay?

mortal pasture
modern skiff
mortal pasture
#

No I see a Pay Now button

modern skiff
#

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?

mortal pasture
#

what is connect

#

ok I'm using a real card in google pay

#

do I need to use a test card

modern skiff
mortal pasture
#

Is Elements the same thing

modern skiff
#

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?

mortal pasture
#

Lets get Google pay working I guess. Seems the simplest

#

so I do have a live card in my payment method

modern skiff
mortal pasture
#

in Chrome

#

ooh ok checking now

#

I do not

#

ok I will add one and be back

#

ok I have one added now

modern skiff
mortal pasture
#

No, I still get the Pay Now button

modern skiff
#

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/

mortal pasture
#

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

modern skiff
#

Hm. Maybe restart Chrome and try again?

mortal pasture
#

ok

#

same

#

I refreshed cache

#

and am still getting the pay now button

modern skiff
#

Hm. What card brand is it? Visa? MasterCard?

mortal pasture
#

Mastercard

modern skiff
#

If you go to chrome://settings/payments do you see your card listed there with "Google Pay" next to it?

mortal pasture
#

yes

#

oh!

#

it wasnt my default card

#

ok it's working now on the site

modern skiff
#

Okay, awesome!

#

That's one down!

mortal pasture
#

whew!

modern skiff
#

Okay, now for Apple Pay...

mortal pasture
#

ok I'm checking on my site now

modern skiff
mortal pasture
#

Yes

modern skiff
#

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?

mortal pasture
#

yes

modern skiff
#

Thanks! Does the publishable key you're using start with pk_test_?

mortal pasture
#

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:

mortal pasture
modern skiff
#

Oh, okay, let's go back to Google Pay then... so it's working on Stripe's site, but not yours?

mortal pasture
#

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

modern skiff
#

Yeah, that's expected. I think you need to modify your code to account for that possibility.

mortal pasture
#

ok

#

I can do that.. do you want to move on or wait

modern skiff
#

Probably best to fix that before continuing.

mortal pasture
#

ok doing so now

#

Will take a few minutes to PR since I cannot use localhost

mortal pasture
#

still working on resolving it..

#

just to keep you posted!

mortal pasture
#

So I managed to get an apple pay button but I do see a 400 code from stripe in my console

wise sleet
#

Can you share more details?

mortal pasture
#

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

wise sleet
#

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

mortal pasture
#

ok yay! So Rubeus helped me get the Google pay working and then we were going to move on to Apple

wise sleet
#

awesome! Rubeus is a wizard ๐Ÿ™‚

mortal pasture
#

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

wise sleet
#

it could be many things. We'll need to see the page live to help you debug

mortal pasture
#

oh shoot. It is behind a VPN

#

can I send screenshots? and debug from my end?

wise sleet
#

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 ๐Ÿ˜ฆ

mortal pasture
#

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

wise sleet
#

Damn okay.

mortal pasture
#

yea lemme try that! I didnt know that existed

wise sleet
#

yeah it's not official but we've found it helpful to debug

mortal pasture
#

yea it says my domain is not setup correctly

#

hmm.

#

do I need to include the https?

wise sleet
#

no

mortal pasture
#

could that be because it is behind a VPN?

wise sleet
#

but it does means something is not registered properly

mortal pasture
#

ok I tried both ways

wise sleet
#

Are you sure the domain is registered in your account settings?

mortal pasture
#

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

wise sleet
#

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

mortal pasture
#

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?

wise sleet
#

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

mortal pasture
#

setupButton() {
this.elements = this.stripe?.elements();
this.paymentRequest?.on('token', ({ token }) => {
this.token = token;
console.log('token ' + this.token);
});

#

^this?

wise sleet
#

yes the token id, the tok_123

mortal pasture
#

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

wise sleet
#

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

mortal pasture
#

ok I can do that too.. I'm waiting on my pipeline to build

#

after moving up the token build

wise sleet
#

sounds good

mortal pasture
#

Yea I wasnt able to get that id

#

I'll hop back on tomorrow

#

Thanks for your help!

wise sleet
#

sure thing!

modern skiff
#

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?

mortal pasture
#

yes i did thanks!

#

question - would it be an issue that our test site doesnt use live keys, only prod does?

modern skiff
#

No, they keys wouldn't matter.

#

You're certain Connect is not involved at all?

mortal pasture
#

Is there somewhere I can check on that?

modern skiff
mortal pasture
#

I dont have access to the dashboard ๐Ÿ˜ฆ

modern skiff
#

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?

mortal pasture
#

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

modern skiff
#

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?

mortal pasture
#

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?

modern skiff
#

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?

mortal pasture
#

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

modern skiff
#

Are they Standard accounts using direct charges?

mortal pasture
#

we dont know the answer to that... they are accounts signed up w/ Stripe.. ?

modern skiff
#

All Stripe accounts are accounts signed up with Stripe. ๐Ÿ™‚

mortal pasture
#

lol

modern skiff
#

Okay... let's see... are you specifying a connected account ID when initializing Stripe.js?

mortal pasture
#

Yes, they have a stripe key/business key we use

#

from my colleague - looks like Standard if I'm looking at the right things

modern skiff
#

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.

mortal pasture
#

seriously? woah.

mortal pasture
#

can that be done thru the API call or in the dashboard

modern skiff
#

It must be done through the API. It's not possible to do this via the Dashboard because Connect is involved.

mortal pasture
#

ok

#

were going to test this with one of our accounts first. Thank you!

modern skiff
#

Happy to help! Let me know how it goes!

mortal pasture
#

Do we need to be setup with payment intents to use this function?

broken cedar
#

Are you asking whether you need to use Payment Intents to use the Payment Request Button in general?

mortal pasture
#

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

broken cedar
#

No, using Charges or Payment Intents shouldn't matter for the specific stpe of registering your apple pay domain

mortal pasture
#

okay thank you!

mortal pasture
#

Is this.something ok to do on a test site w/ a test account in test mode?

broken cedar
#

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

mortal pasture
#

oh no ๐Ÿ˜ฉ we do not generally have that capability

modern skiff
#

Hey, I'm back again!

mortal pasture
#

Hey Rubeus!

modern skiff
#

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.

mortal pasture
#

After checking again, I do think we can test this. I didnt realize we had live test accts we can use

mortal pasture
#

Thanks for your help again! We are going to implement into our API and give it a go. It'll prob be a few days but I wanted to say thank you for your help!