Payment with two cards confirmation service

After creating and authorizing a two cards payment pending confirmation, the merchant must call the two cards payment confirmation service to confirm or undo the payment using the same NIT obtained on the first step of the flow.

Flow#

The two cards payment confirmation flow has two differences when compared to the traditional confirmation.

The first difference is that there will be two transactions related to a single operation and each one of them is used to confirm the payment of one of the chosen payment methods.

The second difference is that two cards payment confirmation response is composed by each transaction response. It means that each of the transactions' responses can affect the results of the other one.

We will cover the Carat Portal predicted scenarios below.

Successful confirmation#

First confirmation fails#

When the first confirmation fails, the second transaction will be undone. An issue will be registered and the merchant may contact Carat Portal's support team if they find it necessary.

Response example#

{
"code": "1013",
"message": "Error processing multiple payment methods",
"confirmations": [
{
"code": "259",
"message": "Denied transaction",
"payment": {
"authorizer_code": "409",
"authorizer_message": "Brand / card type is invalid or not supported [Cód.: 5996]",
"status": "PPC",
"acquirer_id": "414"
}
},
{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"authorizer_code": "200",
"authorizer_message": "Function performed error-free [Cód.: 00]",
"status": "PPN",
"acquirer_id": "414"
}
}
]
}

Second confirmation fails#

When the second confirmation fails, the first transaction will be already confirmed. Therefore, it must be manually cancelled if the merchant finds it necessary by using either the REST cancellation call or the Merchant Web Page. An issue will be registered and the merchant may contact Carat Portal's support team if they find it necessary.

Response example#

{
"code": "1013",
"message": "Error processing multiple payment methods",
"confirmations": [
{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"authorizer_code": "200",
"authorizer_message": "Function performed error-free [Cód.: 00]",
"status": "CON",
"acquirer_id": "414"
}
},
{
"code": "259",
"message": "Denied transaction",
"payment": {
"authorizer_code": "409",
"authorizer_message": "Brand / card type is invalid or not supported [Cód.: 5996]",
"status": "PPC",
"acquirer_id": "414"
}
}
]
}

Call details#

  • Resource: /v1/payments/multiple/{nit}
  • HTTP Method: PUT
  • Request format: query string
  • Response format: JSON
  • Header parameters:
ParameterDescriptionFormatMandatory
merchant_idMerchant code on Carat Portal. The production and certification codes will be different.< 15 ANYES
merchant_keyMerchant authentication key on Carat Portal. The production and certification keys will be different.< 80 ANYES

Examples#

Below is an example of the two cards payment confirmation service call using the cURL tool.

Requisição:

To use this example, don't forget to define the variable {{url}} with the value
esitef-homologacao.softwareexpress.com.br

curl
--request PUT "https://{{url}}/e-sitef/api/v1/payments/multiple/1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr?confirm=true"
--header "merchant_id:xxxxxxxxxxxxxxx"
--header "merchant_key: xxxxxxxxxxx"
--verbose

Resposta:

{
"code": "0",
"message": "OK. Transaction successful.",
"confirmations": [
{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"authorizer_code": "130",
"status": "CON",
"acquirer_id": "5"
}
},
{
"code": "0",
"message": "OK. Transaction successful.",
"payment": {
"authorizer_code": "130",
"status": "CON",
"acquirer_id": "5"
}
}
]
}

Response codes

See reference on API codes - response codes

Request parameters#

The table below describes the request parameters of the payment with two cards confirmation service:

ParameterDescriptionFormatMandatory
confirmThis field must be sent with the value true if you want to confirm the transaction, or false, if you want to undo it.< 5 T/FYES

Response parameters#

If successful, the HTTP response code will be 200. Any other code must be interpreted as an error. The table below describes the response parameters of the payment confirmation service:

ParameterDescriptionFormat
codeTwo cards payment operation Carat Portal response code. Any code different from 0 means failure. [Learn more.](/en/docs/e-sitef/codigos-da-api#response-codes< 4 N
messageTwo cards payment operation Carat Portal response message.< 500 AN
confirmations[]
codeCarat Portal response code for this payment method. Any code different from 0 means failure. Learn more..< 4 N
messageCarat Portal response message for this payment method.< 500 AN
payment
statusStatus of the payment transaction on Carat Portal. Learn more.= 3 AN
authorizer_codeAuthorizer response code. This field is not returned if this is not the first call to the operation.< 10 AN
authorizer_messageAuthorizer response message. This field is not returned if this is not the first call to the operation.< 500 AN
acquirer_idCode of the acquirer used on the transaction. This field is not returned if this is not the first call to the operation.< 4 N