Apple Pay is different from traditional credit card processing, which affects the testing process. The "credit card number" is actually an encrypted value generated dynamically on the device.

Our sandbox environment accepts real payment data from the device but ignores the content, populating the payment method nonce with dummy data ("Jane Doe") even when decryption is successful.

In our production environment, the payment data is decrypted with an Apple Pay certificate that is securely stored on our servers. You should expect to see the same device account number (DPAN) in Wallet (formerly Passbook) and in the Braintree Control Panel.

If Apple Pay tokenization fails during development, it is likely caused by a certificate mismatch. You can determine which certificate was used for encryption based on the PKPaymentToken (payment.token.paymentData publicKeyHash field.)

Valid nonces

Nonce Description
fake-valid-nonce A valid nonce that can be used to create a transaction
fake-valid-no-billing-address-nonce A valid nonce containing no billing address information
fake-valid-visa-nonce A nonce representing a valid Visa card request
fake-valid-amex-nonce A nonce representing a valid American Express card request
fake-valid-mastercard-nonce A nonce representing a valid Mastercard request
fake-valid-discover-nonce A nonce representing a valid Discover card request
fake-valid-jcb-nonce A nonce representing a valid JCB card request
fake-valid-maestro-nonce A nonce representing a valid Maestro card request
fake-valid-dinersclub-nonce A nonce representing a valid Diners Club card request
fake-valid-prepaid-nonce A nonce representing a valid prepaid card request
fake-valid-commercial-nonce A nonce representing a valid commercial card request
fake-valid-durbin-regulated-nonce A nonce representing a valid Durbin regulated card request
fake-valid-healthcare-nonce A nonce representing a valid healthcare card request
fake-valid-debit-nonce A nonce representing a valid debit card request
fake-valid-payroll-nonce A nonce representing a valid payroll card request

Valid nonces with card info

Nonce Description
fake-valid-no-indicators-nonce A nonce representing a request for a valid card with no indicators
fake-valid-unknown-indicators-nonce A nonce representing a request for a valid card with unknown indicators
fake-valid-country-of-issuance-usa-nonce A nonce representing a request for a valid card issued in the USA
fake-valid-country-of-issuance-cad-nonce A nonce representing a request for a valid card issued in Canada
fake-valid-issuing-bank-network-only-nonce A nonce representing a request for a valid card with the message 'Network Only' from the issuing bank

Alternate payment method nonces

Nonce Description
fake-android-pay-nonce A nonce representing an Android Pay request
fake-android-pay-visa-nonce A nonce representing an Android Pay Visa request
fake-android-pay-mastercard-nonce A nonce representing an Android Pay Mastercard request
fake-android-pay-amex-nonce A nonce representing an Android Pay American Express request
fake-android-pay-discover-nonce A nonce representing an Android Pay Discover request
fake-apple-pay-amex-nonce A nonce representing an Apple Pay request for an American Express card number
fake-apple-pay-visa-nonce A nonce representing an Apple Pay request for a Visa card number
fake-apple-pay-mastercard-nonce A nonce representing an Apple Pay request for a Mastercard card number
fake-apple-pay-discover-nonce A nonce representing an Apple Pay request for a Discover card number
fake-paypal-one-time-nonce A nonce representing an unvaulted PayPal account that a customer has authorized for one-time payments via the Checkout flow. Learn more about PayPal testing options.
fake-paypal-future-nonce A nonce representing a PayPal account that a customer has authorized for future payments via a deprecated version of the Vault flow; use fake-paypal-billing-agreement-nonce instead.
fake-paypal-billing-agreement-nonce A nonce representing a PayPal billing agreement that a customer has authorized via the Vault flow. Learn more about PayPal testing options.
fake-visa-checkout-amex-nonce A nonce representing an American Express card from Visa Checkout
fake-visa-checkout-discover-nonce A nonce representing a Discover card from Visa Checkout
fake-visa-checkout-mastercard-nonce A nonce representing a Mastercard card from Visa Checkout
fake-visa-checkout-visa-nonce A nonce representing a Visa card from Visa Checkout
fake-masterpass-amex-nonce A nonce representing an American Express card from Masterpass
fake-masterpass-discover-nonce A nonce representing a Discover card from Masterpass
fake-masterpass-mastercard-nonce A nonce representing a Mastercard card from Masterpass
fake-masterpass-visa-nonce A nonce representing a Visa card from Masterpass
fake-venmo-account-nonce A nonce representing a Venmo Account

Invalid nonces

The following payment method nonces represent credit cards that simulate an unsuccessful card verification response.

note

Verifying a payment method is different than creating a transaction. To trigger an unsuccessful transaction, adjust the amount of the transaction.

Processor rejected nonces

Nonce Description
fake-processor-declined-visa-nonce A nonce representing a request for a Visa card that was declined by the processor
fake-processor-declined-mastercard-nonce A nonce representing a request for a Mastercard that was declined by the processor
fake-processor-declined-amex-nonce A nonce representing a request for a American Express card that was declined by the processor
fake-processor-declined-discover-nonce A nonce representing a request for a Discover card that was declined by the processor
fake-processor-declined-dinersclub-nonce A nonce representing a request for a Diners Club card that was declined by the processor
fake-processor-failure-jcb-nonce A nonce representing a request for a JCB card that was declined by the processor

Gateway rejected nonces

Nonce Description
fake-luhn-invalid-nonce A nonce representing a Luhn-invalid card
fake-consumed-nonce A nonce that has already been consumed
fake-gateway-rejected-fraud-nonce A nonce representing a card that will be gateway rejected due to fraud (only if you have any fraud rules enabled in sandbox)

When writing integrations tests against the Braintree sandbox environment, you may also use these nonce objects in place of the nonce that would normally be returned from the client side integration.

Ruby
Click to copy
Copied
Braintree::Test::Nonce::Transactable
Braintree::Test::Nonce::Consumed
Braintree::Test::Nonce::PayPalOneTimePayment
Braintree::Test::Nonce::PayPalFuturePayment

Go live

  • Switch over to your Production Apple Pay Merchant ID (paymentRequest.merchantIdentifier).
  • Run a few real transactions to ensure that you are able to process Apple Pay for all supported card types.
  • Apple Pay requires coordination from acquiring banks, issuing banks and card networks. Please email us if your live transactions are declined.

As always, contact our Support team if you have any questions or concerns!

Still have questions?

If you can’t find an answer, contact our Support team.