#Badr-Apple Pay

1 messages ยท Page 1 of 1 (latest)

desert bridge
#

๐Ÿ‘‹ happy to help

#

I just need a few minutes to catch up on the thread

worthy lotus
#

thanks @desert bridge ๐Ÿ™

#

I think I got that working now ๐Ÿ˜‚

#

we manually added the domain from the dashboard and it worked

#

on documentation it said , we should only use the api call when it's connector accounts

desert bridge
#

oh so the domain wasn't verified?

worthy lotus
#

it was verified

#

but on the connected account

#

not on the main account

#

for some reason it's not verified for dev url there but it's working

#

check the main account on this

#

I can't see this domain from the main account dahsboard

desert bridge
#

are you using Apple Pay Sandbox on dev?

#

that might be the reason

#

why it's working

worthy lotus
#

it's 100% same as the dev but not working

desert bridge
#

it is working

worthy lotus
#

so we have
dev - test - production
only production is the live
dev and test are liveMode false

desert bridge
#

I see the Apple pay donate button

#

it's working like a charm

worthy lotus
#

it's working where ?

lean arch
#

taking over

#

that page indeed does not work

#

there's a specific reason for that(it's to do with stripe.js needing to know the account ID so it can find the correct registration when calling Apple's function). But that's what you need to do.

#

I don't know why it works on the other page, since it's the same key, but it's probably just something that happened from doing so much testing on this one account and domain, I believe it's most likely that the registration status on Stripe and the registration status on Apple have drifted out of sync , since that can happen

#

your production page works fine so ultimately while not ideal, I think you're ok

worthy lotus
#

@lean arch that production page wasn't working at all 1 hour ago , I just went to dashboard and manually added the domain there in the main account and it worked

lean arch
#

yep, which technically is not what you're supposed to do, but I can see why it works

#

sorry, it's a mess and it's really hard for me to explain without spending a long time explaining exactly how this works internally

#

basically if you register the domain for a connected account using the API(like https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=html#html-js-using-with-connect says to do) , when we register the domain with Apple we register with an identifier like merchant.dev-payzone.easypaymentsplus.com.acct_1F2EnuIzQrXzOQ2M.stripe
when an account itself registers the domain through the dashboard, it registers with Apple with an identifier like merchant.dev-payzone.easypaymentsplus.com.stripe (no account ID)

#

then when you call canMakePayments in stripe.js, we look up Apple's registry by passing an identifier and asking them if it exists

#

if you don't pass the account ID to stripe.js at that point(which you don't since you are using the deprecated OAuth-public-key only approach) , stripe.js can't know the account ID to be able to create a request to Apple to look for the first identifier, so it looks for merchant.dev-payzone.easypaymentsplus.com.stripe instead

#

which doesn't exist (or didn't until you manually added it to that account's dashboard) which is why canMakePayments returns false

#

I don't really expect anyone to understand this since it's all internal details of our systems and integration with Apple, but the simple answer is you have to do exactly what the docs describe when using Connect + Apple Pay, any deviation in any way and it just immediately stops working

#

I have to run for lunch, will be back a little later!

worthy lotus
#

thanks a lot @lean arch , it's clear now ๐Ÿ’ช

#

we are moving soon to the new way you suggested (already implemented but need two weeks to go in) so until that day we should be safe (I hope ๐Ÿ˜…)