Venmo Withdrawal (phase 2)

Venmo is a mobile payment service owned by PayPal. Venmo account holders can transfer funds to others via a mobile phone app; both the sender and receiver have to live in the U.S.
The following method IDs are covered in this section:

IDNameCredit/Debit State
423Venmo WithdrawalWithdrawnByProvider (20)

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

Payment flow

701

State diagram

669

Redirect Integration

Currently not supported.

Backend2Backend Integration

The following parameters can be provided in initiatePaymentRequest.specificPaymentData:

key (value type, account type, required)value
paymentDescription (string, required)Message to the customer that will be displayed on their statement.

Possible payment states in initiatePaymentResponse:

PaymentStatesDescription
PaymentScheduledForExecution (295)Pending state; PayPal withdrawal is queued for submittance to PayPal.

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>BrainTreeProviderTestShop</shopID>
    <merchantTransactionID>{{$guid}}</merchantTransactionID>
    <paymentMethodID>423</paymentMethodID>
    <amount currencyCode="USD">10.00</amount>
    <userID>cc1544de-7443-45f6-976e-d253e5</userID>
    <userIP>127.0.0.1</userIP>
    <userSessionID>7495c35f-3c55-4a08-a0a0-03f3ed917fbc</userSessionID>
    <creationTypeID>1</creationTypeID>
    <specificPaymentData>
        <data xsi:type="keyStringValuePair">
            <key>PaymentDescription</key>
            <value>ThisIsPaymentDescription</value>
        </data>
    </specificPaymentData>
 <paymentAccountID>4af7cfcb-3df9-4ad5-bb82-614a248cd2d3</paymentAccountID>
</initiatePaymentRequest>

Example initiatePaymentResponse (for state PaymentScheduledForExecution):

<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>B2BTestMerchant</merchantID>
        <shopID>BrainTreeProviderTestShop</shopID>
        <paymentMethod>
            <key>423</key>
            <value>Venmo Withdrawal</value>
        </paymentMethod>
        <merchantTransactionID>4071e5b8-7ae4-4c9a-bb88-22746a52f654</merchantTransactionID>
        <paymentID>7edef957-122e-415b-a0dc-36d942cc5555</paymentID>
        <userID>cc1544de-7443-45f6-976e-d253e5</userID>
        <paymentProvider>
            <key>56</key>
            <value>PayPal</value>
        </paymentProvider>
        <amount currencyCode="USD">10.00</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>f37e19f9-75da-4dab-a757-3b3ff6571e5c</id>
            <definition>
                <key>295</key>
                <value>PaymentScheduledForExecution</value>
            </definition>
            <createdOn>2022-03-29T15:31:47.0914263Z</createdOn>
            <paymentStateDetails>
                <detail xsi:type="keyStringValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">7.51</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>1814955</value>
            </detail>
        </paymentDetails>
        <paymentAccount>
            <paymentAccountID>4af7cfcb-3df9-4ad5-bb82-614a248cd2d3</paymentAccountID>
        </paymentAccount>
    </payment>
</initiatePaymentResponse>

After the payment goes to PaymentScheduledForExecution, the payment will reach the following states. The merchant will receive a handlePaymentStateChangedNotification for the state.

Payment StatesDescriptionTesting with mock
WithdrawnByProvider (2)Final execution state. Consider the withdrawal has successful.

Note: Withdrawal returns are possible.
RefusedByProvider (100)The payment has been refused by provider.

Notifications

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

Example handlePaymentStateChangedNotificationRequest for Venmo Withdrawal in state WithdrawnByProvider:

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BrainTreeTestShop</shopID>
    <paymentMethod>
      <key>423</key>
      <value>Venmo Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>235c16b1-4b33-4161-a9cc-7c4a0df012fa</merchantTransactionID>
    <paymentID>6e03bb8f-2d98-478e-a027-4b1ca21082f7</paymentID>
    <userID>cc1544de-7443-45f6-976e-d253e5</userID>
    <paymentProvider>
      <key>56</key>
      <value>PayPal</value>
    </paymentProvider>
    <amount currencyCode="EUR">11.1100</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>3c61282e-8093-4de2-b437-6cfe00310a3b</id>
      <definition>
        <key>20</key>
        <value>WithdrawnByProvider</value>
      </definition>
      <createdOn>2022-04-01T06:21:57.553</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderStatusDescription</key>
          <value>Test</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>true</isExecuted>
    <baseAmount currencyCode="EUR">11.1100</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40961282</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>ca41ffdd-7476-46af-9620-e9c22bbc173e</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>PaypalWithdrawalAckCode</key>
        <value>PENDING</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>PaypalWithdrawalPaymentStatus</key>
        <value>SUCCESS</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderOrderID</key>
        <value>00fbdc0e-2e23-43db-a36c-f881c278b400</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>1e65f98a-a11d-4e89-9583-925870659e63</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

The following payment details are passed on the notification for state WithdrawnByProvider:

PaymentDetailDescription
ProviderExternalIDPXP Financial´s transaction ID that is sent to PayPal
ProviderTransactionIDThe transaction ID from PayPal, typically a value such as "0C413693MN970190K".
PayPalWithdrawalAckCodeTransaction status of payout batch. The value will be set to PENDING.
PayPalWithdrawalPaymentStatusThe transaction_status of the payout-item is stored in this detail. Possible values on state WithdrawnByProvider are:
- SUCCESS (Funds have been credited to the recipient’s account)
- UNCLAIMED (The recipient for this payout does not have a Venmo account. A link to sign up for a Venmo account was sent to the recipient. However, if the recipient does not claim this payout within 30 days, the funds are returned to the merchant´s account.) This response is very rare.
ProviderOrderIDPayPal´s payout item ID.

The following payment state details are passed on the notification for state WithdrawnByProvider:

PaymentDetailDescription
ProviderStatusDescriptionSummary field from the webhook notification from PayPal with the following text:
- "A payout item has succeeded" (for event type SUCCESS) or
- "A payout item is unclaimed" (for event type UNCLAIMED).

Example handlePaymentStateChangedNotificationRequest for Venmo Withdrawal in state RefusedByProvider:

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BrainTreeTestShop</shopID>
    <paymentMethod>
      <key>423</key>
      <value>Venmo Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>3054af9c-6163-430d-a5f4-5410e1c7e0cc</merchantTransactionID>
    <paymentID>81e67820-ae96-4e49-aff5-952fb06d9748</paymentID>
    <userID>cc1544de-7443-45f6-976e-d253e5</userID>
    <paymentProvider>
      <key>56</key>
      <value>PayPal</value>
    </paymentProvider>
    <amount currencyCode="GBP">1000.0000</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>9eceed27-2e79-4c00-bff2-89bf65fde101</id>
      <definition>
        <key>100</key>
        <value>RefusedByProvider</value>
      </definition>
      <createdOn>2022-04-01T06:28:39.3</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseCode</key>
          <value>RECEIVER_COUNTRY_NOT_ALLOWED</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseMessage</key>
          <value>Receiver's address is in a non-receivable country or a PayPal zero country. Test Issue 01;Test Issue 02</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderStatusDescription</key>
          <value>Test</value>
        </detail>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">1156.8700</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40961283</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>439c72f0-8e5f-46ef-ab5a-5180aebc5f0d</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>PaypalWithdrawalPaymentStatus</key>
        <value>FAILED</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderOrderID</key>
        <value>6519c276-06cd-4dc6-b3f0-422679483aa2</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>1e65f98a-a11d-4e89-9583-925870659e63</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

The following payment details are passed on the notification for state RefusedByProvider.

PaymentDetailDescription
ProviderExternalIDPXP Financial´s transaction ID that is sent to PayPal
ProviderTransactionIDThe transaction ID from PayPal, typically a value such as "0C413693MN970190K".

Note: A transactionID is not returned if the receiver account is invalid.

When that happens no transaction ID will be returned because the transaction is rejected.

A payment with a transactionID was failed due to some valid reason such as risk, locked/restricted account, etc, which is why a transactionID was returned by PayPal.
PaypalWithdrawalAckCodeTransaction status of payout batch. The value will be set to PENDING.
PayPalWithdrawalPaymentStatusThe transaction_status of the payout-item is stored in this detail. Possible values on state RefusedByProvider are:
- FAILED (This payout request has failed, so funds were not deducted from the sender’s account.)
- DENIED (The payout request was refused by PayPal.)
- BLOCKED (The payout request has been blocked by PayPal).
ProviderOrderIDPayPal´s payout item ID.

The following payment state details are passed on the notification for state RefusedByProvider:

PaymentDetailDescription
ProviderStatusDescriptionSummary field from the webhook notification from PayPal with the following text:
- "A payout item has failed" (for event type FAILED) or
- "A payout item was denied" (for event type DENIED)
- "A payout item was blocked" (for event type BLOCKED)
ProviderResponseCodeAn error name that was returned by PayPal, e.g. "GAMER_FAILED_FUNDING_SOURCE_CHECK"
ProviderResponseMessageA error message that was returned by PayPal, eg. "The funding source for this gamer is ineligible to make payments."

📘

PayPal error

For more information on PayPal payout errors see here, then click on "Payouts" on the left, and select "Error Messages".

Venmo Withdrawal Return

When a Venmo Withdrawal Return is parsed out of the settlement report, a new transaction of payment method VenmoWithdrawalReturn is created.

The following handlePaymentStateChanged notification will be sent to merchant:

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BrainTreeTestShop</shopID>
    <paymentMethod>
      <key>430</key>
      <value>Venmo Withdrawal Return</value>
    </paymentMethod>
    <merchantTransactionID>df961df6-f267-48cd-9b43-335148eba0c7</merchantTransactionID>
    <paymentID>493b021c-7dc4-4a11-8cbc-6e7390be9b34</paymentID>
    <userID>cc1544de-7443-45f6-976e-d253e5</userID>
    <paymentProvider>
      <key>56</key>
      <value>PayPal</value>
    </paymentProvider>
    <amount currencyCode="EUR">40.0000</amount>
    <creationType>
      <key>6</key>
      <value>Provider</value>
    </creationType>
    <state>
      <id>4965cdcf-925b-427a-ba26-0072b3b49d59</id>
      <definition>
        <key>279</key>
        <value>ReturnedByProvider</value>
      </definition>
      <createdOn>2022-04-14T14:27:38.8</createdOn>
      <paymentStateDetails xsi:nil="true" />
    </state>
    <isExecuted>true</isExecuted>
    <baseAmount currencyCode="EUR">40.0000</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>f79d258a-5b26-4e66-98cc-6afa2f17e0c4</value>
      </detail>
      <detail xsi:type="keyIntValuePair">
        <key>SettlementCurrencyCode</key>
        <value>978</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>4H487488FD677074J</value>
      </detail>
      <detail xsi:type="keyDecimalValuePair">
        <key>SettlementAmount</key>
        <value>40.000000000</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>OriginalPaymentID</key>
        <value>59c78e8e-2b55-4397-8bd7-bd70e0ac7be7</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>OriginalPaymentMerchantTransactionID</key>
        <value>df961df6-f267-48cd-9b43-335148eba0c7</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>OriginalPaymentMethodID</key>
        <value>423</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>OriginalPaymentMethodName</key>
        <value>Venmo Withdrawal</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>1e65f98a-a11d-4e89-9583-925870659e63</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

Mock usage

A payment going to state InitiateErrorReportedByProvider is simulated with amount 113.01.

initiatePaymentRequest:

<?xml version="1.0" encoding="utf-8"?>
    <initiatePaymentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BrainTreeTestShop</shopID>
    <merchantTransactionID>f2067620-6701-4dee-8225-657ed0018f53</merchantTransactionID>
    <paymentMethodID>423</paymentMethodID>
    <amount currencyCode="USD">113.01</amount>
    <userID>cc1544de-7443-45f6-976e-d253e</userID>
    <userData>
        <username>cc1544de-7443-45f6-976e-d253e5</username>
        <firstname xsi:nil="true" />
        <lastname xsi:nil="true" />
        <currencyCode xsi:nil="true" />
        <languageCode xsi:nil="true" />
        <email xsi:nil="true" />
        <address xsi:nil="true" />
        <gender>Male</gender>
        <identificationNumberType xsi:nil="true" />
        <drivingLicenseNumber xsi:nil="true" />
        <drivingLicenseIssuingState xsi:nil="true" />
    </userData>
    <userIP>127.0.0.1</userIP>
    <userSessionID>767a6daf-26bb-4f52-a7cc-99aa735881cf</userSessionID>
    <creationTypeID>1</creationTypeID>
    <specificPaymentData>
        <data xsi:type="keyStringValuePair">
            <key>PaymentDescription</key>
            <value>Test description</value>
        </data>
    </specificPaymentData>
    <paymentAccountID>e8c78a3f-6ff1-4a4f-850a-8ae1ca241c03</paymentAccountID>
</initiatePaymentRequest>

initiatePaymentResponse:

The initiatePaymentResponse will always have the state PaymentScheduledForExecution.

A payment going to state InitiateProviderCommunicationErrorOccurred can be simulated with amount 113.04.

initiatePaymentRequest:

<?xml version="1.0" encoding="utf-8"?>
    <initiatePaymentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BrainTreeTestShop</shopID>
    <merchantTransactionID>dad06832-a836-4321-9021-ca0080a29275</merchantTransactionID>
    <paymentMethodID>423</paymentMethodID>
    <amount currencyCode="USD">113.04</amount>
    <userID>cc1544de-7443-45f6-976e-d253e</userID>
    <userData>
        <username>cc1544de-7443-45f6-976e-d253e5</username>
        <firstname xsi:nil="true" />
        <lastname xsi:nil="true" />
        <currencyCode xsi:nil="true" />
        <languageCode xsi:nil="true" />
        <email xsi:nil="true" />
        <address xsi:nil="true" />
        <gender>Male</gender>
        <identificationNumberType xsi:nil="true" />
        <drivingLicenseNumber xsi:nil="true" />
        <drivingLicenseIssuingState xsi:nil="true" />
    </userData>
    <userIP>127.0.0.1</userIP>
    <userSessionID>767a6daf-26bb-4f52-a7cc-99aa735881cf</userSessionID>
    <creationTypeID>1</creationTypeID>
    <specificPaymentData>
        <data xsi:type="keyStringValuePair">
            <key>PaymentDescription</key>
            <value>Test description</value>
        </data>
    </specificPaymentData>
    <paymentAccountID>e8c78a3f-6ff1-4a4f-850a-8ae1ca241c03</paymentAccountID>
</initiatePaymentRequest>

A payment going to state InitiateErrorReportedByProvider can be simulate with the amount 113.05. It will have a value PayPalWithdrawalAckCode as we will have a batch status from PayPal at that moment.

initiatePaymentRequest:

<?xml version="1.0" encoding="utf-8"?>
    <initiatePaymentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BrainTreeTestShop</shopID>
    <merchantTransactionID>c9d568f7-34b1-4a19-8395-aabcc6db3465</merchantTransactionID>
    <paymentMethodID>423</paymentMethodID>
    <amount currencyCode="USD">113.05</amount>
    <userID>cc1544de-7443-45f6-976e-d253e</userID>
    <userData>
        <username>cc1544de-7443-45f6-976e-d253e5</username>
        <firstname xsi:nil="true" />
        <lastname xsi:nil="true" />
        <currencyCode xsi:nil="true" />
        <languageCode xsi:nil="true" />
        <email xsi:nil="true" />
        <address xsi:nil="true" />
        <gender>Male</gender>
        <identificationNumberType xsi:nil="true" />
        <drivingLicenseNumber xsi:nil="true" />
        <drivingLicenseIssuingState xsi:nil="true" />
    </userData>
    <userIP>127.0.0.1</userIP>
    <userSessionID>767a6daf-26bb-4f52-a7cc-99aa735881cf</userSessionID>
    <creationTypeID>1</creationTypeID>
    <specificPaymentData>
        <data xsi:type="keyStringValuePair">
            <key>PaymentDescription</key>
            <value>Test description</value>
        </data>
    </specificPaymentData>
    <paymentAccountID>e8c78a3f-6ff1-4a4f-850a-8ae1ca241c03</paymentAccountID>
</initiatePaymentRequest>

A payment will go to state InitiatedByProvider with any other amount.

How to simulate Payments with status SUCCESS/ UNCLAIMED/ FAILED/ DENIED/ BLOCKED:

Listener: https://test.backend.cqrpayments.com/WebMockProviders/ProviderMock/56/notification

Sample JSON to be sent to listener:

{
    "transaction_id": "ab9a3f20-0c6f-4de4-8dcc-06e38413455e", -> generate new GUID
    "transaction_status": "FAILED", -> here can be SUCESS/UNCLAIMED/FAILED/DENIED/BLOCKED
    "sender_item_id": "40382689", -> ProviderExternalID
    "payout_item_id": "3b0956b7-646b-48a4-92d1-d08cc19d19e9", -> generate new GUID
    "currency": "EUR", -> Payment currency
    "amount": "11.11", -> Payment amount
    "certificateUrl": "https://api.test.kalixa.com/WebMockProviders/ProviderMock/56/payoutsNotificationCertificate",   
    "notificationUrl": "https://api.test2.kalixa.com/ProviderListeners/providers/56/Venmo-PayoutsV1-Item/notifications"
}

Payment with multiple query issues (any amount):

  1. Initiate a payment with the mock with any amount:
  2. Send request to the mock
{
    "transaction_id": "ab9a3f20-0c6f-4de4-8dcc-06e38413455e",
    "transaction_status": "FAILED",
    "sender_item_id": "{ProviderExternalID}",
    "payout_item_id": "{ProviderExternalID}",
    "currency": "{CurrencyCode}",
    "amount": "{Amount}",
    "certificateUrl": "https://api.test.kalixa.com/WebMockProviders/ProviderMock/56/payoutsNotificationCertificate",
    "notificationUrl": "https://api.test2.kalixa.com/ProviderListeners/providers/56/Venmo-PayoutsV1-Item/notifications"
}
  1. This results in the following notification being sent to the merchant:
<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BrainTreeTestShop</shopID>
    <paymentMethod>
      <key>423</key>
      <value>Venmo Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>9f44e134-4712-4e61-b16a-ce327e0c3a9c</merchantTransactionID>
    <paymentID>221f8a91-6727-4023-9580-580f2c528809</paymentID>
    <userID>cc1544de-7443-45f6-976e-d253e</userID>
    <paymentProvider>
      <key>56</key>
      <value>PayPal</value>
    </paymentProvider>
    <amount currencyCode="USD">14.0100</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>0aa3322e-515b-4dc6-9a8b-1e1811cc7ef3</id>
      <definition>
        <key>100</key>
        <value>RefusedByProvider</value>
      </definition>
      <createdOn>2022-03-17T15:20:15.78</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseCode</key>
          <value>RECEIVER_COUNTRY_NOT_ALLOWED</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseMessage</key>
          <value>Receiver's address is in a non-receivable country or a PayPal zero country. Test Issue 01;Test Issue 02</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderStatusDescription</key>
          <value>Test</value>
        </detail>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">10.5300</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40727656</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>ab9a3f20-0c6f-4de4-8dcc-06e3841345b9</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>PaypalWithdrawalAckCode</key>
        <value>PENDING</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>PaypalWithdrawalPaymentStatus</key>
        <value>FAILED</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderOrderID</key>
        <value>3b0956b7-646b-48a4-92d1-d08cc19d19b9</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>e8c78a3f-6ff1-4a4f-850a-8ae1ca241c03</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

Payout with query error (114.01):

  1. Initiate a payment with the mock with amount 114.01
  2. Send a request to the mock
{
    "transaction_id": "ab9a3f20-0c6f-4de4-8dcc-06e38413455e",
    "transaction_status": "FAILED",
    "sender_item_id": "{ProviderExternalID}",
    "payout_item_id": "{ProviderExternalID}",
    "currency": "{CurrencyCode}",
    "amount": "114.01",
    "certificateUrl": "https://api.test.kalixa.com/WebMockProviders/ProviderMock/56/payoutsNotificationCertificate",
    "notificationUrl": "https://api.test2.kalixa.com/ProviderListeners/providers/56/Venmo-PayoutsV1-Item/notifications"
}
  1. This results in the following notification being sent to the merchant:
<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BrainTreeTestShop</shopID>
    <paymentMethod>
      <key>423</key>
      <value>Venmo Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>60fc33c3-ce70-4bdb-ad43-79d519bc3035</merchantTransactionID>
    <paymentID>17dcc3cd-a95e-42b3-9da9-69cf07b8964a</paymentID>
    <userID>cc1544de-7443-45f6-976e-d253e</userID>
    <paymentProvider>
      <key>56</key>
      <value>PayPal</value>
    </paymentProvider>
    <amount currencyCode="USD">114.0100</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>fb7bfca2-a1fb-4324-96fa-80d56a5cf5e0</id>
      <definition>
        <key>100</key>
        <value>RefusedByProvider</value>
      </definition>
      <createdOn>2022-03-17T15:19:59.153</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseMessage</key>
          <value>Unknown</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderStatusDescription</key>
          <value>Test</value>
        </detail>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">85.6600</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40727655</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>ab9a3f20-0c6f-4de4-8dcc-06e3841345b8</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>PaypalWithdrawalAckCode</key>
        <value>PENDING</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>PaypalWithdrawalPaymentStatus</key>
        <value>FAILED</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderOrderID</key>
        <value>3b0956b7-646b-48a4-92d1-d08cc19d19b8</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>e8c78a3f-6ff1-4a4f-850a-8ae1ca241c03</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

Payout with query error (114.02):

  1. Initiate a payment with the mock with amount 114.02
  2. Send the following request to the mock:
{
    "transaction_id": "ab9a3f20-0c6f-4de4-8dcc-06e38413455e",
    "transaction_status": "FAILED",
    "sender_item_id": "{ProviderExternalID}",
    "payout_item_id": "{ProviderExternalID}",
    "currency": "{CurrencyCode}",
    "amount": "114.02",
    "certificateUrl": "https://api.test.kalixa.com/WebMockProviders/ProviderMock/56/payoutsNotificationCertificate",
    "notificationUrl": "https://api.test2.kalixa.com/ProviderListeners/providers/56/Venmo-PayoutsV1-Item/notifications"
}
  1. This results in the following notification being sent to the merchant:
<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BrainTreeTestShop</shopID>
    <paymentMethod>
      <key>423</key>
      <value>Venmo Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>6c6dd1d1-952c-4ca9-9912-cad557f504ac</merchantTransactionID>
    <paymentID>4fde0dbd-c61f-47fa-b90c-6e96e514225d</paymentID>
    <userID>cc1544de-7443-45f6-976e-d253e</userID>
    <paymentProvider>
      <key>56</key>
      <value>PayPal</value>
    </paymentProvider>
    <amount currencyCode="USD">114.0200</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>bde041f4-8a57-43a1-80bf-cdcd2d4c16a6</id>
      <definition>
        <key>100</key>
        <value>RefusedByProvider</value>
      </definition>
      <createdOn>2022-03-17T15:19:01.18</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseMessage</key>
          <value>Unknown</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderStatusDescription</key>
          <value>Test</value>
        </detail>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">85.6700</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40727654</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>ab9a3f20-0c6f-4de4-8dcc-06e3841345b7</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>PaypalWithdrawalAckCode</key>
        <value>PENDING</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>PaypalWithdrawalPaymentStatus</key>
        <value>FAILED</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderOrderID</key>
        <value>3b0956b7-646b-48a4-92d1-d08cc19d19b7</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>e8c78a3f-6ff1-4a4f-850a-8ae1ca241c03</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>