Apple Pay - Native

Overview

If you have built your checkout page inside a native iOS app, you will need to create your own Apple Pay certificates and upload them via Everypay API.

• Step 1: Generate a CSR

Use everypay's endpoint to generate a Certificate Signing Request (CSR) that you will use to create your Apple Pay certificate on Apple Developer Portal.

curl -L 'https://sandbox-api.everypay.gr/applepay/generate-csr' -u sk_xxxxxxxxxxxxxxxxxxxxx: -H 'Content-Type: application/json' -d '{"merchantId":"merchant.gr.acme_company.staging","organizationName":"Acme corporation","countryCode":"GR"}'

• Step 2: Get the signed certificate from Apple Developer Portal

• Step 3: Upload the signed certificate

curl -L 'https://sandbox-api.everypay.gr/applepay/upload-certificate' -u sk_xxxxxxxxxxxxxxxxxxxxx: -F 'certificate=@"/home/user/Downloads/applepay_certificate.cer"' -F 'merchantId="merchant.gr.acme_company.staging"'

• Step 4: Fetch an encrypted card payment data

Fetch an encrypted card payment data token from Apple Pay (using your app checkout page). Check iOS development documentation for more information on how to implement Apple Pay in your app.

• Step 5: Create an Everypay card token

Use the above encrypted card payment data token to create an Everypay card token. This token will be used to charge the card.

curl -L 'https://sandbox-api.everypay.gr/payment-methods' -H 'Content-Type: application/x-www-form-urlencoded' -u sk_KZLxurUnslyUBhcbL5panhgOImQy9FzH: -d 'token=eyJzaWduYXR1....nNSSUFZTGRPT' -d 'amount=1000' -d 'locale=el' -d 'callback_url=http%3A%2F%2Fcheckout.acme.com' -d 'uuid=689f3451-ad8a-4bd0-8787-34eddec6f4e7' -d 'type=applepay'

• Step 5: Charge the card

Now that you have the token in your backend you can use it to charge the card. To do that use the /payments endpoint in our api:

curl -L 'https://sandbox-api.everypay.gr/payment' -H 'Content-Type: application/x-www-form-urlencoded' -u sk_xxxxxxxxxxxxxxxxxxxxx: -d 'token=ctn_xxxxxxxxxxxxxxxxxxxx' -d 'amount=1000'