Payment Gateway Responses

The Kibo Composable Commerce Platform (KCCP) uses payment gateways to process credit card transactions. To process credit card transactions on your storefront, you must set up a payment gateway and then assign that gateway to payment types.

You can set up a payment gateway in Admin, on the System > Settings > Payment Gateways page. Refer to Payment Gateways in the Guides section for more information.

Payment Interactions

Payment information is stored in the commerce/orders/payments resource. You can view specific gateway response information under the interactions object on this payment, such as in:

"interactions": [
    {
        ...
        "gatewayAuthCode": "string",
        "gatewayAVSCodes": "string",
        "gatewayCVV2Codes": "string",
        "gatewayInteractionId": "int",
        "gatewayResponseCode": "string",
        "gatewayResponseData": [
            {
                "key": "string",
                "value": "string"
            }
        ],
        "gatewayResponseText": "string",
        "gatewayTransactionId": "string"
        ...
    }
]

Each gateway returns this information in a format that is unique to the gateway. Refer to the following sections for more information about the gatewayResponseCode and gatewayResponseData values.

Gateway Response Code and Text

Each payment gateway returns specific gateway response codes and text that are unique to the payment gateway. The response code is stored in the gatewayResponseCode property and the response text is stored in the gatewayResponseText property.

For example, a response code of 32 from Authorize.Net would be displayed as:

"gatewayResponseCode": 32,
"gatewayResponseText": "The merchant password is invalid or not present."

Refer to your specific payment gateway's documentation for details about their specific response codes. Kibo displays the gateway response code and text in Admin, under the payments section on an order:

Callouts of the Response Code and Response Message in payment transaction history

Gateway Response Data

Kibo also captures additional response data that's unique to each gateway in the payment object. This response data is displayed as a list of key:value pairs in the responseData object:

{
    "authCode": "",
    "transactionId": "123",
    "aVSCodes": "",
    "cVV2Codes": "",
    "isSuccessful": true,
    "isDeclined": false,
    "isPending": false,
    "responseText": "OK",
    "responseCode": "200",
    "responseData": [
        {
            "key": "time",
            "value": "Thu Aug 29 2024 15:21:32 GMT+0000 (Coordinated Universal Time)"
        },
        {
            "key": "stuff",
            "value": "isGood"
        }
    ]
}

Note that the full response includes flags indicating whether the action was successful, declined, or pending. If isPending=true after initiating an authorization, capture, void, or credit, then the payment will be moved into the appropriate pending state:

  • AuthorizePending
  • CapturePending
  • VoidPending
  • CreditPending

The authorized, collected, and credited amounts will not be updated in the order payment data until it moves into a successful state.