AstropayCard Deposit (Direct)

The following method IDs are covered in this section:

ID

Name

Credit/Debit State

251

AstropayCardDeposit

AuthorisedByProvider (13)

Payment method interaction type: Synchronous execution (see Interaction Types).

Payment Flow

  1. The user selects AstroPayCard on merchant´s side and is shown an entry form with fields for CardNumber, ExpiryMonth, ExpiryYear and CardVerificationCode.
  2. The merchant sends an initiatePaymentRequest to the PXP Financial payment service.
  3. PXP Financial submits a request to Astropay and receives a response.
  4. PXP Financial responds to the merchant with the initiatePaymentResponse with state
    AuthorisedByProvider (13), or CapturedByProvider (27) or RefusedByProvider (100).
  5. PXP Financial captures the payment automatically.
  6. PXP Financial sends a state notification (handlePaymentStateChangedNotificationRequest) to merchant with state CapturedByProvider.

Redirect Integration

Currently not supported.

Backend2BackendIntegration

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

key (value type, account type, required)

value

PaymentDescription
(string)

Description of the payment

PaymentDescriptionLanguageCode (string)

Language code.

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

CardNumber
(string, required)

The AstroPay Card number, e.g. 1145426000818586. AstroPay Card numbers has 16 digits, starting with 1. The last digit is a checksum digit, generated using Luhn's algorithm (module 10).

ExpiryMonth
(string, required)

The Astropay Card´s expiry month.

ExpiryYear
(string, required)

The Astropay Card´s expiry year.

CardVerificationCode
(string, required)

The Astropay Card´s CVC value.

Example initiatePaymentRequest:

<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>AstropayCardDepositShop</shopID>
<merchantTransactionID>87a289f3-f16d-4be0-8b80-aedaaa38621f</merchantTransactionID>
<paymentMethodID>251</paymentMethodID>
<amount currencyCode="EUR">10</amount>
<userID>e1fb817b-6c24-49b7-897b-da2ba4</userID>
<userData>
  <username>e1fb817b-6c24-49b7-897b-da2ba4</username>
</userData>
<userIP>127.0.0.1</userIP>
<userSessionID>36a642f6-fc34-4b20-bf35-1ef6145a85b1</userSessionID>
<creationTypeID>1</creationTypeID>
<specificPaymentData>
  <data xsi:type="keyStringValuePair">
   <key>PaymentDescription</key>
   <value>Description</value>
  </data>
  <data xsi:type="keyStringValuePair">
   <key>PaymentDescriptionLanguageCode</key>
   <value>en</value>
  </data>
</specificPaymentData>
<paymentAccount>
  <specificPaymentAccountData>
   <data xsi:type="keyStringValuePair">
    <key>CardNumber</key>
    <value>1616946521302339</value>
   </data>
   <data xsi:type="keyIntValuePair">
    <key>ExpiryMonth</key>
    <value>4</value>
   </data>
   <data xsi:type="keyIntValuePair">
    <key>ExpiryYear</key>
    <value>2027</value>
   </data>
   <data xsi:type="keyStringValuePair">
    <key>CardVerificationCode</key>
    <value>0548</value>
   </data>
  </specificPaymentAccountData>
</paymentAccount>
</initiatePaymentRequest>

Example intiatePaymentResponse:

<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>AstropayCardDepositShop</shopID>
  <paymentMethod>
   <key>251</key>
   <value>AstropayCardDeposit</value>
  </paymentMethod>
  <merchantTransactionID>87a289f3-f16d-4be0-8b80-aedaaa38621f</merchantTransactionID>
  <paymentID>8bc547fc-e79f-438c-bf39-debf7a23594d</paymentID>
  <userID>e1fb817b-6c24-49b7-897b-da2ba4</userID>
  <paymentProvider>
   <key>152</key>
   <value>Astropay</value>
  </paymentProvider>
  <amount currencyCode="EUR">10</amount>
  <creationType>
   <key>1</key>
   <value>User</value>
  </creationType>
  <userIP>127.0.0.1</userIP>
  <state>
   <id>c4904b14-35e0-42a9-9c44-ddd762b5ee90</id>
   <definition>
    <key>13</key>
    <value>AuthorisedByProvider</value>
   </definition>
   <createdOn>2017-08-07T08:57:06.73626Z</createdOn>
   <description>This transaction has been approved.</description>
   <paymentStateDetails>
    <detail xsi:type="keyStringValuePair">
     <key>ProviderResponseCode</key>
     <value>0</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>ProviderAuthorizationResponseCode</key>
     <value>1</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>ProviderAuthorizationResponseSubcode</key>
     <value>1</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>ProviderAuthorizationResponseReasonCode</key>
     <value>1</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>ProviderAuthorizationResponseReasonText</key>
     <value>This transaction has been approved.</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>ProviderPaymentAccount</key>
     <value>7451</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>ProviderCVVResponseCode</key>
     <value>M</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>ApprovalCode</key>
     <value>abc150</value>
    </detail>
   </paymentStateDetails>
  </state>
  <isExecuted>true</isExecuted>
  <baseAmount currencyCode="EUR">10</baseAmount>
  <paymentDetails>
   <detail xsi:type="keyStringValuePair">
    <key>ProviderExternalID</key>
    <value>8bc547fc-e79f-438c-bf39-debf7a23594d</value>
   </detail>
   <detail xsi:type="keyStringValuePair">
    <key>ProviderTransactionID</key>
    <value>1254113</value>
   </detail>
  </paymentDetails>
  <paymentAccount>
   <paymentAccountID>20e2ae1c-5661-430f-b554-682fabb07ea9</paymentAccountID>
   <details>
    <detail xsi:type="keyStringValuePair">
     <key>MaskedNumber</key>
     <value>************2339</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>AccountOwnerToken</key>
     <value>e009cf5f-c536-41ea-abb7-831f86429aae</value>
    </detail>
    <detail xsi:type="keyIntValuePair">
     <key>ExpiryMonth</key>
     <value>4</value>
    </detail>
    <detail xsi:type="keyIntValuePair">
     <key>ExpiryYear</key>
     <value>2027</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>CardType</key>
    <value>Astropay</value>
    </detail>
   </details>
  </paymentAccount>
</payment>
</initiatePaymentResponse>

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

Payment States

Description

AuthorisedByProvider

Intermediate success state. Payments are moved by PXP Financial to state CapturedByProvider.

CapturedByProvider

Success state.

RefusedByProvider

Payment has been rejected by the provider. A provider response code is being logged.

Notifications

Example handlePaymentStateChangedNotificationRequest:

<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>B2BTestMerchant</merchantID>
  <shopID>AstropayCardDepositShop</shopID>
  <paymentMethod>
   <key>251</key>
   <value>AstropayCardDeposit</value>
  </paymentMethod>
  <merchantTransactionID>87a289f3-f16d-4be0-8b80-aedaaa38621f</merchantTransactionID>
  <paymentID>8bc547fc-e79f-438c-bf39-debf7a23594d</paymentID>
  <userID>e1fb817b-6c24-49b7-897b-da2ba4</userID>
  <paymentProvider>
   <key>152</key>
   <value>Astropay</value>
  </paymentProvider>
  <amount currencyCode="EUR">10.0000</amount>
  <creationType>
   <key>1</key>
   <value>User</value>
  </creationType>
  <userIP>127.0.0.1</userIP>
  <state>
   <id>004c9a35-e1e3-4829-93b8-27a830617c6b</id>
   <definition>
    <key>27</key>
    <value>CapturedByProvider</value>
   </definition>
   <createdOn>2017-08-07T08:57:09.053</createdOn>
   <paymentStateDetails xsi:nil="true" />
  </state>
  <isExecuted>true</isExecuted>
  <baseAmount currencyCode="EUR">10.0000</baseAmount>
  <paymentDetails>
   <detail xsi:type="keyStringValuePair">
    <key>ProviderExternalID</key>
    <value>8bc547fc-e79f-438c-bf39-debf7a23594d</value>
   </detail>
   <detail xsi:type="keyStringValuePair">
    <key>ProviderTransactionID</key>
    <value>1254113</value>
   </detail>
  </paymentDetails>
  <paymentAccount>
   <paymentAccountID>20e2ae1c-5661-430f-b554-682fabb07ea9</paymentAccountID>
   <details>
    <detail xsi:type="keyStringValuePair">
     <key>MaskedNumber</key>
     <value>************2339</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>AccountOwnerToken</key>
     <value>e009cf5f-c536-41ea-abb7-831f86429aae</value>
    </detail>
    <detail xsi:type="keyIntValuePair">
     <key>ExpiryMonth</key>
     <value>4</value>
    </detail>
    <detail xsi:type="keyIntValuePair">
     <key>ExpiryYear</key>
     <value>2027</value>
    </detail>
    <detail xsi:type="keyStringValuePair">
     <key>CardType</key>
     <value>Astropay</value>
    </detail>
   </details>
  </paymentAccount>
</payment>
</handlePaymentStateChangedNotificationRequest>

v4 Payment Initiation

Alternatively it is possible to initiate a payment using API v4.

Url: /api/v4/merchants/{YourMerchant}/shops/{YourShop}/payments/{PaymentID}?token={TOKEN}
HttpMethod: PUT
Content-Type: application/json

Sample RequestBody:

{
                "account": 
                { 
                               "cardNumber": "1616946521302339",
                               "cardVerificationCode": "111",
                               "expiryMonth": 4,
                               "expiryYear": 2027,
                               "id": "4240dff6-2c8f-4397-b2ec-609a3c1ca20f",
                               "is3DSecureEnabled": null,
                               "lastSuccessfulDepositOn": null,
                               "type":0,
                               "visible": "true"
                },
                "amount": 10.00,
                "currencyCode":"USD",
                "description": null,
                "descriptionLanguageCode": null,
                "errorPageUrl": null,
                "feeAmount": null,
                "isThreeDSecureConditionalRequired": false,
                "paymentMethodID":"251",
                "successPageUrl": null
}

Sample Response:

{
                "paymentState": { 
                               "id": 13,
                               "name":"AuthorisedByProvider"            
                }
}