WebPay Deposit (via Astropay)

Webpay is the payment portal of Transbank. A method by which credit and debit card transactions of all banks in Chile are processed. Webpay provides merchants with POS machines and payment API for online purchasing. Once implemented in merchant website, Webpay permits customers to pay through:
Debit card: All debit cards emitted by Chilean banks
Credit card: Visa, MasterCard, MAGNA, AMEX, DINERS (both National & International).

The following method IDs are covered in this section:

IDNameCredit/Debit State
276WebPayDepositDepositedByProvider(29)

Payment method interaction type: Redirection to External Payment Provider (see Interaction Types).
After choosing the payment method on merchant's site the user is redirected to the provider's site and without showing any screen to the user it redirects him to Servipag/WebPay site. There the payment is executed. The provider sends notification for successful or refused payment.

Redirect Integration

Currently not supported.

Backend2BackendIntegration

The following table contains the fields to be sent in the initiatePaymentRequest.xml and have special format:

key (value type, account type, required)value
userID (string, required)The Sportingbet client ID. Must be numeric (no points or commas are allowed)
amount (long integer, required)Deposit amount. Must be numeric (no decimal places are allowed for the Chilean pesos)

The following parameters have to be provided in the initiatePaymentRequest.userData xml section:

key (value type, account type, required)value
identificationNumber (string, required)The user’s identification number. Must be 7 or 8 numbers followed by a hyphen (-) followed by a digit from 0 to 9 or a K.
email (string)The user’s email address
UserFirstname (string)The user´s first name
UserLastname (string)The user´s last name
username (string)The user´s username

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>MyMerchantID</merchantID>
       <shopID>MyShopID</shopID>
       <merchantTransactionID>f032acfc-4dc8-4039-99c6-a47739205a2d-26</merchantTransactionID>
       <paymentMethodID>276</paymentMethodID>
       <amount currencyCode="CLP">1000</amount>
       <userID>3e4772d0-72de-4eea-ab13-223c6d</userID>
       <userData>
              <username>3e4772d0-72de-4eea-ab13-223c6d</username>
              <firstname>John</firstname>
              <lastname>Doe</lastname>
              <email>[email protected]</email>
              <address>
                     <street>1225 Braden St.</street>
                     <postalCode>11300</postalCode>
                     <city>El Salvador</city>
                     <state>MO</state>
                     <countryCode2>CL</countryCode2>
                     <telephoneNumber xsi:nil="true" />
              </address>
              <dateOfBirth>1955-02-15T00:00:00</dateOfBirth>
              <identificationNumber>13508145-0</identificationNumber>
       </userData>
       <userIP>127.0.0.1</userIP>
       <userSessionID>d36ac5a0-e1d4-42fa-b513-fd0e6dae0703</userSessionID>
       <creationTypeID>1</creationTypeID>
       <specificPaymentData>
              <data xsi:type="keyStringValuePair">
                     <key>HomePageUrl</key>
                     <value>http://HomePageUrl/?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="keyIntValuePair">
                    <key>PaymentProviderID</key>
                    <value>152</value>
            </data>
       </specificPaymentData>
</initiatePaymentRequest>

Example initiatePaymentResponse:

<?xml version="1.0" encoding="utf-8"?>
<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>MyMerchantID</merchantID>
        <shopID>MyShopID</shopID>
        <paymentMethod>
            <key>276</key>
            <value>WebPayDeposit</value>
        </paymentMethod>
        <merchantTransactionID>f032acfc-4dc8-4039-99c6-a47739205a2d-26</merchantTransactionID>
        <paymentID>13985792-1203-491c-8a28-e7d58aba945c</paymentID>
        <userID>3e4772d0-72de-4eea-ab13-223c6d</userID>
        <paymentProvider>
            <key>152</key>
            <value>Astropay</value>
        </paymentProvider>
        <amount currencyCode="CLP">1000</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>fe059585-3d18-4c25-86a5-ee3768751e63</id>
            <definition>
                <key>30</key>
                <value>RedirectURLCreated</value>
            </definition>
            <createdOn>2018-01-23T08:53:10.9532548Z</createdOn>
            <description>[[The URL to redirect the customer to]]</description>
            <paymentStateDetails>
                <detail xsi:type="keyStringValuePair">
                    <key>RedirectionUrl</key>
                    <value>[[The URL to redirect the customer to]]</value>
                </detail>
                <detail xsi:type="keyStringValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">1.35</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>LocalAmount</key>
                <value>1000.00</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>LocalCurrency</key>
                <value>CLP</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>UsdAmount</key>
                <value>750.00</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>AmountToDeposit</key>
                <value>1000.00</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>13985792-1203-491c-8a28-e7d58aba945c</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderTransactionID</key>
                <value>79083085</value>
            </detail>
        </paymentDetails>
        <paymentAccount>
            <paymentAccountID>0</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.

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

DepositedByProviderSuccess state
RefusedByProviderPayment has been rejected by the provider.

Example handlePaymentStateChangedNotificationRequest:

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest 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>MyMerchantID</merchantID>
		<shopID>MyShopID</shopID>
		<paymentMethod>
			<key>276</key>
			<value>WebPayDeposit</value>
		</paymentMethod>
		<merchantTransactionID>f032acfc-4dc8-4039-99c6-a47739205a2d-26</merchantTransactionID>
		<paymentID>13985792-1203-491c-8a28-e7d58aba945c</paymentID>
		<userID>6895456</userID>
		<paymentProvider>
			<key>152</key>
			<value>Astropay</value>
		</paymentProvider>
		<amount currencyCode="CLP">10000</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>effd8564-cde9-4dfa-9b95-e4816abd051e</id>
			<definition>
				<key>30</key>
				<value>DepositedByProvider</value>
			</definition>
			<createdOn>2017-09-19T09:21:11.87</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyIntValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>true</isExecuted>
		<baseAmount currencyCode="EUR">13.4900</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>21088067</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>0</paymentAccountID>
		</paymentAccount>
	</payment>
</handlePaymentStateChangedNotificationRequest>

Testing instructions

Requirements before a initiate payment request:

Your account is associated with a Sandbox environment (we call TEST).
It's a Test environment available for integration development and testing which simulates the requests and transactions available in the platform. On the TEST environment no transactions will actually be processed.
A merchant and a shop registered with PXP Financial are needed for the payment request. Please request this if not already done.

The link to access the Mock is in the initiatePaymentResponse:

https://test2.backend.cqrpayments.com/WebMockProviders/AstropayFrontend/Index?x_invoice=ad5a8bfc-4e2c-44a4-9b72-2bb878a90c86

1589

To send a payment to the "DepositedByProvider" state:

  1. leave the password field as it is
  2. set the Result dropdown to "Success"
  3. Click the "Submit Confirmation" button

Expected result:

  1. redirected to the success page url provided in the initiatePaymentRequest:
    SuccessPageUrl
    http://success/?a=b&c=d
  2. shop notification received

To send a payment to the "RefusedByProvider" state

  1. leave the password field as it is
  2. set the Result dropdown to "Refused"
  3. Click the "Submit Confirmation" button

Expected result:

  1. redirected to the success page url provided in the initiatePaymentRequest:
    SuccessPageUrl
    http://success/?a=b&c=d
  2. shop notification received