Obtain Apple Developer certificates
To start offering fast and secure payments with Apple Pay, some configurations are required to validate the identity of the site and the seller, and thus allow transactions while ensuring the security of payment data.
Select the platform type below and follow the instructions according to your integration type.
To be able to use Apple Pay as a payment method, you must register and verify your domain in the Apple Developer Portal. To do so, follow the steps below.
- In the Apple Developer Portal, go to "Certificates > Identifiers & Profiles", add your domain, and save.
- Download the generated
.txtfile. Note that each time you click the download button in the panel, a new file is downloaded and the previous one is invalidated. - Upload this file to your server in a hidden folder called
.well-known. - In the Portal, click the Verify button to verify the file.
- Confirm that when accessing "https://your-domain/.well-known/apple-developer-merchantid-domain-association.txt", the content of the verification file is displayed.
To be able to use Apple Pay as a payment method, you must include the certificate that will be used to prove you are an authorized seller, ensuring that your application is a merchant with authorization to request payments via Apple Pay. To do so, follow the steps below.
- Send a POST with your test Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it in Your integrations > Application details > Test > Test credentials. to the Mercado Pago certificates/csr/generateAPI endpoint to generate the certificate.
curl
curl --location 'https://api.mercadopago.com/certificates/csr/generate' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --data '{ "type": "merchant", "flow": "apple_pay", "merchantIdentifier": [value], "organization": "MyOrg", "country": "BR" }'
| Parameter | Description |
type | Certificate type. For this step, it must be "merchant". Save the certificate_id for the following steps. |
flow | Fixed value apple_pay. |
merchantIdentifier | Unique identifier of your business in Apple Pay. Must match the Merchant ID configured in Apple. |
organization | Your organization name. |
country | Country code, for example BR. |
- The API will return a response with the values
certificate_idandcertificate. Decode thecertificatefield (in Base64 format) and save it in a.pemfile. - In the Apple Developer Portal, go to Certificates, Identifiers & Profiles > Identifiers, select your Merchant ID, and in the Apple Pay Merchant Identity Certificate section, click Create Certificate and upload the generated
.pemfile. - Then, download the signed certificate.
- Finally, send a POST with your test Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it in Your integrations > Application details > Test > Test credentials. to the Mercado Pago certificates/certificate/uploadAPI endpoint to add the signed certificate.
curl
curl --location 'https://api.mercadopago.com/certificates/certificate/upload' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'certificate=@"/User/Downloads/apple_pay.cer"'
| Element | Description |
Authorization | Header with your test Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it in Your integrations > Application details > Test > Test credentials.. |
certificate | Certificate file generated and signed in Apple. |
- Once the process is complete, you will need to perform the domain verification in Apple again.
To be able to use Apple Pay as a payment method, you must include the certificate that will be used to decrypt payment data, securely interpreting the payload used in the payment. To do so, follow the steps below.
- Make a request to the Mercado Pago certificates/csr/generateAPI endpoint to generate the certificate.
curl
curl --location 'https://api.mercadopago.com/certificates/csr/generate' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --data '{ "type": "payment", "flow": "apple_pay", "merchantIdentifier": [value], "organization": "MyOrg", "country": "BR" }'
| Parameter | Description |
type | Certificate type. For this step, it must be "payment". Save the certificate_id for the following steps. |
flow | Fixed value apple_pay. |
merchantIdentifier | Unique identifier of your business in Apple Pay. Must match the Merchant ID configured in Apple. |
organization | Your organization name. |
country | Country code, for example BR. |
- The API will return a response with the values
certificate_idandcertificate. Decode thecertificatefield (in Base64 format) and save it in a.pemfile. - In the Apple Developer Portal, go to Certificates, Identifiers & Profiles > Identifiers, select your Merchant ID, and in the Apple Pay Payment Processing Certificate section, click Create Certificate and upload the generated
.pemfile. - Then, download the signed certificate.
- Finally, send a POST with your test Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it in Your integrations > Application details > Test > Test credentials. to the Mercado Pago certificates/certificate/uploadAPI endpoint to add the signed certificate.
curl
curl --location 'https://api.mercadopago.com/certificates/certificate/upload' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'certificate=@"/User/Downloads/apple_pay.cer"'
| Element | Description |
Authorization | Header with your test Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it in Your integrations > Application details > Test > Test credentials.. |
certificate | Certificate file generated and signed in Apple. |
- Once the process is complete, you will need to perform the domain verification in Apple again.
With this, your development environment is ready to continue with the specific configurations to offer Apple Pay.
