Trustly Branded Bank Transfer Withdrawal

Provider Trustly offers bank transfer deposit and withdrawal for various countries in Europe.

The following method IDs are covered in this section:

ID

Name

Credit/Debit State

310

BankTransferRedirectWithdrawal

WithdrawnByProvider

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

With this payment method the end user logs in to their bank and selects their bank account the first time they make a Trustly withdrawal. This means their bank account is verified at the same time. The next time the user requests a withdrawal, the same bank account will be pre-filled in the withdrawal iframe.

This page provides preliminary information.

Trustly Flow at provider

Step 1 - Select bank

12421242

Step 2 - Enter bank account details manually in the iframe, or select "fetch from bank" which will take the user to the steps below.

12421242

Step 3 - Log in to bank

12581258

Step 4 - Select bank account

12341234

Step 5 - Confirm withdrawal

12261226

Please note that the screenshots shows the flow for an end user who hasn't used Trustly before. If the same user requests a second withdrawal, or has made a previous trustly deposit, the flow will go straight to step 5 with the bank account details from the previous withdrawal / deposit pre-filled.

Redirect Integration

Currently not supported.

Backend2BackendIntegration

Below you can see the states of a Trustly branded bank transfer withdrawal payment:

810810

Below you can see the flow of a Trustly branded bank transfer withdrawal payment:

976976

Trustly branded withdrawals use the following flow:

Step

Description

Merchant sends initiatePaymentRequest to PXP Financial payment service.

The amount will be fixed by default.

PXP Financial sends Withdraw request to Trustly.

Trustly responds with OrderID and redirect URL.

PXP Financial sends initiatePaymentResponse to merchant with redirectURL.
Payment state: RedirectURLCreated.

Merchant redirects customer to redirectURL in iFrame or stand-alone page. The user logs into their internet bank and selects their bank account.

As soon as the user completes the withdrawal in the Trustly iframe, Trustly sends a debit notification to PXP Financial. The money has not yet been sent to the user at this point.

If the user does not complete all the steps in the withdrawal iframe, a cancel notification is sent to PXP Financial. If the user just closes the browser tab with the withdrawal iframe, PXP Financial will receive a cancel notification after 30 minutes.

PXP Financial will inform the merchant about the withdrawal registration.

The merchant will confirm or deny the withdrawal registration.

PXP Financial will respond to the debit notification from Trustly with either an OK or FAILED response.

In the second phase, this means that the merchant´s system was unable to decrease the end-user´s account balance with the specified amount and currency. A withdrawal request will not be processed further!

If the merchant confirms the withdrawal registration, PXP Financial responds to Trustly with OK. PXP Financial will send a state notification for state ConfirmedByCustomer and move the payment to state PendingOnMerchant.

Risk checks
The merchant should decide if the withdrawal should be approved or denied.

Merchant sends executePaymentAction request with either Execute action or 'Abort* action.

PXP Financial calls Trustly with ApproveWithdrawal or DenyWithdrawal call.

Trustly responds with Success or Error.

PXP Financial sends executePaymentAction response to Merchant.

In the success case (merchant sent Execute action), the state is ToBeWithdrawnByProvider.

This is a change from the current flow for BankTransferWithdrawal via Trustly. The merchant should not yet set the payment to completed, as at this point Trustly has only acknowledged that the withdrawal request is correct, however, it still can fail execution. The merchant should wait for the notification of state WithdrawnByProvider.

When the merchant has decided to deny the withdrawal, the following state will be AbortedOnProvider.

If Trustly rejects an approval, the resulting state is WithdrawalErrorReportedByProvider. If a deny is rejected, the state is AbortErrorReportedByProvider. For example, Trustly may deny an approval of a withdrawal, if a deny for the same withdrawal has already been sent.

State notification for WithdrawnByProvider is sent.

InitiatePayment request

The following table contains the fields to be sent in the initiatePaymentRequest.user xml section. These data can also be stored earlier in the user section.

key (value type, account type, required)

value

FirstName (string)

customer´s first name

Lastname (string)

customer´s last name

DateOfBirth (datetime)

customer´s date of birth

Email (string)

customer´s eMail address

The following parameters can be provided in initiatePaymentRequest.specificPaymentData. They all are optional:

key (value type, account type, required)

value

LanguageCode
(string)

language, eg. SV

IP Address (string)

IP-address

TemplateURL (string)

URL for the template page
The template page is used instead of displaying the Trustly URL in an iframe on the dwithdrawal page.
The merchant may design a template page and send the URL to this page in this parameter. For every withdrawal, the Trustly system fetches the contents of the template page, inserts the Trustly iframe into it and hosts everything on the Trustly side. The merchant will receive in the response a URL to the hosted template page and should redirect the user to this page.

It is recommended to have just a thin header with a logo, and then add the tag where the trustly iframe should be placed.

URLTarget (string)

The html target/framename of the SuccessURL. Only _top, _self and _parent are supported.

SuccessPageUrl (string)

URL to redirect the customer to after successfully entering bank data on the page hosted by Trustly

ErrorPageUrl (string)

URL to redirect the customer to after an error occuring during entering bank data on the page hosted by Trustly

CancelPageUrl (string)

URL to redirect the customer when cancelling the data entry on the page hosted by Trustly

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>TrustlyBankTransferRedirectWithdrawalShop</shopID>
 <merchantTransactionID>cctest0026961</merchantTransactionID>
 <paymentMethodID>310</paymentMethodID>
 <amount currencyCode="SEK">12.09</amount>
 <userID>0bb4eaab-4c02-4b1d-bfa6-1183e6</userID>
 <userData>
  <username>b745be49-360e-4a8b-a0c3-bced6c</username>
  <firstname>Chloé</firstname>
  <lastname>Täöü</lastname>
  <currencyCode xsi:nil="true" />
  <languageCode>sv</languageCode>  
  <email>[email protected]</email>
  <address>
   <street xsi:nil="true" />
   <houseName xsi:nil="true" />
   <houseNumber xsi:nil="true" />
   <houseNumberExtension xsi:nil="true" />
   <postalCode xsi:nil="true" />
   <city xsi:nil="true" />
   <state xsi:nil="true" />
   <countryCode2>se</countryCode2>
   <telephoneNumber xsi:nil="true" />
  </address>
  <dateOfBirth>1990-01-20T00:00:00</dateOfBirth>
  <identificationNumberType xsi:nil="true" />
  <drivingLicenseNumber xsi:nil="true" />
  <drivingLicenseIssuingState xsi:nil="true" />
 </userData> 
 <userIP>83.140.44.184</userIP>
 <userSessionID>1ccba5a4-2195-4871-94e2-59d8abeeb17f</userSessionID>
 <creationTypeID>1</creationTypeID>
 <specificPaymentData>
  <data xsi:type="keyStringValuePair">
   <key>SuccessPageUrl</key>
   <value>http://success/?a=b&amp;c=d</value>
  </data>
  <data xsi:type="keyStringValuePair">
   <key>ErrorPageUrl</key>
   <value>http://error/?a=b&amp;c=d</value>
  </data>
  <data xsi:type="keyStringValuePair">
   <key>CancelPageUrl</key>
   <value>http://cancel/?a=b&amp;c=d</value>
  </data>
  <data xsi:type="keyStringValuePair">
   <key>LanguageCode</key>
   <value>sv</value>
  </data>
  <data xsi:type="keyStringValuePair">
   <key>CountryCode2</key>
   <value>SE</value>
  </data>
  <data xsi:type="keyStringValuePair">
   <key>TemplateUrl</key>
   <value>http://template/?a=b&amp;c=d</value>
  </data>
  <data xsi:type="keyStringValuePair">
   <key>URLTarget</key>
   <value>_top</value>
  </data>
 </specificPaymentData>
</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>B2BTestMerchant</merchantID>
        <shopID>TrustlyBankTransferRedirectWithdrawalShop</shopID>
        <paymentMethod>
            <key>310</key>
            <value>BankTransferRedirectWithdrawal</value>
        </paymentMethod>
        <merchantTransactionID>cctest0026961</merchantTransactionID>
        <paymentID>0a956a2a-264f-4f56-940d-2f06088f8f4b</paymentID>
        <userID>0bb4eaab-4c02-4b1d-bfa6-1183e6</userID>
        <paymentProvider>
            <key>114</key>
            <value>Trustly</value>
        </paymentProvider>
        <amount currencyCode="SEK">12.09</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>83.140.44.184</userIP>
        <state>
            <id>7dd4280d-dad9-425b-ab1a-7c3e0a68f3b4</id>
            <definition>
                <key>30</key>
                <value>RedirectURLCreated</value>
            </definition>
            <createdOn>2018-07-27T14:01:51.1464362Z</createdOn>
            <paymentStateDetails>
                <detail xsi:type="keyStringValuePair">
                    <key>RedirectionUrl</key>
                    <value>https://test.trustly.com/5b4d2abb-689d-40f8-8697-4df5bc8fb2a3</value>
                </detail>
                <detail xsi:type="keyStringValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">1.39</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>114084</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderTransactionID</key>
                <value>87353919-e947-461f-acca-dd15af62ad8e</value>
            </detail>
        </paymentDetails>
        <paymentAccount>
            <paymentAccountID>0</paymentAccountID>
        </paymentAccount>
    </payment>
</initiatePaymentResponse>

Cancel notification from Trustly

If the user does not complete all the steps in the withdrawal iframe, a cancel notification is sent to PXP Financial and the state is set to AbortedByCustomer

State

Description

AbortedByCustomer (101)

Error state. User aborted the payment.

If the user does not complete all the steps in the withdrawal iframe, a cancel notification is sent to PXP Financial and the state is set to AbortedByCustomer.

If the user just closes the browser tab with the withdrawal iframe, PXP Financial will receive a cancel notification after 30 minutes.

For this state a notification is sent to merchant.

Debit notification from Trustly with balance check

Once PXP Financial receives a debit notification from Trustly, the merchant is notified accordingly by state notification.

Example payment state notification after debit request is received from Trustly:

<?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>YourMerchantID</merchantID>
    <shopID>YourShopID</shopID>
    <paymentMethod>
      <key>310</key>
      <value>BankTransferRedirectWithdrawal</value>
    </paymentMethod>
    <merchantTransactionID>22e85d67-6c8e-4db3-8a3d-3d8f342a13e2</merchantTransactionID>
    <paymentID>0b3ebeb5-fd9f-4541-a43c-04e2c4948347</paymentID>
    <userID>e48d6298-bbfd-46c9-b74e-984a80</userID>
    <paymentProvider>
      <key>114</key>
      <value>Trustly</value>
    </paymentProvider>
    <amount currencyCode="EUR">30.5500</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>947de47b-7927-4ec0-a3ca-a5e3e24ac317</id>
      <definition>
        <key>529</key>
        <value>InquiryRequestReceivedFromProvider</value>
      </definition>
      <createdOn>2018-08-13T08:45:00.0604658Z</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">30.5500</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>117922</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>eb983a39-f86a-481f-892a-e296f59d2c4d</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>0</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

Possible payment states after the provider notification was processed:

State

Description

InquiryRequestReceivedFromProvider (529)

The payment data was entered by the customer on the provider side and merchant is notified.

NotifyPaymentStateRequestSentToMerchant (262)

The merchant has been notified about the debit notification from Trustly.

The merchant may now check the user´s balance and send a response with either OK, Blocked,
or Refused.

Response

Resulting states flow

OK

NotifyPaymentStateAcceptedByMerchant (264)
InquiryRequestResponseSentToProvider (528)
ConfirmedByCustomer (517)

Blocked

NotifyPaymentStateBlockedByMerchant (500)
InquiryRequestResponseSentToProvider (528)
RefusedByMerchant (342)

NotAccepted

NotifyPaymentStateRefusedByMerchant (301)
InquiryRequestResponseSentToProvider (528)
RefusedByMerchant (342)

Error

NotifyPaymentStateErrorReportedByMerchant (265)
InquiryRequestResponseSentToProvider (528)
RefusedByMerchant (342)

Example for successful response (results in state NotifyPaymentStateAcceptedByMerchant):

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<resultCode>
<key xmlns="http://www.cqrpayments.com/PaymentProcessing">0</key>
<value xmlns="http://www.cqrpayments.com/PaymentProcessing">ProcessedSuccessfully</value>
</resultCode>
<resultMessage>Request processed by merchant</resultMessage>
</handlePaymentStateChangedNotificationResponse>

Example for refused response (results in state NotifyPaymentStateRefusedByMerchant):

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<resultCode>
<key xmlns="http://www.cqrpayments.com/PaymentProcessing">1</key>
<value xmlns="http://www.cqrpayments.com/PaymentProcessing">NotAcceptedState</value>
</resultCode>
<resultMessage>Request processed by merchant</resultMessage>
</handlePaymentStateChangedNotificationResponse>

Example for blocked - response (results in state NotifyPaymentStateBlockedByMerchant):

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<resultCode>
<key xmlns="http://www.cqrpayments.com/PaymentProcessing">15</key>
<value xmlns="http://www.cqrpayments.com/PaymentProcessing">BlockedByMerchant</value>
</resultCode>
<resultMessage>Request processed by merchant</resultMessage>
</handlePaymentStateChangedNotificationResponse>

Depending on the response, PXP Financial will move the payment to a subsequent state and notify Trustly.

Possible payment states after the response from merchant as processed:

State

Description

NotifyPaymentStateResponseReceivedFromMerchant (263)

Intermediate state, notification response received from merchant

NotifyPaymentStateAcceptedByMerchant (264)

Intermediate state, marks a successful response from merchant

NotifyPaymentStateBlockedByMerchant (500)

Intermediate state, marks a blocked response from merchant

NotifyPaymentStateRefusedByMerchant (301)

Intermediate state, marks a refused response from merchant

NotifyPaymentStateErrorReportedByMerchant (265)

Intermediate state, marks an error response from merchant

InquiryRequestResponseSentToProvider (528)

Intermediate state, marks a OK or FAILED response sent to provider

RefusedByMerchant) (342)

Error state. Payment was blocked or refused by merchant. The payment will not be carried out by the provider.

ConfirmedByCustomer (517)

The merchant has confirmed the withdrawal registration. The merchant is notified about this state and the payment is moved to state PendingOnMerchant.

The merchant is expected to run it´s risk checks and depending on their outcome, send an executePaymentAction request with either accept (ID 95030) or abort (ID 177020).

PendingOnMerchant (214)

The PXP Financial system waits for the executePaymentAction request from merchant to either accept or abort the payment.

Depending on the response to Trustly, a message is displayed to customer:

757757

Final approval or abort after risk check

Once the payment is moved the payment to state PendingOnMerchant, the merchant is expected to run it´s risk checks and depending on their outcome, send an executePaymentAction request with either accept (ID 95030) or abort (ID 177020).

Example for Execute Action Request for ToBeWithdrawnByProvider

<?xml version="1.0" encoding="utf-8"?>
<executePaymentActionRequest xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <merchantID>TrustlyProviderTesting</merchantID>
  <shopID>TrustlyProviderTestingShop</shopID>
  <paymentID>2aeed03d-cfab-44d0-8104-cabcdfb5f959</paymentID>
  <actionID>95030</actionID>
  <remark>Trustly Provider Testing</remark>
</executePaymentActionRequest>

Example for Execute Action Response for ToBeWithdrawnByProvider

<executePaymentActionResponse xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <statusCode>0</statusCode>
    <actionResults>
        <result xsi:type="keyStringValuePair">
            <key>lastStateDefinition</key>
            <value>240</value>
        </result>
        <result xsi:type="keyStringValuePair">
            <key>ProviderTransactionID</key>
            <value>3863076579</value>
        </result>
        <result xsi:type="keyStringValuePair">
            <key>PaymentStateReasonID</key>
            <value>1</value>
        </result>
    </actionResults>
</executePaymentActionResponse>

Example for Execute Action Request for AbortedOnProvider

<?xml version="1.0" encoding="utf-8"?>
<executePaymentActionRequest xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <merchantID>TrustlyProviderTesting</merchantID>
  <shopID>TrustlyProviderTestingShop</shopID>
  <paymentID>3a216aea-d901-4c12-ab23-5f0d2011864c</paymentID>
  <actionID>177020</actionID>
  <remark>Trustly Provider Testing</remark>
</executePaymentActionRequest>

Example for Execute Action Response for AbortedOnProvider

<executePaymentActionResponse xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <statusCode>0</statusCode>
    <actionResults>
        <result xsi:type="keyStringValuePair">
            <key>lastStateDefinition</key>
            <value>396</value>
        </result>
        <result xsi:type="keyStringValuePair">
            <key>ProviderTransactionID</key>
            <value>3388062594</value>
        </result>
        <result xsi:type="keyStringValuePair">
            <key>PaymentStateReasonID</key>
            <value>1</value>
        </result>
    </actionResults>
</executePaymentActionResponse>

Possible payment states after the accept (ID 95030) response from merchant is processed:

State

Description

WithdrawRequestSentToProvider (18)

ApproveWithdrawal request was sent to Trustly (intermediate state)

WithdrawCommunicationErrorOccured (576)

After sending the ApproveWithdrawal request to Trustly, PXP Financial did not receive a response.

WithdrawResponseReceivedFromProvider (19)

ApproveWithdrawal response was received from Trustly. The resulting state is either ToBeWithdrawnByProvider (for an OK response) or (for an error response) WithdrawErrorReportedByProvider

WithdrawErrorReportedByProvider (21)

Trustly has responded with an error to the ApproveWithdrawal request.

Most common error codes:

  • 602 ERROR_FUNCTION_ACCESS_DENIED
  • 607 'ERROR_HOST_ACCESS_DENIED*
  • 616 "ERROR_INVALID_CREDENTIALS"

ToBeWithdrawnByProvider (240)

Trustly has respond with OK to the ApproveWithdrawal request. However, the withdrawal has not yet been carried out by Trustly and it can still fail. Please wait for the state WithdrawnByProvider which is reached in about 2 minutes.

WithdrawnByProvider (20)

The payment has now been successful processed (withdrawn) by Trustly.

RefusedByProvider (100)

A payment may move from ToBeWithdrawnByProvider to RefusedByProvider if the balance of the merchant account is too low to execute the withdrawal payment.

Possible payment states after the abort (ID 177020) response from merchant is processed:

State

Description

AbortRequestSentToProvider (392)

DenyWithdrawal request was sent to Trustly (intermediate state)

*AbortCommunicationErrorOccured (394)

After sending the ApproveWithdrawal request to Trustly, PXP Financial did not receive a response.

A transition from this state to WithdrawnByProvider is possible based on the settlement file - see the description of AbortRefusedByProvider below.

Trustly allows for the configuration of automatic approval for withdrawals. This functionality is already used for (generic) BankTransferWithdrawal via Trustly. For Trustly Branded BankTransfer Withdrawal (BankTransferRedirectWithdrawal) a seperate MID needs to be used to enable manual approval of withdrawals.

If a automatic approval is configured by mistake and AbortWithdrawal is sent, sending executePaymentAction wtih Abort might result in AbortedRefusedByProvider.

AbortResponseReceivedFromProvider (393)

DenyWithdrawal response was received from Trustly. The resulting state is either AbortedOnProvider (for an OK response) or (for an error response) AbortErrorReportedByProvider or **AbortedRefusedByProvider (for refusal).

AbortedOnProvider (397)

The payment was aborted on provider.

AbortErrorReportedByProvider (395)

Trustly has responded with an error to the DenyWithdrawal request.

Most common error codes:

  • 602 ERROR_FUNCTION_ACCESS_DENIED
  • 607 'ERROR_HOST_ACCESS_DENIED*
  • 616 "ERROR_INVALID_CREDENTIALS"

AbortedRefusedByProvider (396)

Trustly has refused the DenyWithdrawal request.

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 for state notification in state ConfirmedByCustomer:

<?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>YourMerchantID</merchantID>
    <shopID>YourShopID</shopID>
    <paymentMethod>
      <key>310</key>
      <value>BankTransferRedirectWithdrawal</value>
    </paymentMethod>
    <merchantTransactionID>22e85d67-6c8e-4db3-8a3d-3d8f342a13e2</merchantTransactionID>
    <paymentID>0b3ebeb5-fd9f-4541-a43c-04e2c4948347</paymentID>
    <userID>e48d6298-bbfd-46c9-b74e-984a80</userID>
    <paymentProvider>
      <key>114</key>
      <value>Trustly</value>
    </paymentProvider>
    <amount currencyCode="EUR">30.5500</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>cee84bea-538b-42d8-8c4e-b801b52f9927</id>
      <definition>
        <key>517</key>
        <value>ConfirmedByCustomer</value>
      </definition>
      <createdOn>2018-08-13T08:45:00.347</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">30.5500</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>117922</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>eb983a39-f86a-481f-892a-e296f59d2c4d</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>0</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

Example for state notification 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>YourMerchantID</merchantID>
    <shopID>YourShopID</shopID>
    <paymentMethod>
      <key>310</key>
      <value>BankTransferRedirectWithdrawal</value>
    </paymentMethod>
    <merchantTransactionID>f19ab199-5a07-4da3-b75f-09e49065044d</merchantTransactionID>
    <paymentID>e49b6651-84b0-4d8c-894e-23de91d295e6</paymentID>
    <userID>fec84f00-7871-4a4e-9d08-a868ef</userID>
    <paymentProvider>
      <key>114</key>
      <value>Trustly</value>
    </paymentProvider>
    <amount currencyCode="EUR">30.0000</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>96a5a324-2e7a-4d64-a98f-896b05fc7dd7</id>
      <definition>
        <key>20</key>
        <value>WithdrawnByProvider</value>
      </definition>
      <createdOn>2018-08-13T08:46:58.9</createdOn>
      <paymentStateDetails xsi:nil="true" />
    </state>
    <isExecuted>true</isExecuted>
    <baseAmount currencyCode="EUR">30.0000</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>117921</value>
      </detail>
      <detail xsi:type="keyIntValuePair">
        <key>MerchantSettlementCurrencyID</key>
        <value>2</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>15bd1540-cf17-4b73-8ca6-58ea3144cabc</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>0</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

Example for state notification 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>YourMerchantID</merchantID>
    <shopID>YourShopID</shopID>
    <paymentMethod>
      <key>310</key>
      <value>BankTransferRedirectWithdrawal</value>
    </paymentMethod>
    <merchantTransactionID>22e85d67-6c8e-4db3-8a3d-3d8f342a13e2</merchantTransactionID>
    <paymentID>0b3ebeb5-fd9f-4541-a43c-04e2c4948347</paymentID>
    <userID>e48d6298-bbfd-46c9-b74e-984a80</userID>
    <paymentProvider>
      <key>114</key>
      <value>Trustly</value>
    </paymentProvider>
    <amount currencyCode="EUR">30.5500</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>68caa5d4-ca7b-47cb-b780-c45a7e4ec377</id>
      <definition>
        <key>100</key>
        <value>RefusedByProvider</value>
      </definition>
      <createdOn>2018-08-13T08:45:01.37</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">30.5500</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>117922</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>eb983a39-f86a-481f-892a-e296f59d2c4d</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>0</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

Example for state notification in state InquiryRequestReceivedFromProvider

<?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>YourMerchantID</merchantID>
    <shopID>YourShopID</shopID>
    <paymentMethod>
      <key>310</key>
      <value>BankTransferRedirectWithdrawal</value>
    </paymentMethod>
    <merchantTransactionID>22e85d67-6c8e-4db3-8a3d-3d8f342a13e2</merchantTransactionID>
    <paymentID>0b3ebeb5-fd9f-4541-a43c-04e2c4948347</paymentID>
    <userID>e48d6298-bbfd-46c9-b74e-984a80</userID>
    <paymentProvider>
      <key>114</key>
      <value>Trustly</value>
    </paymentProvider>
    <amount currencyCode="EUR">30.5500</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>947de47b-7927-4ec0-a3ca-a5e3e24ac317</id>
      <definition>
        <key>529</key>
        <value>InquiryRequestReceivedFromProvider</value>
      </definition>
      <createdOn>2018-08-13T08:45:00.0604658Z</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">30.5500</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>117922</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>eb983a39-f86a-481f-892a-e296f59d2c4d</value>
      </detail>
    </paymentDetails>
    <paymentAccount>
      <paymentAccountID>0</paymentAccountID>
    </paymentAccount>
  </payment>
</handlePaymentStateChangedNotificationRequest>

Useful Links

Trustly checkout guidelines