{"title":"Handle Apple Pay errors","category":"default","creationDate":1578911340,"content":"<p>It is possible that sometimes you run into an error when you submit a request or get a response for an Apple Pay payment, or when you are integrating Apple Pay in your website, store, or app. In the following error scenarios, you can read more about what some of the <a href=\"\/pt\/development-resources\/error-codes#apple-pay-error-codes\">Apple Pay error codes<\/a> mean, how to troubleshoot those errors.<\/p>\n<h2>API errors<\/h2>\n<p>In this section we give you some examples of API errors that can occur when you submit a payment request.<\/p>\n<h3>5_001 Apple Pay token amount-mismatch<\/h3>\n<h4>What it means<\/h4>\n<p>The amount that was authorised in Apple Pay is not the same as the amount that was authorised by the Adyen payments platform.<\/p>\n<h4>How to troubleshoot<\/h4>\n<p>Verify the amounts in the transaction. Note that transactions made with Discover cards (test) and American Express cards (test) support only <span translate=\"no\"><strong>USD<\/strong><\/span> as currency.<\/p>\n<h3>5_002 Invalid Apple Pay token<\/h3>\n<h4>What it means<\/h4>\n<p>The Apple Pay token that was sent in the API request does not conform to the specification.<\/p>\n<h4>How to troubleshoot<\/h4>\n<p>Make sure that the Apple Pay token is retrieved, formed, and passed on correctly.<br \/>\nFor example, for a   <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a> request, make sure that you stringify and base64 encode the <code>payment.token.paymentData<\/code> from Apple Pay and submit it in the request as the <code>applePayToken<\/code> value. For examples and more information about custom integrations, see <a href=\"\/pt\/payment-methods\/apple-pay\/api-only#make-payment\">Apple Pay for API only<\/a>.<\/p>\n<h3>5_004 Could not find Merchant Private Key<\/h3>\n<h4>What it means<\/h4>\n<p>The Apple Pay key is correct, but the key that was used to encrypt the data isn't configured for your Adyen API credential.<\/p>\n<h4>How to troubleshoot<\/h4>\n<p>There are several things you can do to troubleshoot this error.<\/p>\n<ul>\n<li>\n<p><strong>Check the payment processing certificate<\/strong><br \/>\nMake sure that:<\/p>\n<ul>\n<li>You are using the same API credential as you did when creating the <a href=\"\/pt\/payment-methods\/apple-pay\/apple-pay-certificate\/web#create-payment-processing-certificate\">payment processing certificate<\/a>.<\/li>\n<li>You have configured your website or app to use the same <a href=\"\/pt\/payment-methods\/apple-pay\/apple-pay-certificate\/web#create-merchant-identifiers\">merchant identifier<\/a> as the one that was used to create the payment processing certificate.<\/li>\n<li>You have activated the latest payment processing certificate in the Apple Developer Portal after you received a confirmation that Adyen added the certificate to your API credential.<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Check the merchant identifier<\/strong><br \/>\nMake sure that:<\/p>\n<ul>\n<li>You have updated the test merchant identifier to the live merchant identifier when you moved your website or app to production.<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Check the card<\/strong><br \/>\nMake sure that:<\/p>\n<ul>\n<li>The payment isn't made with a test card in a live environment. You can only use production cards in your live environment.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>An error occurred. CSR algorithm\/size incorrect. Expected: RSA(2048)<\/h2>\n<h3>What it means<\/h3>\n<p>You see this error in the Apple Developer Portal when you are creating the merchant identity to enable Apple Pay on the web. You're most likely using an incorrect Certificate Signing Request (CSR) file.<\/p>\n<h3>How to troubleshoot<\/h3>\n<p>Make sure that you are not using the CSR file that you received from Adyen to generate the merchant identity certificate. To enable Apple Pay on the web, generate a CSR file following the steps to <a href=\"\/pt\/payment-methods\/apple-pay\/apple-pay-certificate\/web#create-merchant-identity-certificate\">create a merchant identity certificate<\/a>.<\/p>\n<h2>Payment Not Processed<\/h2>\n<h3>What it means<\/h3>\n<p>An Apple Pay payment cannot be processed. The Apple Pay payment sheet on your website displays the error message \"Payment Not Processed\".<\/p>\n<h3>How to troubleshoot<\/h3>\n<p>Make sure that:<\/p>\n<ul>\n<li>You have <a href=\"\/pt\/payment-methods\/apple-pay\/apple-pay-certificate\/web#register-merchant-domain\">validated your domain<\/a>.<\/li>\n<li>You have linked a verified domain to your merchant identity certificate in the Apple Developer Portal.<\/li>\n<li>You have defined your <code>onValidateMerchant<\/code> function correctly and send a valid payload to the <code>validationUrl<\/code>. See <a href=\"https:\/\/developer.apple.com\/documentation\/apple_pay_on_the_web\/apple_pay_js_api\/providing_merchant_validation\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Providing Merchant Validation<\/a> for more information.<\/li>\n<li>You send in the correct <code>initiativeContext<\/code> in the body of the AJAX request to the <code>validationUrl<\/code>. The request and the <code>initiativeContext<\/code> have to be in the same verified domain.<\/li>\n<li>Your server meets the <a href=\"https:\/\/developer.apple.com\/documentation\/apple_pay_on_the_web\/setting_up_your_server\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">requirements<\/a> set by Apple.<\/li>\n<li>You check and fix any errors that show up in the <a href=\"https:\/\/developer.apple.com\/safari\/tools\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Safari Web Inspector<\/a>.<\/li>\n<\/ul>\n<h2>Can't process Apple Pay payments using Adobe Commerce<\/h2>\n<h3>What it means<\/h3>\n<p>There is an issue with processing Apple Pay payments from websites using Adobe Commerce, and errors appear in the logs.<\/p>\n<h3>How to troubleshoot<\/h3>\n<p>Check the <span translate=\"no\"><strong>adyen_exception.log<\/strong><\/span> for the error messages <code>Error Apple, API HTTP Status is:<\/code> and <code>Network error<\/code>. If you find any, make sure that:<\/p>\n<ul>\n<li>The path to the location of your PEM file is correct.<\/li>\n<li>The merchant identifier, the domain name, and the PEM file are correct.<\/li>\n<li>The network status is healthy.<\/li>\n<\/ul>\n<h2>422 Unauthorized to process transactions on behalf of merchantId<\/h2>\n<h3>What it means<\/h3>\n<p>There is an issue with requesting your merchant session token from the <code>\/applePay\/sessions<\/code> endpoint.<\/p>\n<h3>How to troubleshoot<\/h3>\n<div class=\"notices yellow\">\n<p>Make sure that you are using SDK version <a href=\"\/pt\/online-payments\/release-notes#releaseNote=2020-11-09-web-componentsdrop-in-3.18.0\">3.18.0<\/a> or later and API version 65 or later.<\/p>\n<\/div>\n<p>First, check whether the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> contains a <a href=\"\/pt\/payment-methods\/apple-pay\/api-only#build-your-payment-form-for-apple-pay\"><code>configuration<\/code> object<\/a> with a <code>merchantId<\/code>. The <code>merchantId<\/code> is required for the <code>\/applePay\/sessions<\/code> request.<\/p>\n\n<div id=\"tabx0GR9\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;Drop-in\\\/Components&quot;,&quot;content&quot;:&quot;\\n&lt;p&gt;When using Drop-in or Components, also make sure that you:&lt;\\\/p&gt;\\n&lt;ul&gt;\\n&lt;li&gt;Pass the full  &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/paymentMethods\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;\\\/paymentMethods&lt;\\\/a&gt; response when creating an instance of &lt;code&gt;AdyenCheckout&lt;\\\/code&gt;.&lt;\\\/li&gt;\\n&lt;li&gt;Added in your &lt;a href=\\&quot;https:\\\/\\\/ca-test.adyen.com\\\/\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Customer Area&lt;\\\/a&gt; all the domains you use for your shop website, for example &lt;code&gt;https:\\\/\\\/www.mystore1.com&lt;\\\/code&gt;, or &lt;code&gt;https:\\\/\\\/www.mystore2.com&lt;\\\/code&gt;.&lt;\\\/li&gt;\\n&lt;\\\/ul&gt;\\n&lt;p&gt;Drop-in or Components uses the information above to pass the required values to &lt;code&gt;\\\/applePay\\\/sessions&lt;\\\/code&gt;.&lt;\\\/p&gt;\\n&lt;p&gt;If you still get the 422 error message after that, contact our &lt;a href=\\&quot;https:\\\/\\\/ca-test.adyen.com\\\/ca\\\/ca\\\/contactUs\\\/support.shtml?form=other\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Support Team&lt;\\\/a&gt; and provide the full request that Drop-in or Components sent in the &lt;code&gt;\\\/applePay\\\/sessions&lt;\\\/code&gt; endpoint. You can get the request from your browser&#039;s &lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;Developer Tools&lt;\\\/strong&gt;&lt;\\\/span&gt; &amp;gt; &lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;Network&lt;\\\/strong&gt;&lt;\\\/span&gt; tab. We will then check if the URL is enrolled and if your &lt;code&gt;merchantIdentifier&lt;\\\/code&gt; is correct.&lt;\\\/p&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;drop-incomponents_0_1&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;API only&quot;,&quot;content&quot;:&quot;\\n&lt;p&gt;When using the API-only integration, also make sure that your &lt;code&gt;\\\/applePay\\\/sessions&lt;\\\/code&gt; includes all the &lt;a href=\\&quot;\\\/pt\\\/payment-methods\\\/apple-pay\\\/api-only?tab=adyen-certificate-validation_1\\&quot;&gt;required parameters&lt;\\\/a&gt;.&lt;\\\/p&gt;\\n&lt;p&gt;If you still get the 422 error message after that, contact &lt;a href=\\&quot;https:\\\/\\\/ca-test.adyen.com\\\/ca\\\/ca\\\/contactUs\\\/support.shtml?form=other\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot; class=\\&quot;external-link no-image\\&quot;&gt;Support Team&lt;\\\/a&gt; and provide the full request you have sent in the &lt;code&gt;\\\/applePay\\\/sessions&lt;\\\/code&gt; endpoint. We will then check if the URL is enrolled and if your &lt;code&gt;merchantIdentifier&lt;\\\/code&gt; is correct.&lt;\\\/p&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;api_only_1_2&quot;,&quot;relation&quot;:&quot;&quot;}]\"\n            :should-update-when-url-changes='false'>\n        <\/tabs>\n    <\/div>\n<\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/apple-pay\/handle-apple-pay-errors","articleFields":{"description":"Troubleshoot common Apple Pay errors.","feedback_component":true,"last_edit_on":"05-07-2023 06:24","filters_component":false},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/apple-pay\/handle-apple-pay-errors","title":"Handle Apple Pay errors","content":"It is possible that sometimes you run into an error when you submit a request or get a response for an Apple Pay payment, or when you are integrating Apple Pay in your website, store, or app. In the following error scenarios, you can read more about what some of the Apple Pay error codes mean, how to troubleshoot those errors.\nAPI errors\nIn this section we give you some examples of API errors that can occur when you submit a payment request.\n5_001 Apple Pay token amount-mismatch\nWhat it means\nThe amount that was authorised in Apple Pay is not the same as the amount that was authorised by the Adyen payments platform.\nHow to troubleshoot\nVerify the amounts in the transaction. Note that transactions made with Discover cards (test) and American Express cards (test) support only USD as currency.\n5_002 Invalid Apple Pay token\nWhat it means\nThe Apple Pay token that was sent in the API request does not conform to the specification.\nHow to troubleshoot\nMake sure that the Apple Pay token is retrieved, formed, and passed on correctly.\nFor example, for a   \/payments request, make sure that you stringify and base64 encode the payment.token.paymentData from Apple Pay and submit it in the request as the applePayToken value. For examples and more information about custom integrations, see Apple Pay for API only.\n5_004 Could not find Merchant Private Key\nWhat it means\nThe Apple Pay key is correct, but the key that was used to encrypt the data isn't configured for your Adyen API credential.\nHow to troubleshoot\nThere are several things you can do to troubleshoot this error.\n\n\nCheck the payment processing certificate\nMake sure that:\n\nYou are using the same API credential as you did when creating the payment processing certificate.\nYou have configured your website or app to use the same merchant identifier as the one that was used to create the payment processing certificate.\nYou have activated the latest payment processing certificate in the Apple Developer Portal after you received a confirmation that Adyen added the certificate to your API credential.\n\n\n\nCheck the merchant identifier\nMake sure that:\n\nYou have updated the test merchant identifier to the live merchant identifier when you moved your website or app to production.\n\n\n\nCheck the card\nMake sure that:\n\nThe payment isn't made with a test card in a live environment. You can only use production cards in your live environment.\n\n\n\nAn error occurred. CSR algorithm\/size incorrect. Expected: RSA(2048)\nWhat it means\nYou see this error in the Apple Developer Portal when you are creating the merchant identity to enable Apple Pay on the web. You're most likely using an incorrect Certificate Signing Request (CSR) file.\nHow to troubleshoot\nMake sure that you are not using the CSR file that you received from Adyen to generate the merchant identity certificate. To enable Apple Pay on the web, generate a CSR file following the steps to create a merchant identity certificate.\nPayment Not Processed\nWhat it means\nAn Apple Pay payment cannot be processed. The Apple Pay payment sheet on your website displays the error message \"Payment Not Processed\".\nHow to troubleshoot\nMake sure that:\n\nYou have validated your domain.\nYou have linked a verified domain to your merchant identity certificate in the Apple Developer Portal.\nYou have defined your onValidateMerchant function correctly and send a valid payload to the validationUrl. See Providing Merchant Validation for more information.\nYou send in the correct initiativeContext in the body of the AJAX request to the validationUrl. The request and the initiativeContext have to be in the same verified domain.\nYour server meets the requirements set by Apple.\nYou check and fix any errors that show up in the Safari Web Inspector.\n\nCan't process Apple Pay payments using Adobe Commerce\nWhat it means\nThere is an issue with processing Apple Pay payments from websites using Adobe Commerce, and errors appear in the logs.\nHow to troubleshoot\nCheck the adyen_exception.log for the error messages Error Apple, API HTTP Status is: and Network error. If you find any, make sure that:\n\nThe path to the location of your PEM file is correct.\nThe merchant identifier, the domain name, and the PEM file are correct.\nThe network status is healthy.\n\n422 Unauthorized to process transactions on behalf of merchantId\nWhat it means\nThere is an issue with requesting your merchant session token from the \/applePay\/sessions endpoint.\nHow to troubleshoot\n\nMake sure that you are using SDK version 3.18.0 or later and API version 65 or later.\n\nFirst, check whether the  \/paymentMethods contains a configuration object with a merchantId. The merchantId is required for the \/applePay\/sessions request.\n\n\n    \n        \n        \n    \n\n","type":"page","locale":"pt","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Apple Pay","lvl3":"Handle Apple Pay errors"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/apple-pay","lvl3":"\/pt\/payment-methods\/apple-pay\/handle-apple-pay-errors"},"levels":4,"category":"Payment method","category_color":"green","tags":["Handle","Apple","errors"]}}
