Situation: I have an ecommerce app that is an online marketplace where sellers can list items. We accept credit card information and pass the information along to a third party payment processor that takes payment and then routes to the seller. I want to add apple pay support for sellers that wish to accept it.
Due to the nature of our relationship with the 3rd party payment processor and sellers, I'm planning to have any seller interested in accepting apple pay register their own apple developer account and create their own apple pay merchant id. However I am struggling to verify an implementation that will work via sandbox.
Two potential approaches I've identified - both of these successfully create a payment token in the sandbox environment:
- Set up a PKPaymentRequest and pass the seller merchant id instead of our own.
paymentRequest.merchantIdentifier
However, I don't think that this will work in production due to the verbiage in the merchanIdentifier docs.
The merchant identifier you provide when you make an Apple Pay payment request. If you request a payment token for another merchant, use their merchant identifier, if available. Otherwise, use your own merchant identifier.
- use the multiTokenContexts field to pass the seller merchantId and amount to be charged by that seller
paymentRequest.multiTokenContexts = [
PKPaymentTokenContext(merchantIdentifier: "merchant.example.seller", externalIdentifier: "merchant.example.seller", merchantName: "Seller", merchantDomain: "seller.example.com", amount: 135.00),
based on the presentation in this WWDC22 video, I think that this will work - but I haven't found a way to verify without sending an actual transaction.
My questions:
- will the multiTokenContexts approach work for this use case?
- is there any way to validate that a payment token has been successfully created in sandbox without purchasing multiple apple developer accounts and sending a real transaction?