Apple Pay
Server-Side Implementation
Note
Creating transactions
Like all Braintree SDK integrations, you will receive a payment method nonce when your user
successfully authorizes payment. Pass this nonce to your server, and create a transaction.Collect device data
from the client and include the DeviceDataFromTheClient in the
transaction.
- C#
var request = new TransactionRequest {
Amount = 10.00M,
PaymentMethodNonce = nonceFromTheClient,
DeviceData = deviceDataFromTheClient,
Options = new TransactionOptionsRequest {
SubmitForSettlement = true
},
BillingAddress = new AddressRequest {
PostalCode = postalCodeFromTheClient
},
};
Result<transaction> result = gateway.Transaction.Sale(request);
Note
For certain account setups, it is recommended that merchants collect and pass billing address
information when storing payment methods and/or creating transactions. Passing billing address
details (postal code at minimum) can help increase the likelihood of a successful authorization.
To learn more about your specific account setup,
contact us.
Vaulting Apple Pay
Apple Pay cards can only be
saved to your Vault for specific use
cases;
see the support article for details. If your use case is supported, you can store a customer's Apple Pay card in your Vault in a few
different ways:- In a separate Payment Method: Create request
- In a separate Customer: Create or Customer: Update request
- In your Transaction: Sale request by using Options.StoreInVault or Options.StoreInVaultOnSuccess