Tutorial: Push Card to Digital Wallets

A Digital First Card is a virtual payment card that account holders can instantly create within their neo-bank's application. This digital card can be activated for immediate usage even before a physical card is received through mail. It can also be added to the user's digital wallet for quick and convenient access. In this tutorial, we will walk you through the steps to enable the ability to add digital cards to an account holder's digital wallet using MBanq's API.

๐Ÿ“˜

Digital Wallets available to push Cards to:

  • ApplePay
  • GooglePay
  • SamsungPay

Prerequisites:

Before proceeding with the tutorial, ensure that you have the necessary credentials and access to the MBanq API. You should also have a basic understanding of GraphQL and how to make API requests.

Step 1: Prepare Necessary Information
To push a card to a user's digital wallet, you'll need specific information depending on the wallet provider. Here's the information required for different wallet providers:

Table: Parameters for Pushing Cards to Digital Wallets

Parameter NameDigital Wallet TypeExplanation and Usage
certificate1Apple Pay, Samsung PayThe leaf certificate returned by the wallet provider, signed using certificate2. Should be in hexlified (case insensitive) binary data format.
certificate2Apple Pay, Samsung PayThe subordinate certificate returned by the wallet provider, signed using the wallet providerโ€™s Certificate Authority (CA) certificate. Should be in hexlified (case insensitive) binary data format.
nonceApple PayThe hexlified (case insensitive) nonce value returned by the Apple Pay SDK.
nonceSignatureApple PayThe hexlified (case insensitive) nonce signature value returned by the Apple Pay SDK.
deviceIDGoogle Pay, Samsung PayThe value given by the Google or Samsung Pay SDKs for use by Visa.
walletAccountIDGoogle Pay, Samsung PayThe value given by the Google or Samsung Pay SDKs for use by Visa. Required for VISA + Samsung/Google Pay.

๐Ÿ“˜

Note: The table above lists the parameters needed to push cards to different digital wallet types supported by the MBanq API. Ensure to provide the appropriate parameters depending on the selected digital wallet type in the API request.

Step 2: Make API Request to Push Card to Wallet

To push a card to a user's wallet, make a POST request to the MBanq API endpoint "/graphql". Depending on the wallet provider, you'll include the required information in the input of the mutation.

Example Request for Apple Pay:

POST /graphql

mutation {
  provisionCard(id: 37, input: {
    walletProvider: APPLE_PAY,
    certificate1: "<certificate1-value>",
    certificate2: "<certificate2-value>",
    nonce: "<nonce-value>",
    nonceSignature: "<nonceSignature-value>"
  }) {
    activationData
    encryptedCardData
    ephemeralPublicKey
  }
}

Example Request for Google Pay:

POST /graphql

mutation {
  provisionCard(id: 8997, input: {
    walletProvider: GOOGLE_PAY,
    deviceID: "1232",
    walletAccountID: "1232"
  }) {
    activationData
  }
}

Example Request for Samsung Pay:

POST /graphql

mutation {
  provisionCard(id: 8997, input: {
    walletProvider: SAMSUNG_PAY,
    deviceID: "1232",
    walletAccountID: "1232",
    certificate1: "<certificate1-value>",
    certificate2: "<certificate2-value>"
  }) {
    activationData
  }
}

Step 3: Handle API Response
If the API request is successful, you'll receive a response with the activation data. The activation data contains necessary information to finalize the provisioning process for the digital card in the user's digital wallet.

Parameter NameDefinition and Explanation
activationDataA string containing information to finalize the provisioning process for the digital card in the user's digital wallet.

Example Response:


json
{
  "data": {
    "provisionCard": {
      "activationData": "<activationData-value>",
      "encryptedCardData": "<encryptedCardData-value>",
      "ephemeralPublicKey": "<ephemeralPublicKey-value>"
    }
  }
}

By following this tutorial, you can successfully enable the ability to add digital first cards to the account holder's digital wallet using the MBanq API. Digital First Cards provide a seamless and efficient way for users to access and utilize their payment cards instantly, contributing to a more convenient and user-friendly banking experience.