CODI (Astropay BankTransfer Redirect Deposit)

Cobro Digital (CoDi) is a new digital payment option in Mexico.

The following method IDs are covered in this section:

IDNameCredit/Debit State
264AstropayBankTransferRedirectDepositDepositedByProvider

The flow that is used here in the same as for other AstropayBankTransferRedirectDeposit payment methods.

Payment method interaction type: Redirection to External Payment Provider (see Interaction Types).

Redirect Integration

Currently not supported.

Backend2BackendIntegration

The following parameters can be provided in initiatePaymentRequest.specificPaymentData:

key (value type, account type, required)value
SuccessPageUrl
(string)
URL for redirecting the customer after the payment. Redirection to the URL does not imply a successful payment.
PaymentDescription (string)Description text, maximum 200 characters.
BankName (string, required)Please pass Codi in this field.

The following parameters can be provided in initiatePaymentRequest.userData:

key (value type, account type, required)value
address.countryCode2 (string, required)Upper case two-letter country code (ISO 3166).
identificationNumber (string, required)CURP/RFC/IFE for Mexico.
telephoneNumber (string, optional)Can be omitted for Mexico.

❗️

Identification Number

For Mexico, the field IdentificationNumber should include the CURP or RFC or IFE number.

Example initiatePaymentRequest:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.cqrpayments.com/PaymentProcessing">
       <merchantID>DemoMerchant</merchantID>
       <shopID>DemoShop</shopID>
       <merchantTransactionID>f032acfc-4dc8-4039-99c6-a47739205a2d-0402-033</merchantTransactionID>
       <paymentMethodID>264</paymentMethodID>
       <amount currencyCode="MXN">5000</amount>
       <userID>3e4772d0-72de-4eea-ab13-223c6d3</userID>
       <userData>
              <username>3e4772d0-72de-4eea-ab13-223c6dd3</username>
              <firstname>John</firstname>
              <lastname>Doer</lastname>
              <email>[email protected]</email>
              <address>
                     <street>1224 Bonavita St.</street>
                    <postalCode>11300</postalCode>
                     <city>Sao Paulo</city>
                     <state>MO</state>
                     <countryCode2>MX</countryCode2>
                     <telephoneNumber xsi:nil="true" />
              </address>
              <dateOfBirth>1955-02-16T00:00:00</dateOfBirth>
              <identificationNumber>12345679</identificationNumber>
       </userData>
       <userIP>127.0.0.1</userIP>
       <userSessionID>d36ac5a0-e1d4-42fa-b513-fd0e6dae0703</userSessionID>
       <creationTypeID>1</creationTypeID>
       <specificPaymentData>
              <data xsi:type="keyStringValuePair">
                     <key>SuccessPageUrl</key>
                     <value>https://www.google.com/?a=b&amp;c=d</value>
              </data>
              <data xsi:type="keyStringValuePair">
                     <key>PaymentDescription</key>
                     <value>Description text, maximum 200 characters.</value>
              </data>
              <data xsi:type="keyStringValuePair">
                     <key>BankName</key>
                     <value>codi</value>
              </data>
       </specificPaymentData>
</initiatePaymentRequest>

Example initiatePaymentResponse:

<initiatePaymentResponse xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <payment xsi:type="paymentWithPaymentAccount">
        <merchantID>DemoMerchant</merchantID>
        <shopID>DemoShop</shopID>
        <paymentMethod>
            <key>264</key>
            <value>BankTransferRedirectDeposit</value>
        </paymentMethod>
        <merchantTransactionID>f032acfc-4dc8-4039-99c6-a47739205a2d-0402-033</merchantTransactionID>
        <paymentID>b3077029-b6fa-4a09-ad45-80d1012f62c1</paymentID>
        <userID>3e4772d0-72de-4eea-ab13-223c6d3</userID>
        <paymentProvider>
            <key>152</key>
            <value>Astropay</value>
        </paymentProvider>
        <amount currencyCode="MXN">5000</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>f9991fb5-c4c5-4239-95d2-582d40879069</id>
            <definition>
                <key>30</key>
                <value>RedirectURLCreated</value>
            </definition>
            <createdOn>2023-02-06T19:33:42.1232412Z</createdOn>
            <description>https://payin-stg.depositcheckout.com/pay/eyJhbGciOiJIUzM4NCJ9.eyJqdGkiOiIzMDA4MDgzMDciLCJpYXQiOjE2NzU3MTIwMjEsImV4cCI6MTY3NzAwODAyMX0.Fsg_t02gKv-rpAd3jBJqojspMMl0aTTCny2-kiHlrDOBTJzmYzmzpIQVtaaQcoxe?q=0</description>
            <paymentStateDetails>
                <detail xsi:type="keyStringValuePair">
                    <key>RedirectionUrl</key>
                    <value>https://payin-stg.depositcheckout.com/pay/eyJhbGciOiJIUzM4NCJ9.eyJqdGkiOiIzMDA4MDgzMDciLCJpYXQiOjE2NzU3MTIwMjEsImV4cCI6MTY3NzAwODAyMX0.Fsg_t02gKv-rpAd3jBJqojspMMl0aTTCny2-kiHlrDOBTJzmYzmzpIQVtaaQcoxe?q=0</value>
                </detail>
                <detail xsi:type="keyStringValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">231.2</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>BankName</key>
                <value>codi</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderTransactionID</key>
                <value>300808307</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>LocalAmount</key>
                <value>5000</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>LocalCurrency</key>
                <value>MXN</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>UsdAmount</key>
                <value>260.87</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>AmountToDeposit</key>
                <value>5000</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>15396</value>
            </detail>
        </paymentDetails>
        <paymentAccount>
            <paymentAccountID>0</paymentAccountID>
        </paymentAccount>
    </payment>
</initiatePaymentResponse>

For the refund of a AstropayBankTransferRedirectDeposit, please refer to BankTransferRefund.

Notifications

The standard notification mechanism is used for notifying the merchant in the background (asynchronously) about payment state changes. For more information see PaymentStateChangedNotification.

Example handlePaymentStateChangedNotificationRequest for a successful payment:

<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.cqrpayments.com/PaymentProcessing">
       <payment xsi:type="paymentWithPaymentAccount">
              <merchantID>DemoMerchant</merchantID>
              <shopID>DemoShop</shopID>
              <paymentMethod>
                     <key>264</key>
                     <value>BankTransferRedirectDeposit</value>
              </paymentMethod>
              <merchantTransactionID>31cda417-6e0b-4230-8f9c-d6d18b6c918d</merchantTransactionID>
              <paymentID>ac2b47ef-3565-483f-9f9e-607a02b83e75</paymentID>
              <userID>8e2a3fa7-f500-43d9-81b2-aadb78</userID>
              <paymentProvider>
                     <key>152</key>
                     <value>Astropay</value>
              </paymentProvider>
              <amount currencyCode="MXN">15.0000</amount>
              <creationType>
                     <key>1</key>
                     <value>User</value>
              </creationType>
              <userIP>127.0.0.1</userIP>
              <state>
                     <id>5c2b6382-8547-4a54-96fa-cf4b70fd0458</id>
                     <definition>
                           <key>29</key>
                           <value>DepositedByProvider</value>
                     </definition>
                     <createdOn>2017-09-08T14:58:16.057</createdOn>
                     <paymentStateDetails>
                           <detail xsi:type="keyStringValuePair">
                                  <key>ProviderErrorMessage</key>
                                  <value>this field will not be reacted on in case result is 9</value>
                           </detail>
                     </paymentStateDetails>
              </state>
              <isExecuted>true</isExecuted>
              <baseAmount currencyCode="MXN">15.0000</baseAmount>
              <paymentDetails>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderExternalID</key>
                           <value>ac2b47ef-3565-483f-9f9e-607a02b83e75</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>BankName</key>
                           <value>Codi</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderTransactionID</key>
                           <value>89794161</value>
                     </detail>
              </paymentDetails>
              <paymentAccount>
                     <paymentAccountID>0</paymentAccountID>
              </paymentAccount>
       </payment>
</handlePaymentStateChangedNotificationRequest>

Example handlePaymentStateChangedNotificationRequest for a failed payment:

<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.cqrpayments.com/PaymentProcessing">
       <payment xsi:type="paymentWithPaymentAccount">
              <merchantID>DemoMerchant</merchantID>
              <shopID>DemoShop</shopID>
              <paymentMethod>
                     <key>264</key>
                     <value>BankTransferRedirectDeposit</value>
              </paymentMethod>
              <merchantTransactionID>e20df281-2bec-433c-ae48-4862590dc0c4</merchantTransactionID>
              <paymentID>f713c0c1-4f6b-4048-89f4-9f034f364976</paymentID>
              <userID>bdef04ed-01ae-43cf-b5c3-07ea58</userID>
              <paymentProvider>
                     <key>152</key>
                     <value>Astropay</value>
              </paymentProvider>
              <amount currencyCode="MXN">14.9900</amount>
              <creationType>
                     <key>1</key>
                     <value>User</value>
              </creationType>
              <userIP>127.0.0.1</userIP>
              <state>
                     <id>59adedbd-90ad-4d56-aaa3-5f668f26fd97</id>
                     <definition>
                           <key>100</key>
                           <value>RefusedByProvider</value>
                     </definition>
                     <createdOn>2017-09-08T09:55:26.393</createdOn>
                     <paymentStateDetails>
                           <detail xsi:type="keyStringValuePair">
                                  <key>ProviderErrorMessage</key>
                                  <value>cc_rejected_insufficient_amount</value>
                           </detail>
                           <detail xsi:type="keyIntValuePair">
                                  <key>PaymentStateReasonID</key>
                                  <value>1</value>
                           </detail>
                     </paymentStateDetails>
              </state>
              <isExecuted>false</isExecuted>
              <baseAmount currencyCode="MXN">14.9900</baseAmount>
              <paymentDetails>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderExternalID</key>
                           <value>f713c0c1-4f6b-4048-89f4-9f034f364976</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>BankName</key>
                           <value>Codi</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderTransactionID</key>
                           <value>99672376</value>
                     </detail>
              </paymentDetails>
              <paymentAccount>
                     <paymentAccountID>0</paymentAccountID>
              </paymentAccount>
       </payment>
</handlePaymentStateChangedNotificationRequest>

Provider Testing

For provider testing, login to the sandbox backoffice at https://merchants-stg.directa24.com/