AstropayCard Deposit (Redirect)

The following method IDs are covered in this section:

IDNameCredit/Debit State
236AstropayCardRedirectDepositDepositedByProvider (29)

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

Redirect Integration

Currently not supported.

Backend2BackendIntegration

The following table contains the fields to be sent in initiatePaymentRequest.specificPaymentData xml section:

key (value type, account type, required)value
PaymentDescription
(string)
Description of the payment
SuccessPageUrl
(string, required)
URL, to which the client will be transferred in case that he confirms the payment

Please note that sending data of the user is essential for this Payment Method as the data is sent to provider. The following parameters must be provided in initiatePaymentRequest.userData xml section:

key (value type, account type, required)value
Firstname
(string, required)
The user’s first name
Lastname
(string, required)
The user’s last name
Email
(string, required)
The user’s email address
IdentificationNumber
(string, required)
The user’s idenfitication number

Example initiatePaymentRequest:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentRequest xmlns="http://www.cqrpayments.com/PaymentProcessing"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <merchantID>Merchant</merchantID>
  <shopID>Shop</shopID>
  <merchantTransactionID>e9ad84b6-dff9-47ef-aa3d-b4363cdb0abd</merchantTransactionID>
  <paymentMethodID>236</paymentMethodID>
  <amount currencyCode="EUR">15.00</amount>
  <userID>8147e45a-67a7-49ea-926b-e02c5f</userID>
  <userData>
    <username>8147e45a-67a7-49ea-926b-e02c5f</username>
    <address>
      <street>1225 Bonavita St.</street>
      <postalCode>11300</postalCode>
      <city>Sao Paulo</city>
      <state>MO</state>
      <countryCode2>BR</countryCode2>
      </address>
  </userData>
  <userIP>127.0.0.1</userIP>
  <userSessionID>203da031-6310-4614-bc79-11b73b726841</userSessionID>
  <creationTypeID>1</creationTypeID>
  <specificPaymentData>
    <data xsi:type="keyStringValuePair">
      <key>SuccessPageUrl</key>
      <value>https://success/?a=b</value>
    </data>
  </specificPaymentData>
</initiatePaymentRequest>

Example intiatePaymentResponse:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentResponse xmlns="http://www.cqrpayments.com/PaymentProcessing"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <payment xsi:type="paymentWithPaymentAccount">
    <merchantID>Merchant</merchantID>
    <shopID>Shop</shopID>
    <paymentMethod>
      <key>236</key>
      <value>AstropayCardDeposit</value>
    </paymentMethod>
    <merchantTransactionID>e9ad84b6-dff9-47ef-aa3d-b4363cdb0abd</merchantTransactionID>
    <paymentID>956a2cde-20e6-431c-b6fa-c80a62d88bca</paymentID>
    <userID>8147e45a-67a7-49ea-926b-e02c5f</userID>
    <paymentProvider>
      <key>152</key>
      <value>Astropay</value>
    </paymentProvider>
    <amount currencyCode="EUR">15.00</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>23131b45-62c2-42e5-b6a8-f9e592362eed</id>
      <definition>
        <key>30</key>
        <value>RedirectURLCreated</value>
      </definition>
      <createdOn>2017-02-27T09:16:54.6520792Z</createdOn>
      <description>https://test2.backend.cqrpayments.com/WebMockProviders/AstropayFrontend/Index?x_invoice=956a2cde-20e6-431c-b6fa-c80a62d88bca</description>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>RedirectionUrl</key>
          <value>https://test2.backend.cqrpayments.com/WebMockProviders/AstropayFrontend/Index?x_invoice=956a2cde-20e6-431c-b6fa-c80a62d88bca</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">15</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>956a2cde-20e6-431c-b6fa-c80a62d88bca</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>93081515</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>0</paymentAccountID>
    </paymentAccount>
  </payment>
</initiatePaymentResponse>

Notifications

handlePaymentStateChangedNotificationRequest

The provider notifies PXP Financial on payments that are either Successful (state DepositedByProvider), Declined (state RefusedByProvider).

Payment StatesDescription
DepositedByProvider Success state.
RefusedByProvider Payment has been rejected by the provider.

Example handlePaymentStateChangedNotificationRequest:

<?xml version="1.0" encoding="utf-8"?>
<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>YourMerchant</merchantID>
		<shopID>YourShop</shopID>
		<paymentMethod>
			<key>236</key>
			<value>AstropayCardRedirectDeposit</value>
		</paymentMethod>
		<merchantTransactionID>2b7ff9ea-ce3e-4bb7-9dae-198305ea90ea</merchantTransactionID>
		<paymentID>b1c56d25-8d58-4b0b-8670-18d7a045971d</paymentID>
		<userID>b258b5ea-4dcb-4b3d-b191-58f977</userID>
		<paymentProvider>
			<key>152</key>
			<value>Astropay</value>
		</paymentProvider>
		<amount currencyCode="EUR">15.0000</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>c74a70b0-304f-4a3b-9c9a-24be5b628c1b</id>
			<definition>
				<key>29</key>
				<value>DepositedByProvider</value>
			</definition>
			<createdOn>2017-07-11T16:07:27.743</createdOn>
			<description>9</description>
			<paymentStateDetails xsi:nil="true" />
		</state>
		<isExecuted>true</isExecuted>
		<baseAmount currencyCode="EUR">15.0000</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>b1c56d25-8d58-4b0b-8670-18d7a045971d</value>
			</detail>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderTransactionID</key>
				<value>93081515</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>0</paymentAccountID>
		</paymentAccount>
	</payment>
</handlePaymentStateChangedNotificationRequest>

Astropay error codes

ProviderResponseCodeProviderResponseMessage and Action
300Invalid params + [param name] - Ask the user to re-enter the information related to that parameter.
301Empty params + [param name] - The parameter must be included in the request and must not be empty. If the parameter contains information filled by the user, ask the user to fill the information. If the parameter is filled automatically on the merchant's side (x_login, x_trans_key, x_invoice, x_iduser or control), there is an integration error. Please include this parameter in the request.
302Invalid control string - Integration problem. Control string instructions.
401Invalid credentials - Integration problem. Check in the merchant's panel which are the correct credentials. Remember Sandbox and Production credentials are different.
402Unregistered IP address - Whitelist the IP in the merchant's panel in the section Credentials & Settings. If there are no more fields, please contact us.
515Invalid amount - Ask the user to re-enter the amount.
516Invalid invoice - For functions: newInvoice and refund, it means the invoice already exists. For functions: payment status and refund status, it means the invoice was not found.
517Invalid document number - Ask the user to re-enter his document.
520Insufficient funds - The refund could not be processed due to insufficient funds. Contact us to increase the balance.