Apple Pay "mass enablement" error when requesting a Payment Session

Viewed 1578

I'm working with a web application that allows our customers to integrate with Apple Pay on the web. The customers setup their own Apple Pay merchant accounts, a third party handles the actual payment processing, but our servers are responsible for web hosting and obtaining the payment sessions.

Sporadically for some customers, we receive a 400 error when obtaining the payment session, with a message of:

Payment Services Exception merchantId={id} unauthorized to process transactions on behalf of merchantId={id} reason="{id} never authorized mass enablement transactions to occur via {id}"

(Here all the {id} values will be the same).

Despite sounding like a configuration issue with the account, this will only affect some otherwise identical requests. (Same domain, merchant identity, etc.) It affects some customers but not most; when it does affect a customer, somewhere between 10% to 50% of the session requests will fail in this manner. We have several customers never hitting this error even after processing thousands of transactions.

The phrase "mass enablement" doesn't seem to show up in apple's documentation, and the exact phrase "never authorized mass enablement transactions to occur" produces no results at all when searching the web. The closest I can find is this thread on Apple's developer forums but its not an exact match, and has no answers in any case.

Has anyone seen this error and resolved it?

(I'm also pursuing this matter via Apple support; if that eventually proves fruitful I'll update with an answer.)

3 Answers

This happens when a domain has been registered to a merchant using Apple Pay's Mass Enablement API.

The domain (not the merchant ID) will need to be deregistered by whoever claimed the URL before you are able to proceed, although I would expect Apple Pay's support team would also be in a position to remove the registration for you.

https://developer.apple.com/documentation/applepaywebmerchantregistrationapi

I got this error when using my localhost (not registered for Apple Pay) as the front end of the website making a session token request via the back end whose domain had been registered for Apple Pay.

There are few things that needs to be considered here:

  1. Are you using the correct TLS config (the cert and the key) to make the request ?
  2. Are you using the correct merchant validation file send to you while approving mass enablement for the merchant ?

Once you confirm on these 2 things, there's a hole in the documentation provided by apple. After hitting https://apple-pay-gateway.apple.com/paymentservices/registerMerchant with above proper config and data this requires a param called partnerInternalMerchantIdentifier this is a unique merchant id that you can use on your end. register merchant

By default, to get a payment session (https://apple-pay-gateway.apple.com/paymentservices/paymentSession) we might send the primary merchant id that we use for merchant registration in above API which is fair as per their docs. docs

But to make it work we need to send the partnerInternalMerchantIdentifier which we sent in the above API. This acts as a sudo merchant id to get payment sessions. Get payment session for newly registered domain

Related