Add Apple Pay and Google Pay to your checkout

Apple Pay and Google Pay transactions are credit card transactions in which card information is tokenised and encrypted by Apple or Google Payment Tokens.

Apple Pay

Before you begin:

  1. To prepare to accept Apple Pay as a payment method, create an Apple Developer account.

When your Apple Developer account is live, do these steps.

  1. Get a Certificate Signing Request (CSR) file from CardCorp. Tell your Account Manager that you want to accept Apple Pay as a payment option during checkout and ask CardCorp to generate 2 CSR files for you.
    Use the CSR files supplied by CardCorp to generate certificates under your Merchant ID and Domain.

  2. Create a Merchant ID. In the Apple Developer App go to Certificates, Identifiers & Profiles and create a Merchant ID.

  3. Generate an Apple Pay Payment Processing Certificate.
    Select the Merchant ID you created, and choose Create Certificate.

    Upload the CSR File "Payment Processing".

    Download the Certificate and provide it to CardCorp.

  4. Add Domain in your Apple Developer App.
    In the Merchant ID section, look for the Apple Pay on the Web section.
    Click Add Domain and follow the steps required by Apple.

  5. Generate Apple Pay Merchant Identity Certificate.
    In the Apple Pay on the Web section, go to the Merchant Identity Certificates and click Create Certificate.

    Upload the CSR file for "Merchant Identity".

    Download the Certificate and send it to CardCorp.

  6. Add Apple Pay as your Payment Brand in your Integration Script

    1. For COPY and PAY Integration, create the checkout as usual.

      1. To create the payment form, add the following lines of HTML/JavaScript to your page and populate the following variables.

        • The checkoutId that you received in your response in Step 1.
        <script src="https://eu-test.oppwa.com/v1/paymentWidgets.js?checkoutId={checkoutId}"></script>
        
        • The shopperResultUrl, a page on your site where the customer should be redirected after the payment is processed, and the card brands will be available.
        <form action="{shopperResultUrl}" class="paymentWidgets" data-brands="APPLEPAY VISA MASTER"></form>
    2. For Server-to-Server Integration, there are 2 APIs for Apple Pay.

      1. Apple Pay with an encrypted payment token

        You can send the encrypted payment token as is. The gateway will decrypt it and process the transaction.

        Send the following parameters together with other parameters in a SERVER-TO-SERVER request.

        paymentBrand=APPLEPAY
        applePay.paymentToken={ ... }

        For the value of applePay.paymentToken use the JSON (payment token) received from Apple.

        Note that the payment token expires after two minutes. Be sure to submit the payment token immediately after it is generated. Transactions with expired payment tokens are rejected to prevent a replay attack.

      2. Apple Pay with decrypted card information

        You can do the decryption yourself and send the decrypted card information with the usual card API: card.number, card.expiryMonth, card.expiryYear, threeDSecure.verificationId, threeDSecure.eci, and applePay.source (Possible values: web or app).

        For example:

        paymentBrand=APPLEPAY
        card.number=4200000000000000
        card.expiryMonth=05
        card.expiryYear=2022
        threeDSecure.verificationId=ABiKYvXjhcB7AAc+K04XAoABFA==
        threeDSecure.eci=07
        applePay.source=app

        NOTE: Be sure to renew the certificate before it expires. Simply create a new certificate by following the same steps above.


Google Pay

Google Pay allows customers to make secure payments with any stored credit or debit card in their Google App.

  1. Get the gatewayMerchantID from CardCorp.
    Tell your Account Manager that you want to activate Google Pay and acquire your gatewayMerchantID
  2. Add Google Pay as your Payment Brand in your Integration Script. This will depend on what integration option you use.
    1. For COPY AND PAY.
      Configure the Google Pay object in the wpwlOptions in generating the Payment Form.
      var wpwlOptions = {
          googlePay: {
              gatewayMerchantId: ""
              merchantId: ""
          }
      }
    2. For Server-to-Server, there are two APIs for Google Pay:
      1. Google Pay with the encrypted payment token.
        You can send the encrypted payment token as is. Our gateway will handle the decryption and process the transaction.
        Send the following parameters together with other parameters in a server-to-server call:
        paymentBrand=GOOGLEPAY
        googlePay.paymentToken={ ... }
        Replace googlePay.paymentToken with the JSON (payment token) received from the Google Pay API.
      2. Google Pay with decrypted card information.
        You can do the decryption yourself and send the decrypted card information with the usual card API: card.number, card.expiryMonth, card.expiryYear, threeDSecure.verificationId, threeDSecure.eci, and googlePay.source (Possible values: web or app).
        For example
        paymentBrand=GOOGLEPAY
        card.number=4200000000000000
        card.expiryMonth=05
        card.expiryYear=2022
        threeDSecure.verificationId=ABiKYvXjhcB7AAc+K04XAoABFA==
        threeDSecure.eci=07
        googlePay.source=web

And that's it - you're done!

Questions?
Sign up on our website and talk to the CardCorp customer service team for assistance.