PayWithMyBankWithdrawal

PayWithMyBank withdrawals is the withdrawal option, related to PayWithMyBankDeposit, a online banking based payment solution for the US market.

The provider of PayWithMyBank is Trustly.

The following method IDs are covered in this section:

ID

Name

Credit/Debit State

360

PayWithMyBankWithdrawal

WithdrawnByProvider

361

PayWithMyBankWithdrawalReturn

ReturnedByProvider

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

Redirect Integration

Payment Method PayWithMyBankWithdrawal is also available in the Checkout.

Example getRedirectData request, redirection to the Selection page (=directly to PXP Checkout selection page):

<getRedirectDataRequest 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>
    <redirectParameters xsi:type="paymentMethodSelectionWithDetailsRedirectParameters">
        <shopID>{{shop}}</shopID>
        <httpMethod>GET</httpMethod>
        <returnUrl>http://return</returnUrl>
        <languageCode>en</languageCode>
        <currencyCode>usd</currencyCode>
        <countryCode>us</countryCode>
        <additionalDetails>
            <detail xsi:type="keyStringValuePair">
                <key>Description</key>
                <value>some description</value>
            </detail>
        </additionalDetails>
        <user>
            <id>hc20220202154907</id>
         </user>
        <merchantTransactionID>{{checkoutMerchantTransactionID}}</merchantTransactionID>
        <grossAmount>100.00</grossAmount>
        <minPaymentLimitAmount>10</minPaymentLimitAmount>
        <maxPaymentLimitAmount>3000</maxPaymentLimitAmount>
        <expirationTimeSpanInSeconds>3600</expirationTimeSpanInSeconds>
        <successUrl>http://success</successUrl>
        <pendingUrl>http://pending</pendingUrl>
        <errorUrl>http://error</errorUrl>
        <cancelUrl>http://cancel</cancelUrl>
        <refusedUrl>http://refused</refusedUrl>
        <paymentDirection>Withdrawal</paymentDirection>
    </redirectParameters>
</getRedirectDataRequest>

Example getRedirectData request, redirection to the Detail page (=directly to PXP Checkout detail page):

<getRedirectDataRequest 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>
    <redirectParameters xsi:type="paymentMethodDetailsRedirectParameters">
        <shopID>{{shop}}</shopID>
        <httpMethod>GET</httpMethod>
        <returnUrl>http://return</returnUrl>
        <languageCode>en</languageCode>
        <currencyCode>usd</currencyCode>
        <countryCode>us</countryCode>
        <additionalDetails>
             <detail xsi:type="keyStringValuePair">
                <key>Description</key>
                <value>my payment description</value>
            </detail>
        </additionalDetails>
         <user>
            <id>{{newUserID}}</id>
            <username>{{newUserName}}</username>
            <firstname>Sherlock</firstname>
            <lastname>Holmes</lastname>
            <currencyCode>USD</currencyCode>
            <languageCode>EN</languageCode>
            <email>{{newUserEmail}}</email>
             <address>
            <street>Geneva Street</street>
               <houseNumber>5</houseNumber>
               <postalCode>61259</postalCode>
               <city>Illinois City</city>
               <state>IL</state>
               <countryCode2>US</countryCode2>
               <telephoneNumber>{{phoneNumber}}</telephoneNumber>
            </address>
             <dateOfBirth>1985-10-10T00:00:00</dateOfBirth>
            <gender>Female</gender>
         </user>
        <merchantTransactionID>{{checkoutMerchantTransactionID}}</merchantTransactionID>
        <grossAmount>100.00</grossAmount>
        <minPaymentLimitAmount>10</minPaymentLimitAmount>
        <maxPaymentLimitAmount>3000</maxPaymentLimitAmount>
        <expirationTimeSpanInSeconds>3600</expirationTimeSpanInSeconds>
       <successUrl>http://www.google.com/result?param1=success?status=success</successUrl>
        <pendingUrl>http://www.google.com/result?param1=pending?status=pending</pendingUrl>
        <errorUrl>http://www.google.com/result?param1=error?status=error</errorUrl>
        <cancelUrl>http://www.google.com/result?param1=cancel?status=cancel</cancelUrl>
        <refusedUrl>http://www.google.com/result?param1=refuse?status=refuse</refusedUrl>
        <paymentMethodID>360</paymentMethodID>
        <isPaymentMethodChangeAllowed>false</isPaymentMethodChangeAllowed>
    </redirectParameters>
</getRedirectDataRequest>

**Example getRedirectDataResponse"

<getRedirectDataResponse xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <redirectData>
        <redirectUrl>https://payments.test.kalixa.com/Checkout/PaymentMethods/253?requestData=2faif3jjdnxcl5ohpfpoqfwo_e8d221dd-c9fe-482c-8ef1-78e380c42971</redirectUrl>
    </redirectData>
</getRedirectDataResponse>

Customer using PayWithMyBank payment method to Withdraw funds

  • Customer is redirected to the PXP Checkout. Bank Account associated with PayWithMyBank is displayed to the customer.
  • Customer initiates a payment using the Refund Now button available on the PXP Checkout screen.
  • PXP backend will send a notification to the merchant to approve the Withdrawal transaction. It is a synchronous callback to check with the merchant if the withdrawal is allowed or not.
  • To reject, Merchant needs to respond with ResultCode other than 0. Customer is redirected to the error url provided in the GetRedirectDataRequest.
  • To approve, Merchant needs to respond with ResultCode=0. Once the confirmation with ResultCode=0 is received from the merchant then PXP checkout sends the payment information to PayWithMyBank.
  • PayWithMyBank processes the payment and send a notification to the PXP backend when processing is completed
  • Customer is redirected to the Pending page url which was provided by the merchant in the GetRedirectDataRequest. Payment status will be "PendingOnProvider"
  • In case of RefusedByProvider/WithdrawErrorReportedByProvider/WithdrawCommunicationErrorOccurred state of the payment - the customer is redirected to the merchant error page.
  • As soon as payments is processed by provider notification the merchant is notified about the last state of the payment.

The below screenshot shows an example of the payment selection page with PayWithMyBank listed as one of the payment method.

The below screenshot shows an example of the payment details page with already previously used payment account by the customer.

Backend2BackendIntegration

This payment method requires a previous deposit with PayWithMyBank. A valid bank token is not mandatory.

Flow overview

To be added later.

Request/Response

Example initiatePaymentRequest:

<!-- ###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>XXXXXXX</merchantID>
    <shopID>XXXXXXX</shopID>
    <merchantTransactionID>XXXXXXX</merchantTransactionID>
    <paymentMethodID>360</paymentMethodID>
    <amount currencyCode="USD">13.95</amount>
    <userID>bfda221a-0f2d-44aa-aacf-7ca13f</userID>
    <userData>
        <username>bfda221a-0f2d-44aa-aacf-7ca13f</username>
        <address>
            <countryCode2>US</countryCode2>
        </address>
    </userData>
    <userIP>127.0.0.1</userIP>
    <userSessionID>819e56f2-4261-4c8e-93b7-bb0d64227ab3</userSessionID>
    <creationTypeID>1</creationTypeID>
    <paymentAccountID>XXXXXXXXXXXXXXXXXXXX</paymentAccountID>
</initiatePaymentRequest>

Example initiatePaymentResponse:

<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>XXXXXXXXXXX</merchantID>
        <shopID>XXXXXXXXXXXX</shopID>
        <paymentMethod>
            <key>360</key>
            <value>PayWithMyBankWithdrawal</value>
        </paymentMethod>
        <merchantTransactionID>XXXXXXXXXXXXXXXXXX</merchantTransactionID>
        <paymentID>ebb16795-fa9a-4318-8e52-c2c37007d6c0</paymentID>
        <userID>bfda221a-0f2d-44aa-aacf-7ca13f</userID>
        <paymentProvider>
            <key>185</key>
            <value>PayWithMyBank</value>
        </paymentProvider>
        <amount currencyCode="USD">13.95</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>054e2cd9-ea24-443c-a4be-4513797c2b3e</id>
            <definition>
                <key>120</key>
                <value>PendingOnProvider</value>
            </definition>
            <createdOn>2019-11-29T13:16:05.4276052Z</createdOn>
            <paymentStateDetails>
                <detail xsi:type="keyStringValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">10.48</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderTransactionID</key>
                <value>1003450711</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>1814</value>
            </detail>
        </paymentDetails>
        <paymentAccount>
            <paymentAccountID>XXXXXXXXXXXXXXXX</paymentAccountID>
        </paymentAccount>
    </payment>
</initiatePaymentResponse>

Possible payment state in the initiatePaymentResponse:

Payment States

Description

PendingOnProvider (120)

The payment is being processed by the provider. The payment is not yet successful.

WithdrawErrorReportedByProvider (21)

The provider has reported an error while processing the withdrawal request. Details are logged in the fields ProviderErrorCode and ProviderErrorMessage and can be notified to the merchant.

WithdrawCommunicationErrorOccurred (576)

A communication error has occurred while the withdrawal request has been processed with provider. Please note that the withdrawal payment can still be successful and that it will be reconciled later.

Later, PXP receives a notification from provider and then moves the payment to it´s final state.

Payment State

Description

WithdrawnByProvider (35)

The payment was successfully processed by the provider. Additionally, a ProviderStatusCode and a ProviderStatusDescription was logged.

RefusedByProvider (100)

The withdrawal payment was rejected by the provider. Details were logged in the fields ProviderStatusCode and ProviderStatusDescription.

For the notification sent in state WithdrawnByProvider check the sample at the end of this page.

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 a successful payment:

<?xml version="1.0" encoding="utf-8"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
    <payment xsi:type="paymentWithPaymentAccount">
        <merchantID>XXXXXX</merchantID>
        <shopID>XXXXX</shopID>
        <paymentMethod>
            <key>360</key>
            <value>PayWithMyBankWithdrawal</value>
        </paymentMethod>
        <merchantTransactionID>5669b601-6ade-4007-b8fc-db9388d8cd4c</merchantTransactionID>
        <paymentID>5d038275-6edc-43f4-998c-a4a8fdff0108</paymentID>
        <userID>dc63f2a6-16ab-4a9e-8643-771c28</userID>
        <paymentProvider>
            <key>185</key>
            <value>PayWithMyBank</value>
        </paymentProvider>
        <amount currencyCode="USD">8.3600</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>e5086ed6-4ce9-45dc-8914-f08087de99ab</id>
            <definition>
                <key>20</key>
                <value>WithdrawnByProvider</value>
            </definition>
            <createdOn>2019-11-29T13:07:50.872063Z</createdOn>
            <paymentStateDetails>
                <detail xsi:type="keyStringValuePair">
                    <key>ProviderStatusCode</key>
                    <value>AC105</value>
                </detail>
                <detail xsi:type="keyStringValuePair">
                    <key>ProviderStatusDescription</key>
                    <value>Processed</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>true</isExecuted>
        <baseAmount currencyCode="EUR">6.2800</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>1807</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderTransactionID</key>
                <value>1002636638</value>
            </detail>
        </paymentDetails>
        <paymentAccount>
            <paymentAccountID>0</paymentAccountID>
        </paymentAccount>
    </payment>
</handlePaymentStateChangedNotificationRequest>

Example handlePaymentStateChangedNotificationRequest for a unsuccessful payment:

<?xml version="1.0" encoding="utf-8"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
    <payment xsi:type="paymentWithPaymentAccount">
        <merchantID>XXXXXX</merchantID>
        <shopID>XXXXXX</shopID>
        <paymentMethod>
            <key>360</key>
            <value>PayWithMyBankWithdrawal</value>
        </paymentMethod>
        <merchantTransactionID>c7155fb5-b470-44f4-b4cf-df248e4a0cb5</merchantTransactionID>
        <paymentID>614439e9-4a05-4fbc-9502-588213379891</paymentID>
        <userID>09684b4e-e014-4b30-8259-1256b4</userID>
        <paymentProvider>
            <key>185</key>
            <value>PayWithMyBank</value>
        </paymentProvider>
        <amount currencyCode="USD">7.2700</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>633238c3-929d-4dca-9dac-80234ba2195e</id>
            <definition>
                <key>21</key>
                <value>WithdrawErrorReportedByProvider</value>
            </definition>
            <createdOn>2019-11-29T13:07:48.187</createdOn>
            <paymentStateDetails>
                <detail xsi:type="keyStringValuePair">
                    <key>ProviderErrorMessage</key>
                    <value>Internal error. An internal error occurred when trying to process the request.</value>
                </detail>
                <detail xsi:type="keyStringValuePair">
                    <key>ProviderErrorCode</key>
                    <value>100</value>
                </detail>
                <detail xsi:type="keyIntValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">5.4600</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>1806</value>
            </detail>
        </paymentDetails>
        <paymentAccount>
            <paymentAccountID>23c18790-278f-4fd0-974c-0bf0727d34e1</paymentAccountID>
        </paymentAccount>
    </payment>
</handlePaymentStateChangedNotificationRequest>

PayWithMyBankWithdrawalReturns

When a PayWithMyBankWithdrawal is returned by the beneficiary´s bank, the provider sends a notification to PXP and a payment of payment method PayWithMyBankWithdrawalReturn is created in state ReturnedByProvider.

The following notification is sent:

<?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>150001</shopID>
        <paymentMethod>
            <key>361</key>
            <value>PayWithMyBankWithdrawalReturn</value>
        </paymentMethod>
        <merchantTransactionID>e4ea499b-fddd-4d60-8034-14ceb28d2c8e</merchantTransactionID>
        <paymentID>46250a7a-edb2-4185-83f7-7705a0254c3b</paymentID>
        <userID>6e59bd0a-473c-47e9-b50a-b61908</userID>
        <paymentProvider>
            <key>185</key>
            <value>PayWithMyBank</value>
        </paymentProvider>
        <amount currencyCode="USD">10.5400</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <state>
            <id>6f99938b-10c3-4e5b-adbe-fbc36458ce77</id>
            <definition>
                <key>279</key>
                <value>ReturnedByProvider</value>
            </definition>
            <createdOn>2019-12-03T14:51:31.037</createdOn>
            <paymentStateDetails xsi:nil="true" />
        </state>
        <isExecuted>true</isExecuted>
        <baseAmount currencyCode="EUR">7.9200</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>058beb4d-f8ee-4d55-8a83-a4c570cc0078</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>OriginalPaymentID</key>
                <value>f7186c1b-29a7-4fae-9e94-d69163acd7d9</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>OriginalPaymentMerchantTransactionID</key>
                <value>e4ea499b-fddd-4d60-8034-14ceb28d2c8e</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>OriginalPaymentMethodID</key>
                <value>360</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>OriginalPaymentMethodName</key>
                <value>PayWithMyBankWithdrawal</value>
            </detail>
        </paymentDetails>
        <paymentAccount>
            <paymentAccountID>0</paymentAccountID>
        </paymentAccount>
    </payment>
</handlePaymentStateChangedNotificationRequest>