Apple Pay routing issue

So I’m trying to add Apple Pay to my stripe member ship on my ghost blog at https://uklad.vc

Stripe gave me .dms file so that I must put it at:

You’ll need to host the verification file you downloaded above at your domain in the following location:

https://example.com/.well-known/apple-developer-merchantid-domain-association

I added example yoyo.txt file at the root of my theme folder and it works:

https://uklad.vc/yoyo.txt

But Apple Pay requires me to put the file into uklad.vc/.well-known

I created “.well-known” directory in the root of my theme folder but it doesn’t work.
Also I tried make routing in routes.yaml such as

routes:
  /signup/: members/signup
  /signin/: members/signin
  /account/: members/account
  /.well-known: apple

and put the file into “apple” folder inside the theme folder. It also doesn’t work.
I couldn’t find any topic in this forum regarding Apple Pay integration issue.
Please advise

Hey @aabulkhairov!

How are you uploading your theme to Ghost? Just adding it as a directory in your theme file should work.

Something like:

<theme root>/.well-known/apple-developer-merchantid-domain-association

Hey @jloh! Thanks for quick reply.

I just did exactly that and it didn’t work.
For example I also added “Almas.txt” file there and it doesn’t work by calling https://uklad.vc/.well-known/almas.txt

Are you uploading your theme to Ghost or editing it manually on the server? If you’re editing it, you’ll likely need to restart Ghost for it to pickup the new directory.

If you’re uploading it via the zip, can you confirm that the hidden dot directory is in the zip file? You can easily view whats in a file by vim’ing it and it gives you a directory listing.

1 Like

@jloh I double checked and restarted Ghost with “ghost restart” command just in case, but anyways I uploaded the theme as a zip file.

@jloh, interesting thing.
I’ve just added another directory “well-known” without the dots in the theme root. And copied same files as in “.well-known” directory.

https://uklad.vc/well-known/almas.txt works!!!

So the problem is with “.” in the beginning of directory name. Maybe some kind of permission issue?

I’ve also just did

chmod +rwx .well-known

but still no change

ghost-mgr@uklad:/var/www/ghost$ ls -ld .well-known/
drwxrwxr-x 2 ghost-mgr ghost-mgr 4096 Jan 22 00:38 .well-known/

Hey @aabulkhairov, I have a feeling the hidden directory isn’t being included in your theme zip.

Just to confirm, the .well-known directory should be in your theme root, not the Ghost root. So /var/www/ghost/content/themes/<active theme>/.well-known

You can read about including hidden directories in zip files here or move that directories to the one I mentioned above.

@aabulkhairov, just saw your uploaded image. Looking at your website (https://uklad.vc/.well-known/almas.txt) this is being served by Nginx directly and not going to Ghost.

Are you able to paste your Nginx config? If its just you editing some things, I’d try renaming the .dms file to not include the file extension.

That’s true with the default CLI NGINX config :smile:

The root is {install}/system/nginx-root

1 Like

Sorry to interrupt but you don’t actually need this at all. The guide you’re following is for people who are trying to add an Apple Pay button to their domain. Ghost Memberships works with Stripe’s hosted checkout pages, where Apple Pay is already automatically included.

If you click on a plan here: Rediverge in Safari - you’ll see the Apple Pay button loads in after a couple of seconds, for example. If you do it in Chrome, the Google Pay button will load in - it’s all managed by Stripe, no .well-known files or verification needed.

2 Likes

Wow, @John, nice to meet you! Great job pulling this all with the team, I looked at ghost since you announced it.

Well, when people try to subscribe, there’s no Apple Pay, not Google pay option on my blog stripe subscription page for some reason.
So I thought I need to go through additional config.

P.S. clicked on your link. it indeed has Apple Pay option.
But I don’t have it :frowning:

Then you would need to contact Stripe :slight_smile: my guess would be that Apple Pay support might not yet available in the country of your Stripe account.

1 Like

Will try, thanks!
BTW, my Stripe account is a US company.

Nice. Should definitely be available then!

1 Like

Again this procedure is needed only to handle a special Stripe checkout with Apple Pay. It’s not needed for the Ghost membership feature as described above.

Anyways, to make it works with Stripe:
I have created a .well-known folder into the /var/www/[mydomain]/system/nginx-root/ and put the apple-developer… file there.

By visiting the url https://[mydomain]/.well-known/apple-developer… the file is automatically downloaded.

Then Stripe can validate the domain.

I have tried before to upload Lyra theme including the .well-known folder as mentioned above but without success.

Hope it helps.

1 Like