Paypal Withdrawal

PayPal is a online wallet allowing customers to make instant financial transactions to other individuals and businesses world-wide.

The following method IDs are covered in this section:

ID

Name

Credit/Debit State

Reversal State

64

PayPalWithdrawal

ExecutedPyProvider (142)

Cancelled (113)

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

There are no specificPaymentData.

The ‘AccountNumber’, ‘EmailAddress’ parameters should be taken from a deposit notification message. See example of the notification message in Paypal Express Checkout Deposit.

Redirect Integration

Supported.

Backend2BackendIntegration

The ‘AccountNumber’, ‘EmailAddress’ parameters should be taken from a deposit notification message. See example of the notification message in Paypal Express Checkout Deposit.

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

key (value type, account type, required)

value

EMailAddress
(string, required)

The eMail address of the PayPal Express Checkout account.

*AccountNumber (string, required)

The account number of PayPal Express Checkout account.

Possible payment states in initiatePaymentResponse:

Payment States

Description

AuthorisedByProvider (13)

Pending OK state; Redirect user to pending SuccessPage .

Final confirmation about payment processing will come with a notification. Success state in the notification is ExecutedByProvider (142). Reversal state is Cancelled (113).

AuthoriseCommunicationErrorOccurred (336)

Error state; Communication error during authorization request to provider occurred. On resolving this error, payment could be moved manually to AuthorisedByProvider or to Cancelled state.

Cancelled (113)

Error state; The payment was cancelled

AuthoriseErrorReportedByProvider (14)

Error state; Error was reported by provider

BlockedByPaymentScoring (202)

Error state; blocked by the PXP Financial Risk System

RefusedByPaymentScoring (121)

Error state; Refused by the PXP Financial Risk System

Example initiatePaymentRequest:

<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>KalixaAcceptDemo</merchantID>
  <shopID>KalixaAcceptDemo</shopID>
  <merchantTransactionID>0e23b2f1-1d92-4ddd-8d43-9de4e77e279b</merchantTransactionID>
  <paymentMethodID>64</paymentMethodID>
  <amount currencyCode="EUR">100</amount>
  <userID>d48693ca-e96e-4ca1-9e01-035645a79300</userID>
  <userData></userData>
  <userIP>127.0.0.1</userIP>
  <userSessionID>6a956eae-d903-4a01-8170-20dae92673d1</userSessionID>
  <creationTypeID>1</creationTypeID>
  <paymentAccountID>4765ad36-93ea-4327-a82f-767eb6f04e5d</paymentAccountID>
  <paymentAccount>
    <specificPaymentAccountData>
      <data xsi:type="keyStringValuePair">
        <key>EmailAddress</key>
        <value>[email protected]</value>
      </data>
      <data xsi:type="keyStringValuePair">
        <key>AccountNumber</key>
        <value>234234234234</value>
      </data>
    </specificPaymentAccountData>
  </paymentAccount>
</initiatePaymentRequest>

Example initiatePaymentResponse:

<initiatePaymentResponse xmlns="http://www.cqrpayments.com/PaymentProcessing">
  <payment>
    <merchantID>KalixaAcceptDemo</merchantID>
    <shopID>KalixaAcceptDemo</shopID>
    <paymentMethod>
      <key>64</key>
      <value>PayPalWithdrawal</value>
    </paymentMethod>
    <merchantTransactionID>0e23b2f1-1d92-4ddd-8d43-9de4e77e279b</merchantTransactionID>
    <paymentID>a5afdad9-91b3-4222-b6c8-e187627639aa</paymentID>
    <userID>d48693ca-e96e-4ca1-9e01-035645a79300</userID>
    <paymentProvider>
      <key>56</key>
      <value>PayPal</value>
    </paymentProvider>
    <amount currencyCode="EUR">100</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>c8cd1ccf-a056-411d-b617-58b9f30a1c60</id>
      <definition>
        <key>13</key>
        <value>AuthorisedByProvider</value>
      </definition>
      <createdOn>2011-05-18T09:28:28.0867184Z</createdOn>
      <paymentStateDetails xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">100</baseAmount>
    <paymentDetails xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></paymentDetails>
  </payment>
</initiatePaymentResponse>

After the payment goes to AuthorisedByProvider, PXP is waiting for a notification from PayPal. Then the payment is queried and the following states are reached:

Payment States

Description

PendingOnProvider (120)

The withdrawal execution is pending on provider. PXP will wait for another notification from PayPal.

ExecutedByProvider (142)

Final execution state. Consider the withdrawal has successful. Note: Withdrawal returns are possible.

Cancelled (113)

The payment has been cancelled.

RefusedByProvider (100)

The payment has been refused by provider. (The payment can be moved automatically to Cancelled)

QueryPaymentStateCommunicationErrorOccurred (321)

The payment query has failed due to communication reasons. The payment query may be manually retriggered.

QueryPaymentStateErrorReportedByProvider (507)

The payment query has failed. This error is very rare and the query may be manually retriggered.

Notifications

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

Note: in the Merchant Notification message “AckCode” parameter (the response code returned by provider after authorization request) and “PaymentStatus” parameter (the response code returned by provider after payment confirmation) will be sent (in the paymentAccount.details collection the elements with “ackCode” and “paymentStatus” keys).

Example handlePaymentStateChangedNotificationRequest for Paypal Withdrawal in ExecutedByProvider state (without account data):

<?xml version="1.0" encoding="utf-8"?>
<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="q1:paymentWithPaymentAccount">
        <merchantID>KalixaAcceptDEMO</merchantID>
        <shopID>KalixaAcceptDEMO</shopID>
        <paymentMethod>
            <key>64</key>
            <value>PayPalWithdrawal</value>
        </paymentMethod>
        <merchantTransactionID>20141217_7</merchantTransactionID>
        <paymentID>b2f8c10b-272b-458d-9ebe-ff8d08e4a37f</paymentID>
        <userID>KalxiaTestUser_7</userID>
        <paymentProvider>
            <key>56</key>
            <value>PayPal</value>
        </paymentProvider>
        <amount currencyCode="EUR">30.0000</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>195.72.132.1</userIP>
        <state>
            <id>ed0ba2ab-9948-4476-a57f-6b6d7795dd1e</id>
            <definition>
                <key>142</key>
                <value>ExecutedByProvider</value>
            </definition>
            <createdOn>2014-12-17T09:00:14.033</createdOn>
            <paymentStateDetails xsi:nil="true" />
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">30.0000</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>714673</value>
            </detail>
            <detail xsi:type="keyIntValuePair">
                <key>PaymentScoring</key>
                <value>714673</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ShippingName</key>
                <value>Christiane Zepeda</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ShippingStreet</key>
                <value>Marxergasse 1B</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ShippingCity</key>
                <value>Vienna</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ShippingState</key>
                <value>Vienna</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ShippingPostalCode</key>
                <value>1030</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ShippingCountryCode2</key>
                <value>AT</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ShippingTelephoneNumber</key>
                <value> 123456789</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>PaypalWithdrawalAckCode</key>
                <value>Success</value>
            </detail>
        </paymentDetails>
        <paymentAccount>
            <paymentAccountID>57cbe7d9-166b-491e-a730-5435b5981ce8</paymentAccountID>
            <details>
                <detail xsi:type="keyStringValuePair">
                    <key>ackCode</key>
                    <value>Success</value>
                </detail>
            </details>
        </paymentAccount>
    </payment>
</handlePaymentStateChangedNotificationRequest>

Example handlePaymentStateChangedNotificationRequest for Paypal Withdrawal in ExecutedByProvider state (with account data):

<?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>B2BTestMerchant</merchantID>
    <shopID>150001</shopID>
    <paymentMethod>
      <key>64</key>
      <value>PayPalWithdrawal</value>
    </paymentMethod>
    <merchantTransactionID>6849ab72-38d9-4215-bf54-1e4a60dcd729</merchantTransactionID>
    <paymentID>dbe65715-57f5-4a1d-a50f-01c2da2cf058</paymentID>
    <userID>CQRB2BTestMerchantSystemUser</userID>
    <paymentProvider>
      <key>56</key>
      <value>PayPal</value>
    </paymentProvider>
    <amount currencyCode="EUR">15.0000</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>7387717b-df0f-489b-aaf9-2964c6d28315</id>
      <definition>
        <key>142</key>
        <value>ExecutedByProvider</value>
      </definition>
      <createdOn>2017-11-20T09:06:44.03</createdOn>
      <paymentStateDetails xsi:nil="true" />
    </state>
    <isExecuted>true</isExecuted>
    <baseAmount currencyCode="EUR">15.0000</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>21762792</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>fufvalnahkifgftpg</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>95d1a518-ad7a-4487-beec-cef2ba5ecd22</paymentAccountID>
      <details>
        <detail xsi:type="keyStringValuePair">
          <key>accountNumber</key>
          <value>S4SUH4HCFDD77</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>subAccountNumber</key>
          <value>[email protected]</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ackCode</key>
          <value>Success</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>paymentStatus</key>
          <value>Completed</value>
        </detail>
      </details>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>