BankTransferRefund (via Astropay)

BankTransferRefund is applicable to BoletoDeposits through Astropay and BankTransferRedirectDeposits through Astropay.

The following method IDs are covered in this section:

IDNameCredit/Debit State
241BankTransferRefundRefunded

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

For the refund of a Boleto it is necessary to initiate a payment of payment method BankTransferRefund. This is required because a bank account has to be passed in order to initiate a refund for a Boleto payment.

Backend2BackendIntegration

The following parameters can be provided in initiatePaymentRequest.specificPaymentData:

key (value type, account type, required)value
PaymentDescription
(string)
Description of the payment
OriginalPaymentID (string, required)PaymentID of the orginal payment

The following parameters have to be passed in initiatePaymentRequest.specificPaymentAccountData:

key (value type, account type, required)value
CurrencyCode (string)Currency of the bank account, e.g. BRL or USD
BankCountryCode2 (string)Country code of the bank account
AccountNumber (string)Bank account number
BranchCode (string)Branch code of the bank account
AccountOwner (string)Account owner of the bank account (user`s full name)
BankName (string)Name of the bank
AccountType (string)Type of the account (C for current accounts, S for savings account, I for international accounts)

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>B2BTestMerchant</merchantID>
       <shopID>BoletoDepositViaAstropayShop</shopID>
       <merchantTransactionID>926c6691-e321-46dd-a712-71bbe84134e5</merchantTransactionID>
       <paymentMethodID>241</paymentMethodID>
       <amount currencyCode="BRL">10.00</amount>
       <userID>b346ae8a-7be8-4869-b2e8-754473</userID>
       <userData>
              <username>b346ae8a-7be8-4869-b2e8-754473</username>
       </userData>
       <userIP>127.0.0.1</userIP>
       <userSessionID>d8bfde9e-a4e1-4110-ba49-c5f206e7f21f</userSessionID>
       <creationTypeID>1</creationTypeID>
       <specificPaymentData>
              <data xsi:type="keyStringValuePair">
                     <key>PaymentDescription</key>
                     <value>Refund of payment 1234</value>
              </data>
              <data xsi:type="keyStringValuePair">
                     <key>OriginalPaymentID</key>
                     <value>926c6691-e321-46dd-a712-71bbe84134e5</value>
              </data>
       </specificPaymentData>
       <paymentAccount>
              <specificPaymentAccountData>
                     <data xsi:type="keyStringValuePair">
                           <key>CurrencyCode</key>
                           <value>BRL</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>BankCountryCode2</key>
                           <value>BR</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>AccountNumber</key>
                           <value>88365484</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>BranchCode</key>
                           <value>8197</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>AccountOwner</key>
                           <value>John Doe</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>BankName</key>
                           <value>Banco do Brasil</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>AccountType</key>
                           <value>S</value>
                     </data>
              </specificPaymentAccountData>
       </paymentAccount>
</initiatePaymentRequest>

Example initiatePaymentResponse:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentResponse 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>B2BTestMerchant</merchantID>
              <shopID>BoletoDepositViaAstropayShop</shopID>
              <paymentMethod>
                     <key>241</key>
                     <value>BankTransferRefunds</value>
              </paymentMethod>
              <merchantTransactionID>926c6691-e321-46dd-a712-71bbe84134e5</merchantTransactionID>
              <paymentID>be7fe72e-2c1a-40d8-99d8-64f355d8520d</paymentID>
              <userID>b346ae8a-7be8-4869-b2e8-754473</userID>
              <paymentProvider>
                     <key>152</key>
                     <value>Astropay</value>
              </paymentProvider>
              <amount currencyCode="BRL">10.00</amount>
              <creationType>
                     <key>2</key>
                     <value>MerchantOperator</value>
              </creationType>
              <state>
                     <id>42923c89-d37f-4b39-9884-df53b74c7ac0</id>
                     <definition>
                           <key>125</key>
                           <value>Refunded</value>
                     </definition>
                     <createdOn>2017-09-20T11:44:46.9459131Z</createdOn>
                     <description>Amount refunded (final status)</description>
                     <paymentStateDetails xsi:nil="true" />
              </state>
              <isExecuted>true</isExecuted>
              <baseAmount currencyCode="EUR">2.65</baseAmount>
              <paymentDetails>
                     <detail xsi:type="keyIntValuePair">
                           <key>OriginalPaymentID</key>
                           <value>21098059</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderExternalID</key>
                           <value>be7fe72e-2c1a-40d8-99d8-64f355d8520d</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderTransactionID</key>
                           <value>0dd85469-c0ef-4c3d-8f01-61faca298924</value>
                     </detail>
              </paymentDetails>
              <paymentAccount>
                     <paymentAccountID>8791bb79-7b41-4f9e-9c9d-88ee139a0c4a</paymentAccountID>
              </paymentAccount>
       </payment>
</initiatePaymentResponse>

Example initiatePaymentRequest with reference:

<?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>B2BTestMerchant</merchantID>
       <shopID>BoletoDepositViaAstropayShop</shopID>
       <merchantTransactionID>1cc64992-8482-4688-acd9-5039a37a6a83</merchantTransactionID>
       <paymentMethodID>241</paymentMethodID>
       <amount currencyCode="BRL">11.00</amount>
       <userID>51d1fe63-3bda-45f1-8120-81d466</userID>
       <userData>
              <username>51d1fe63-3bda-45f1-8120-81d466</username>
       </userData>
       <userIP>127.0.0.1</userIP>
       <userSessionID>3670879d-1cd3-494f-b245-d9953e8aa1b3</userSessionID>
       <creationTypeID>1</creationTypeID>
       <specificPaymentData>
              <data xsi:type="keyStringValuePair">
                     <key>PaymentDescription</key>
                     <value>Refund of payment 2345</value>
              </data>
              <data xsi:type="keyStringValuePair">
                     <key>OriginalPaymentID</key>
                     <value>1cc64992-8482-4688-acd9-5039a37a6a83</value>
              </data>
       </specificPaymentData>
       <paymentAccountID>19802f7d-e871-468f-a149-a56ea0b5476f</paymentAccountID>
       <paymentAccount>
              <specificPaymentAccountData>
                     <data xsi:type="keyStringValuePair">
                           <key>CurrencyCode</key>
                           <value>BRL</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>BankCountryCode2</key>
                           <value>BR</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>AccountNumber</key>
                           <value>88365484</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>BranchCode</key>
                           <value>8197</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>AccountOwner</key>
                           <value>John Doe</value>
                     </data>
                     <data xsi:type="keyStringValuePair">
                           <key>BankName</key>
                           <value>Banco do Brasil</value>
                     </data>
              </specificPaymentAccountData>
       </paymentAccount>
</initiatePaymentRequest>

Example initiatePaymentResponse with reference:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentResponse 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>B2BTestMerchant</merchantID>
              <shopID>BoletoDepositViaAstropayShop</shopID>
              <paymentMethod>
                     <key>241</key>
                     <value>BankTransferRefunds</value>
              </paymentMethod>
              <merchantTransactionID>1cc64992-8482-4688-acd9-5039a37a6a83</merchantTransactionID>
              <paymentID>87d1b1b9-f520-44de-90fc-c25280b56404</paymentID>
              <userID>51d1fe63-3bda-45f1-8120-81d466</userID>
              <paymentProvider>
                     <key>152</key>
                     <value>Astropay</value>
              </paymentProvider>
              <amount currencyCode="BRL">11.00</amount>
              <creationType>
                     <key>2</key>
                     <value>MerchantOperator</value>
              </creationType>
              <state>
                     <id>65c79e4c-2187-475d-a593-26d4760e714c</id>
                     <definition>
                           <key>125</key>
                           <value>Refunded</value>
                     </definition>
                     <createdOn>2017-09-20T11:46:50.8267167Z</createdOn>
                     <description>Amount refunded (final status)</description>
                     <paymentStateDetails xsi:nil="true" />
              </state>
              <isExecuted>true</isExecuted>
              <baseAmount currencyCode="EUR">2.92</baseAmount>
              <paymentDetails>
                     <detail xsi:type="keyIntValuePair">
                           <key>OriginalPaymentID</key>
                           <value>21098061</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderExternalID</key>
                           <value>87d1b1b9-f520-44de-90fc-c25280b56404</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderTransactionID</key>
                           <value>37e97dab-b8f3-4b71-ad05-8be79a7292a3</value>
                     </detail>
              </paymentDetails>
              <paymentAccount>
                     <paymentAccountID>19802f7d-e871-468f-a149-a56ea0b5476f</paymentAccountID>
              </paymentAccount>
       </payment>
</initiatePaymentResponse>

Notifications

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