• Resolved barnabas1

    (@barnabas1)


    Hello @mrclayton,

    I have a problem with the Apple pay button as when I click to register my domain, Stripe tries to verify my www domain but there is some conflict as I have a redirect in place for redirecting www to the non-www domain. The file apple-developer-merchantid-domain-assiciation is in the .well-known directory but the redirection causes an error:

    We were unable to verify that you control the domain www.essexmonastery.com. When we tried to request https://www.essexmonastery.com/.well-known/apple-developer-merchantid-domain-association, it redirected to https://essexmonastery.com/.well-known/apple-developer-merchantid-domain-association. The verification file must be served as a 200 at https://www.essexmonastery.com/.well-known/apple-developer-merchantid-domain-association to register www.essexmonastery.com. Did you mean to register essexmonastery.com? For more information, see https://stripe.com/docs/payments/payment-methods/pmd-registration.

    What should I do?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter barnabas1

    (@barnabas1)

    Even though this error displayed, it seems to be working now.. I’m not sure though why. I just hope the payment is captured.

    I tried also to add the www domain in the verified domains from stripe dashboard but I couldn’t verify it because of the same error showing above.

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @barnabas1

    The issue is the url https://essexmonastery.com/.well-known/apple-developer-merchantid-domain-association is not correctly serving the domain association file. The output should be a 200 HTTP response code with a bunch of “101010111000011” combinations.

    You need to make sure your webserver is handling the domain association file correctly. Here is an example of how it should look for NGINX:

    location /.well-known {
            allow all;
            default_type text/plain;
        }

    Kind Regards

    Thread Starter barnabas1

    (@barnabas1)

    Hi @mrclayton,

    Thank you for pointing me to the right direction. I modified the server conf file to serve the .well-known directory both with www and non-www so in Stripe I have both domains added and verified successfully.

    Kind regards,

    Barnabas

    Hello, I have the same issue. How did you resolve it exactly please?

    Thread Starter barnabas1

    (@barnabas1)

    @davidsinko Are you also on nginx redirecting www. to non-www? If yes, this is a sample of how my server config file is:

    # Block for www subdomain - redirect to non-www after allowing the /.well-known location to be accessible
    server {
    listen 443 ssl;
    server_name www.mydomain.com;

    ssl_certificate /fullpath/mydomain.com.crt;
    ssl_certificate_key /fullpath/mydomain.com.key;

    # Serve the Apple Pay verification file for www subdomain before redirecting to non-www domain
    location = /.well-known/apple-developer-merchantid-domain-association {
    root /path-to-wordpress-installation; #optional
    allow all;
    default_type text/plain;
    }

    # Redirect all other requests to the non-www domain
    location / {
    return 301 https://mydomain.com$request_uri;
    }
    }


    #Main block Instructions for non-www domain
    server {
    listen 443 ssl default_server;
    http2 on;
    server_name mydomain.com;

    ssl_certificate /fullpath/mydomain.com.crt;
    ssl_certificate_key /fullpath/mydomain.com.key;
    ....

    #Allow access to the location where the Apple Pay verfication file is located
    location = /.well-known {
    allow all;
    default_type text/plain;
    }
    #here you enter all rest of the instructions for you non-www domain
    }

    I added comments in the configuration above to help you understand what I’ve done. I hope it helps you.

    What you need to make sure afterwards is to make sure that your non-www and www domain is listed here: https://dashboard.stripe.com/settings/payment_method_domains?enabled=true I’m not sure if both versions of the domain need to be there but I did I added both just to be on the safe side.

    I hope it helps.

    @barnabas1 thank you for the answer. I am pretty new with this, but I think it is nginx, it says that the server is openresty.

    Is the server config file which needed to be edited among web server files (public or web etc.)? I am not really sure where to find it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Apple Pay www domain issue’ is closed to new replies.