Verify domain for Apple Pay

Anders Bøg Holm 25 Reputation points
2024-02-07T13:40:24.0333333+00:00

Hi,

I need to create a folder in the wwwroot for a web app for verifying Apple Pay. Here is the guide to do it: https://stripe.com/docs/payments/payment-methods/pmd-registration Im able to create the folder and upload the file /.well-known/apple-developer-merchantid-domain-association But I get a code 404 when trying to do the validation. How do I fix this issue? /Anders

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,408 questions
0 comments No comments
{count} votes

Accepted answer
  1. ajkuma 24,971 Reputation points Microsoft Employee
    2024-02-09T04:31:54.4833333+00:00

    Solution shared by David.Warwick on SO:  To manually move the .well-known folder and file to a new directory named StaticFiles outside of wwwroot. Created a controller named WellKnown to serve the file, specifying the appropriate route and endpoint.

     
    +The StaticFiles folder, as suggested by David, should be relocated to the wwwroot directory. Additionally, review API integration and annotations for correctness.

    @Anders Bøg Holm , Glad to see that your issue is resolved and thanks for confirming the solution that worked. Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer. They can only accept answers by others, I' have summarized and posted the solution, request you to Accept the answer, it will benefit the community find the answers quickly.

    Additional things to try:

    -configure routing/hosting on what happens when /apple-developer-merchantid-domain-association url is invoked.
    -provide right content-type to return the file content.

    If backend is hosted on EJS, update as below, it would differ based on the backend technology/framework you are using (please try similar approach)

    app.get('/apple-developer-merchantid-domain-association', (req, res) => {
        res.setHeader('Content-Type', 'text/plain');
        res.sendFile(path.resolve(__dirname, '.wellknown/apple-developer-merchantid-domain-association'));
    });
    
    
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. ajkuma 24,971 Reputation points Microsoft Employee
    2024-02-08T19:14:34.5766667+00:00

    @Anders Bøg Holm , To better assist you on this, just to clarify, have you provisioned the site on App Service WebApp or on an Azure VM?

    What happens when you invoke the url (https://<domainname>/apple-developer-merchantid-domain-association)? Are you able to see the content of the file? does it work test/fine locally?

    Based on my understanding of your issue, if you haven't checked already, to isolate, please validate these:

    -configure routing/hosting on what happens when /apple-developer-merchantid-domain-association url is invoked.
    -provide right content-type to return the file content.

    If backend is hosted on EJS, update as below, it would differ based on the backend technology/framework you are using (please try similar approach)

    app.get('/apple-developer-merchantid-domain-association', (req, res) => {
        res.setHeader('Content-Type', 'text/plain');
        res.sendFile(path.resolve(__dirname, '.wellknown/apple-developer-merchantid-domain-association'));
    });
    
    
    1 person found this answer helpful.

  2. Anders Bøg Holm 25 Reputation points
    2024-02-08T22:21:21.5+00:00

    I found the answer and solution in David Warwick's solution. Thanks :) It was a nightmare until now! I'm grateful and happy. Thanks.