Payment Experiences

Introduction

Payments experiences are managed by the Transactions API through the requiredAction object included in the Transaction API response.

The general structure for the object requiredAction is:

"requiredAction": {
        "actionType": "{{actiontype}}",
        "data": {
          {{specific fields}}
          "additionalInformation": []
        },
        "expirationDate": "2022-12-07T20:49:38Z",
        "relatedPaymentMethodData": {
            "paymentMethodType": "{{payment method type}}",
            "paymentMethodTypeClass": "{{payment method class}}",
            "paymentMethodTypeCountry": "{{country code}}",
            "paymentMethodTypeDescription": "{{Payment method description name}}"
        },
        "status": "{{action_status}}"
    },

Possible action types are:

  • Payment Code
  • Bank Payment Code
  • Bank Transfer
  • QR
  • QRImage
  • Redirect URL
  • Ticket

Payment Code

The action type paymentcode is for cash payments. Following an example including the relevant information for this action type.

"requiredAction": {
       "actionType": "paymentcode",
       "data": {
           "additionalInformation": [ ],
           "code": "47133940392"
       },
       "expirationDate": "2022-11-03T00:27:13Z",
       "relatedPaymentMethodData": {
           "paymentMethodType": "cashin-sv",
           "paymentMethodTypeClass": "cash",
           "paymentMethodTypeCountry": "SV",
           "paymentMethodTypeDescription": "Cash"
       },
       "status": "active"
   }

The customer should use requiredAction.data.code to make the payment following the instructions that are in the field usage for the payment method (PaymentMethod API).


Bank Payment Code

The action type bankpaymentcode is for bank payments. Following an example including the relevant information for this action type.

"requiredAction": {
       "actionType": "bankpaymentcode",
       "data": {
           "additionalInformation": [],
           "code": "47133910358"
       },
       "expirationDate": "2022-11-03T00:25:49Z",
       "relatedPaymentMethodData": {
           "paymentMethodType": "credicomerin-sv",
           "paymentMethodTypeClass": "bank",
           "paymentMethodTypeCountry": "SV",
           "paymentMethodTypeDescription": "Credicomer"
       },
       "status": "active"
   }

The customer should use requiredAction.data.code to make the payment in the bank portal following the instructions that are in the field usage for the payment method (PaymentMethod API).


Bank Transfer

The action type banktransfer is for bank payment. Following an example including the relevant information for this action type.

"requiredAction": {
       "actionType": "banktransfer",
       "data": {
           "additionalInformation": [],
           "bankAccount": "646180333100000003",
           "bankName": "STP",
           "beneficiary": "Inswitch",
           "reference": "5EC5DE1DF90DF"
       },
       "expirationDate": "2022-11-01T01:34:09Z",
       "relatedPaymentMethodData": {
           "paymentMethodType": "speisin-mx",
           "paymentMethodTypeClass": "bank",
           "paymentMethodTypeCountry": "MX",
           "paymentMethodTypeDescription": "SPEI Bank Transfer"
       },
       "status": "active"
   }

The customer should make a bank transfer to bank account requiredAction.data.bankAccount, that it is in the bank requiredAction.data.bankName, which beneficiary is requiredAction.data.beneficiary and using the requiredAction.data.reference.
See the instructions that are in the field usage for the payment method (PaymentMethod API)


QR

The action type qr is for bank payment. Following an example including the relevant information for this action type.

"requiredAction": {
       "actionType": "qr",
       "data": {
           "additionalInformation": [],
           "code": "00020101021226930014br.gov.bcb.pix2571api-h.developer.btgpactual.com/v1/p/v2/cf2abb84d02042308152ad75dd14a8515204000053039865802BR5908Inswitch6010Montevideo62070503***63047B7E"
       },
       "expirationDate": "2022-11-02T00:44:53Z",
       "relatedPaymentMethodData": {
           "paymentMethodType": "pixin-br",
           "paymentMethodTypeClass": "bank",
           "paymentMethodTypeCountry": "BR",
           "paymentMethodTypeDescription": "Pix"
       },
       "status": "active"
   }

The channel should generate a qr code using requiredAction.data.code, the customer should read it and make the payment.


QRImage

The action type qrimage is for bank payment. Following an example including the relevant information for this action type.

"requiredAction": {
       "actionType": "qrimage",
       "data": {
           "additionalInformation": [],
           "image": "{{base64 format}}"
       },
       "expirationDate": "2022-12-07T20:49:38Z",
       "relatedPaymentMethodData": {
           "paymentMethodType": "quickpayin-sv",
           "paymentMethodTypeClass": "bank",
           "paymentMethodTypeCountry": "SV",
           "paymentMethodTypeDescription": "Quick Pay QR"
       },
       "status": "active"
   }

The channel should display the bas64 format image requiredAction.data.image , the customer should read it and make the payment.


Redirect URL

The action type redirectURL is for bank payments and card payments. Following an example including the relevant information for this action type.

"requiredAction": {
       "actionType": "redirecturl",
       "data": {
           "additionalInformation": [],
           "redirectURL": "https:/url.com.uy"
       },
       "expirationDate": "2022-11-03T00:55:11Z",
       "relatedPaymentMethodData": {
           "paymentMethodType": "brousin-uy",
           "paymentMethodTypeClass": "bank",
           "paymentMethodTypeCountry": "UY",
           "paymentMethodTypeDescription": "BROU"
       },
       "status": "active"
   }

The channel should redirect the customer to the url requiredAction.data.redirectURL.


Ticket

The action type ticket is for cash or bank payments. Following an example including the relevant information for this action type.

"requiredAction": {
       "actionType": "ticket",
       "data": {
           "additionalInformation": [],
           "ticketURL": "https://sandbox.inswitch.com/b/pdf/2319597675606952"
       },
       "expirationDate": "2022-11-02T00:00:00Z",
       "relatedPaymentMethodData": {
           "paymentMethodType": "boletobancariocashin-br",
           "paymentMethodTypeClass": "cash",
           "paymentMethodTypeCountry": "BR",
           "paymentMethodTypeDescription": "Boleto Bancario"
       },
       "status": "active"
   }

The channel should show the the url requiredAction.data.ticketURL that includes the information to make the payment.