Once you know what type of service you need to use and this provider use the Token method it’s time to generate the necessary Consumer Authentication Token to send with the credit card information.

Each provider has a specific way to generate that token:

Secure payments using the generated token

Once you have the generated token, must send that token inside the credit card information, Example:

mutation ($input: SubmitTransactionInput!) {
  transactions {
    submit(input: $input) {
      transaction {
        id
        number
        status
        date
        total
        response {
          message
        }
      }
    }
  }
}
{
  "input": {
    "product": "ji12sd4c0a3D0=",
    "inputs": {
      "accountNumber": "+13051231234",
      "amount": 50
    },
    "paymentMethod": "CREDIT_CARD",
    "creditCard": {
      "number":"370000000000002",
      "cvv": "123",
      "expMonth": 6,
      "expYear": 2020,
      "consumerAuthToken": "eyJhbGciOiJIUzI1NiJ9.eyJpc3Mi.....",
      "holder": {
        "name": "Harvey Coulter",
        "address1": "3383  Richland Avenue",
        "city": "Kemah",
        "state": "TX",
        "zipCode": "77565",
        "countryCode": "US"        
      }      
    }
  }
}
{
  "data": {
    "transactions": {
      "submit": {
        "transaction": {
          "id": "VlVkc2R3VlBSRVU5=",
          "number": "00830981",
          "status": "COMPLETED",
          "date": "2018-06-08T21:34:49-04:00",
          "total": 30,
          "response": {
            "message": "The phone +13051231234 has been recharged successfully with $30.00."
          }
        }
      }
    }
  }
}

Note the consumerAuthToken field inside creditCard, this is the Consumer Authentication Token generated, in this example has been truncated for demonstration purposes.

Using a fake token in SANDBOX mode

You can use the following fake token during the integration in SANDBOX mode, this token always pass the consumer authentication.

eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI1ODJlMG1NDgQ.m9xie49ddoGSAQ3JHIzKBs5UsDX

Although this token can be used during integration in SANDBOX mode, it’s recommended use a real token generated using the sandbox mode of each provider.