Has anyone figured out how to verify a Salesforce domain with Apple Pay?
Basically, Salesforce does provide a way to verify a domain by going to Setup - Domains and clicking Verify. That prompts you to upload the verification file but Salesforce seems to place it under
your.domain/.well-known/apple-developer-domain-association.txt
whereas Apple is looking for it at
your.domain/.well-known/apple-developer-merchantid-domain-association.txt
(note the extra merchantid- in the file name).
The main issue is that Salesforce's multi tenant platform doesn't allow for direct access to the file that's placed in .well-known directory and there doesn't seem to be any way to control the file name. Is there any alternative way to verify domain ownership in this case?
In your Salesforce site create a new static resource of type text/plain. Paste the contents of the verification file provided by Apple into that resource.
Create a controller apex class:
Code Block public class ResourceReaderController { public String getContent() { return new PageReference('/resource/1394899484000/SiteSamples/SiteStyles.css').getContent().toString(); } }
3. Create a visualforce page to output the contents of that static resource:
Code Block <apex:page controller="ResourceReaderController" contentType="text/plain"> <apex:outputText value="{!Content}" escape="false" /> </apex:page>
4. In your Salesforce site's url rewriter class have a rule that maps the path that Apple is looking for (/.well-known/apple-developer-merchantid-domain-association.txt) to your newly created visualforce page