Configuring Apple Pay
Learn how to configure Apple Pay for DigitalRiver.js with Elements.
Last updated
Was this helpful?
Learn how to configure Apple Pay for DigitalRiver.js with Elements.
Last updated
Was this helpful?
If you're using, you can create an payment method for your app or website in three easy steps:
For details on validating your domain with Apple, refer to on the page.
the apple-developer-merchantid-domain-association
file.
Save the file to the following location on the domain where you want to offer Apple Pay: /.well-known/apple-developer-merchantid-domain-association
Repeat this step for each additional domain where you want to offer Apple Pay. For example: https://buy.mydomain.com/.well-known/apple-developer-merchantid-domain-association https://shop.mydomain.com/.well-known/apple-developer-merchantid-domain-association https://www.mydomain.com/.well-known/apple-developer-merchantid-domain-association
Note: You must serve the apple-developer-merchantid-domain-association
file over HTTPS.
Contact your Digital River representative with the list of domains you want to register.
To create an Apple Pay payment source, please follow the .
After setting up your library per the , create an Apple Pay element with any customizations you would like to apply.
The Apple Pay element will surface events, giving you more information to facilitate what is happening within the Apple Pay experience.
These events include:
The created element is loaded and ready to accept an update request.
A shopper clicked the element's button.
The customer has canceled the experience.
The customer has chosen a different shipping option than was previously selected. You should use this data to re-price your order totals (if applicable).
The customer has chosen a different address than was previously selected. You should use this data to re-price your order totals (if applicable).
The customer has authorized the payment and a source, and DigitalRiver.js returned associated data.
The source event will surface a Source plus other shopper details Apple Pay provides, like the billing address, shipping address, and contact information.
The Shipping Address Changed and Shipping Method Changed events require a response of updated details to present to the Shopper. This system expects the response to be in the format of a .
The following example shows how to place the elements on the page. For more information on placing elements on a page, see the .
The address
object must contain postal code and state/province data that using the state
attribute. Note that the state
attribute listed below corresponds to the countrySubdivision
attribute used when providing address information. The payment session manages the correct field name on the backend.
Once authorized, you can use the source by .
The following example shows placing an Apple Pay element on your page. Use this in conjunction with the to build your solution.HTML
See for testing instructions.