Apple Pay—Troubleshooting & Error Codes

This section provides a comprehensive guide to common issues and error codes encountered during Apple Pay integration (Server-to-Server). For unlisted issues, please contact EdfaPay Integration Support.

Common Troubleshooting Scenarios

The table below outlines frequent integration challenges, their potential causes, and actionable solutions.

Issue

Possible Cause

Solution

Apple Pay button not visible

  • Apple Pay JS API not loaded
  • Merchant domain not verified with Apple
  • Device/browser not supporting Apple Pay
  1. Verify Apple Pay support on the test device (Safari, iOS/macOS).
  2. Ensure domain verification with Apple is complete.
  3. Confirm correct loading of the Apple Pay JS script.

Payment not completed error

  • Payment token not generated
  • Apple Merchant ID mismatch
  • Frontend not sending correct token
  1. Ensure merchantIdentifier accurately matches your Apple Merchant ID.
  2. Thoroughly debug the onpaymentauthorized event.
  3. Log and verify the token object before transmitting it to the backend.

Hash Mismatch / Invalid Hash

  • Incorrect parameters used in hash generation
  • Incorrect parameter order
  • Password/key mismatch
  1. Adhere strictly to the hash generation formula.
  2. Verify no extra spaces or encoding issues are present.
  3. Use the same password and identifier configured in EdfaPay.

400 Bad Request API status

  • Missing required parameters
  • Incorrect parameter name or format
  1. Cross-reference the request body against the official documentation.
  2. Ensure the JSON object is valid and properly escaped.

500 Internal Server Error API status

  • Invalid Apple Pay payment token structure
  • Gateway processing error
  1. Verify that parameters contains a valid Apple Pay token object.
  2. Contact EdfaPay support with the complete request/response log.

Apple Pay Error Codes

This table lists common Apple Pay error codes, their meanings, and recommended actions.

Error CodeMeaningSuggested Action
ERR_INVALID_HASHGenerated hash does not match server calculationRecheck hash generation logic and parameter order.
ERR_INVALID_IDENTIFIERApple Merchant Identifier is invalid or unregisteredUse the correct Apple Merchant ID configured in your Apple Developer account.
ERR_PAYMENT_TOKEN_INVALIDApple Pay token is malformed or expiredEnsure the token is freshly captured from the frontend and passed as a JSON string.
ERR_UNSUPPORTED_CURRENCYCurrency is not supported for Apple PayUse a supported currency (e.g., SAR).
ERR_TRANSACTION_DECLINEDIssuer declined the transactionSuggest the customer try another card or payment method.
ERR_PARAMETER_MISSINGA required parameter is missing from the requestReview the request body and include all necessary fields.
ERR_APPLE_PAY_NOT_ENABLEDApple Pay is not activated for this merchantContact EdfaPay to enable Apple Pay on your account.
💡

Important Notes:

  • Always log the error code and message for support reference.
  • A "pending" status does not guarantee success; confirm via the Status API.
  • Token-related errors (e.g., 200.300.xxx) often indicate an expired Apple Pay session.