Trustly Instant Bank Deposit - Pay & Play Flow

The following method IDs are covered in this section:

IDNameCredit/Debit State
162TrustlyInstantBankDepositDepositedByProvider

Payment method interaction type: Redirection to External Payment Provider and notification (see Interaction Types).

Redirect Integration

Currently not supported.

Backend2BackendIntegration

On the Pay N Play flow a payment is initiated without userdata such as Firstname and Lastname.
The merchant needs to send ShouldRequestKYC = true.

The following parameters can be provided in initiatePaymentRequest.specificPaymentData:

key (value type, account type, required)value
MerchantNotificationUrl
(string, required)
The URL where the user will be redirected after payment execution with payment execution result
UrlTarget (string, optional)The html target/framename of the SuccessUrl. Used for updating iframe. Only _top, _self or _parent are supported.
ShouldRequestKYC (string, mandatory for the Pay & Play Flow)The merchant needs to send this parameter for the Pay & Play flow.

User Data

For the TrustlyInstantBankDeposit in the Trustly Pay N Play (Pure) flow the merchant should send a fixed userID when the payment is initiated.

The use case is the Trustly deposit being used to register a user to the merchant´s site. When registering (or using the registration flow mistakenly to login) the user is anonymous as the payment is initiated.

🚧

Fixed userID

A fixed userID for the registrating anonymous user will be created by PXP and should be used on all initial payments in both TEST1 and LIVE.

ExternalID (payerID) and username: PNP_InitialUser
details: country (ie. SE)

After a permanent user is associated on the first payment by the merchant passing the final userID (payerID) in the handlePaymentStateChangedNotificationResponse (see sample below), the merchant will have to send all the actual user details (FirstName, LastName, etc.) of the permanent user when initiating the next payment. When the merchant fails to do so, the payment will fail as the required user details are not present.

📘

User data for the permanent user

Please pass the user details for the permanent user on the next payment - on a TrustlyInstantBankDeposit or a TrustlyInstantBankWithdrawal.

The user details include FirstName, LastName, eMail and Country.

❗️

UserVerificationFailed

PXP will set the state UserVerificationFailed as a new final state when the merchant initiates a TrustlyInstantBankDeposit with PayerID PNP_InitialUser but fails to provide a user in the handlePaymentStateChangedNotificationResponse. PXP then will then send “FINISH” to Trustly – resulting in the payment being aborted – and move the payment to state UserVerificationFailed.

PXP can optional notify the merchant about the state UserVerificationFailed.

We expect the merchant to use that fixed userID only for Trustly Pay N Play payments. The above flow with state UserVerificationFailed will not apply to payments initiated with other users.

When the merchant sends that fixed userID, PXP will generate a random value for the customer record and send it to Trustly.

Example 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>YourTestMerchant</merchantID>
    	<shopID>YourTestShop</shopID>
    	<merchantTransactionID>26706991-8112-4de8-a8fa-9c893d196c9f</merchantTransactionID>
    	<paymentMethodID>162</paymentMethodID>
    	<amount currencyCode="SEK">30.00</amount>
    	<userID>PNP_InitialUser</userID>
    	<userIP>127.0.0.1</userIP>
    	<userSessionID>8a975451-a5b9-4a65-a815-76856e68a66c</userSessionID>
    	<creationTypeID>1</creationTypeID>
    	<specificPaymentData>
    		<data xsi:type="keyStringValuePair">
    			<key>MerchantNotificationUrl</key>
    			<value>https://merchant.com/notification.html</value>
    		</data>
    		<data xsi:type="keyStringValuePair">
    			<key>UrlTarget</key>
    			<value>http://urlTargetForIFrameUpdates</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>YourTestMerchant</merchantID>
        <shopID>YourTestShop</shopID>
        <paymentMethod>
            <key>162</key>
            <value>TrustlyInstantBankDeposit</value>
        </paymentMethod>
        <merchantTransactionID>26706991-8112-4de8-a8fa-9c893d196c9f</merchantTransactionID>
        <paymentID>1ed35838-cd16-4b45-8f02-47be9f342598</paymentID>
        <userID>PNP_InitialUser</userID>
        <paymentProvider>
            <key>114</key>
            <value>Trustly</value>
        </paymentProvider>
        <amount currencyCode="SEK">30.00</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>9da321e6-0e58-4520-a427-f2d9cab154b8</id>
            <definition>
                <key>30</key>
                <value>RedirectURLCreated</value>
            </definition>
            <createdOn>2021-03-17T08:58:23.0369586Z</createdOn>
            <paymentStateDetails>
                <detail xsi:type="keyStringValuePair">
                    <key>RedirectionUrl</key>
                    <value>https://test.trustly.com/_/orderclient.php?Locale=en_SE&amp;OrderID=13944871735&amp;SessionID=77b412ea-d52f-4ce1-b7d1-11da2de6a911</value>
                </detail>
                <detail xsi:type="keyStringValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">12.55</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderTransactionID</key>
                <value>13944871735</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>245008</value>
            </detail>
        </paymentDetails>
    </payment>
</initiatePaymentResponse>

The possible payment states in initiatePaymentResponse are listed below:

Payment StatesDescription
RedirectURLCreated (287) OK state; Redirect user to the URL
DuplicatePaymentValidationFailed (369)A payment with the same merchantTransactionID already exists.
InitiateErrorReportedByProvider (4)Payment was not initiated; See below table Error Codes for list of common errors

Intermediate notification

After the user was redirected to Trustly and provides his bank account details to Trustly, PXP then will send a handlePaymentStateChangednotificationRequest to the merchant.

The merchant has to reply with 0 (ProcessedSuccessfully/Approved) or 15 (BlockedByMerchant/Rejected).

On a response with OK, the payment is continued and a notification for the state DepositedByProviderwill be sent. An account notification will also be sent (if enabled).

The merchant may also add a LIMIT value to the response when the merchant intends to lower the payment amount. The limit will be displayed to the customer and the final amount may be equal or lower than the LIMIT amount.

When the payment is initiated with the fixed userID for the anonymous user, the merchant is expected to sent the final assigned user in the handlePaymentStateChangedNotificationResponse.

On a response with the value "15", the payment will be stopped and moved to state KYCValidationFailed.

Instaead of sending the KYC data, Trustly may return an error that KYC data cannot be retrieved or that the user is underage or unverified. In that case the state "KYCValidationFailed" is set, the payment is aborted and a notification is sent to the merchant. In addition a notification for the state AbortedByCustomer is also sent to the merchant.

📘

KYC data vs. Account notification data

The KYC notification in the Pay N Play flow is sent by Trustly at Bank login stage. The Account notification data, in contrast, is sent anytime the user selects the account they want the deposit taken from.

Example handlePaymentStateChangedNotificationRequest with 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="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
        <merchantID>YourTestMerchant</merchantID>
        <shopID>YourTestShop</shopID>
        <paymentMethod>
            <key>162</key>
            <value>TrustlyInstantBankDeposit</value>
        </paymentMethod>
        <merchantTransactionID>7e4035d9-d769-41f4-a65c-482586bbac54</merchantTransactionID>
        <paymentID>35b6691b-abdf-4170-927e-a2f1c0dd02ae</paymentID>
        <userID>pp_party332</userID>
        <paymentProvider>
            <key>114</key>
            <value>Trustly</value>
        </paymentProvider>
        <amount currencyCode="EUR">12.0300</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>6842c5b3-924b-4707-ad15-465482409f71</id>
            <definition>
                <key>529</key>
                <value>InquiryRequestReceivedFromProvider</value>
            </definition>
            <createdOn>2019-12-04T08:12:28.0644155Z</createdOn>
            <description>{    "method": "kyc",    "params": {      "signature": "X2p1H/fwwHua7s2q8alvE3Ji9ZjpZ7x5gIXZpit1zKOj5iYvCoOt+4OpJRdm1N4btRrj/+vLtHF1S0mAlYdu7GT114r1VHrYXZCjRX2WzsJmufxepEeACyJOrEHtgXDzJl/EIx1awPUyG5MxBQlgvTHJNIvFPG4cJlV8tKvv/bL/AyXZWzeKdgQkw7zpzo5fJnK0upfLKxzZoImws2Xt1KFrLOTfzfq49FlhqS6wsZYkfuPXV+vcOLT2/PYqoPI7kAjcagCeh4m+pnV7Fu40nksGkfOU5+4IySIIZgPlcqjnw2Mh4vu68mUWX+qLcrwkAM06RJ9SgIUnNxsBKIGk/A==",      "uuid": "258a2184-2842-b485-25ca-293525152425",      "data": {        "orderid": "3109226646BDD",        "messageid": "5436",        "kycentityid": "29a750aa-0bad-4a28-a42d-ffb9a690d93a",        "notificationid": "9876543456",        "attributes": {          "personid": "SE196512171957",          "firstname": "Joe",          "lastname": "Johnson",          "dob": "1965-12-17",          "street": "Street 10",          "zipcode": "11253",          "city": "STOCKHOLM",          "country": "Sweden"        }      }    },    "version": "1.1"  }</description>
            <paymentStateDetails>
                <detail xsi:type="keyIntValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">12.0300</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>5436</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderTransactionID</key>
                <value>3109226646BDD</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCEntityId</key>
                <value>29a750aa-0bad-4a28-a42d-ffb9a690d93a</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCPersonId</key>
                <value>SE196512171957</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCFirstname</key>
                <value>Joe</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCLastname</key>
                <value>Johnson</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCDateOfBirth</key>
                <value>1965-12-17</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCStreet</key>
                <value>Street 10</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCZipCode</key>
                <value>11253</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCCity</key>
                <value>STOCKHOLM</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCCountry</key>
                <value>Sweden</value>
            </detail>
        </paymentDetails>
    </payment>
</handlePaymentStateChangedNotificationRequest>

Example handlePaymentStateChangedNotificationResponse (successful case):

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

Example handlePaymentStateChangedNotificationResponse (sucessful case with LIMIT detail):

<?xml version="1.0" encoding="utf-8"?>
<handlePaymentStateChangedNotificationResponse 
xmlns="http://www.cqrpayments.com/PaymentProcessing" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<resultCode>
		<key>0</key>
		<value>ProcessedSuccessfully</value>
	</resultCode>
	<resultMessage>Approved payment</resultMessage>
	<details>
		<detail xsi:type="keyStringValuePair">
			<key>LimitAmount</key>
			<value>400.00</value>
		</detail>
	</details>
</handlePaymentStateChangedNotificationResponse>

Example handlePaymentStateChangedNotificationResponse (successful case with userID response for Pay N Play (anonymous) flow:

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationResponse xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<resultCode>
		<key>0</key>
		<value>ProcessedSuccessfully</value>
	</resultCode>
	<resultMessage>Approved payment</resultMessage>
	<details>
		<detail xsi:type="keyStringValuePair">
			<key>UserID</key>
			<value>81bd9c50-c0cc-49f0-9430-4f4a8f</value>
		</detail>
    <detail xsi:type="keyStringValuePair">
			<key>LimitAmount</key>
			<value>400.00</value>
		</detail>
	</details>
</handlePaymentStateChangedNotificationResponse>

Example handlePaymentStateChangedNotificationResponse (error case):

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

Example handlePaymentStateChangedNotification for state KYCValidationFailed :

<?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="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
        <merchantID>YourTestMerchant</merchantID>
        <shopID>YourTestShop</shopID>
        <paymentMethod>
            <key>162</key>
            <value>TrustlyInstantBankDeposit</value>
        </paymentMethod>
        <merchantTransactionID>77c030fe-5e0b-4b30-b1ff-1298bb12f73d</merchantTransactionID>
        <paymentID>0280f8e0-310a-4c90-b9d9-9b19849f4b06</paymentID>
        <userID>pp_party332</userID>
        <paymentProvider>
            <key>114</key>
            <value>Trustly</value>
        </paymentProvider>
        <amount currencyCode="EUR">46.0000</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>4bbe038b-e7d2-44dc-8ba9-f7d27f0298e8</id>
            <definition>
                <key>605</key>
                <value>KYCValidationFailed</value>
            </definition>
            <createdOn>2019-12-04T08:25:40.55</createdOn>
            <description />
            <paymentStateDetails>
                <detail xsi:type="keyIntValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">46.0000</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>5437</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderTransactionID</key>
                <value>2986525230BDD</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCEntityId</key>
                <value>29a750aa-0bad-4a28-a42d-ffb9a690d93a</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCPersonId</key>
                <value>SE196512171957</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCFirstname</key>
                <value>Joe</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCLastname</key>
                <value>Johnson</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCDateOfBirth</key>
                <value>1965-12-17</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCStreet</key>
                <value>Street 10</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCZipCode</key>
                <value>11253</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCCity</key>
                <value>STOCKHOLM</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>KYCCountry</key>
                <q1:value>Sweden</q1:value>
            </q1:detail>
        </q1:paymentDetails>
    </payment>
</handlePaymentStateChangedNotificationRequest>

When the state KYCValidationFailed is reached due to the user being underage, the information underage is saved in PaymentDetails as ProviderStatusMessage. The same applies for message unverified (Insufficient KYC information).

<?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="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
        <merchantID>YourTestMerchant</merchantID>
        <shopID>YourTestShop</shopID>
        <paymentMethod>
            <key>162</key>
            <value>TrustlyInstantBankDeposit</value>
        </paymentMethod>
        <merchantTransactionID>c8c5d800-374a-4768-82f4-4f5cfcd57645</merchantTransactionID>
        <paymentID>f89b2ec8-058d-43fb-85ef-08b44a0314a9</paymentID>
        <userID>pp_party332</userID>
        <paymentProvider>
            <key>114</key>
            <value>Trustly</value>
        </paymentProvider>
        <amount currencyCode="EUR">21.0000</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>dcac8616-90f6-42c7-b4ad-6b7885a161e6</id>
            <definition>
                <key>605</key>
                <value>KYCValidationFailed</value>
            </definition>
            <createdOn>2019-12-04T13:39:56.247</createdOn>
            <description />
            <paymentStateDetails>
                <detail xsi:type="keyIntValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">21.0000</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>5468</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderTransactionID</key>
                <value>2312017550BDD</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderStatus</key>
                <value>1</value>
            </detail>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderStatusMessage</key>
                <value>underage</value>
            </detail>
        </paymentDetails>
    </payment>
</handlePaymentStateChangedNotificationRequest>

Final state notification

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

Possible states in notification:

Payment StatesDescription
DepositedByProvider (29)Success state; Payment has been executed
RefusedByProvider (100)Refused state. Payment was not accepted by provider.
AbortedByCustomer (101)Unsuccessful state. Payment has been aborted by the customer or by Trustly.

Example handlePaymentStateChangedNotificationRequest:

<?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="paymentWithPaymentAccount">
		<merchantID>YourTestMerchant</merchantID>
		<shopID>KalixaAcceptDEMO</shopID>
		<paymentMethod>
			<key>162</key>
			<value>TrustlyInstantBankDeposit</value>
		</paymentMethod>
		<merchantTransactionID>20141230_6</merchantTransactionID>
		<paymentID>b22aa889-fa79-4762-88a7-863ad33bceed</paymentID>
		<userID>KalxiaTestUser_7</userID>
		<paymentProvider>
			<key>114</key>
			<value>Trustly</value>
		</paymentProvider>
		<amount currencyCode="EUR">100.0000</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>195.72.132.1</userIP>
		<state>
			<id>ac60f8c8-4ebd-4ba3-a070-83c1f82581c0</id>
			<definition>
				<key>29</key>
				<value>DepositedByProvider</value>
			</definition>
			<createdOn>2014-12-30T09:16:58.293</createdOn>
			<paymentStateDetails xsi:nil="true" />
		</state>
		<isExecuted>true</isExecuted>
		<baseAmount currencyCode="EUR">100.0000</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>1270</value>
			</detail>
			<detail xsi:type="keyIntValuePair">
				<key>PaymentScoring</key>
				<value>722501</value>
			</detail>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderTransactionID</key>
				<value>1939284750</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>0</paymentAccountID>
		</paymentAccount>
	</payment>
</handlePaymentStateChangedNotificationRequest>
<?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>YourTestMerchant</merchantID>
        <shopID>150001</shopID>
        <paymentMethod>
            <key>162</key>
            <value>TrustlyInstantBankDeposit</value>
        </paymentMethod>
        <merchantTransactionID>b3b05dab-1cab-43dc-b9aa-484845b3ea2a</merchantTransactionID>
        <paymentID>5c0a969d-21c7-446e-a8c1-0fe7fb1547b4</paymentID>
        <userID>pp_party332</userID>
        <paymentProvider>
            <key>114</key>
            <value>Trustly</value>
        </paymentProvider>
        <amount currencyCode="EUR">0.0000</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>442c7535-76b9-40a3-9ad9-23febfd2c571</id>
            <definition>
                <key>101</key>
                <value>AbortedByCustomer</value>
            </definition>
            <createdOn>2021-08-09T14:51:02.1959813Z</createdOn>
            <paymentStateDetails>
                <detail xsi:type="keyIntValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">21.0000</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>264479</value>
            </detail>
        </paymentDetails>
    </payment>
</handlePaymentStateChangedNotificationRequest>
<?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>YourTestMerchant</merchantID>
        <shopID>YourTestShop</shopID>
        <paymentMethod>
            <key>162</key>
            <value>TrustlyInstantBankDeposit</value>
        </paymentMethod>
        <merchantTransactionID>b3b05dab-1cab-43dc-b9aa-484845b3ea2a</merchantTransactionID>
        <paymentID>5c0a969d-21c7-446e-a8c1-0fe7fb1547b4</paymentID>
        <userID>pp_party332</userID>
        <paymentProvider>
            <key>114</key>
            <value>Trustly</value>
        </paymentProvider>
        <amount currencyCode="EUR">0.0000</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>442c7535-76b9-40a3-9ad9-23febfd2c571</id>
            <definition>
                <key>1001</key>
                <value>RefusedByProvide </value>
            </definition>
            <createdOn>2021-08-09T14:51:02.1959813Z</createdOn>
            <paymentStateDetails>
                <detail xsi:type="keyIntValuePair">
                    <key>PaymentStateReasonID</key>
                    <value>1</value>
                </detail>
            </paymentStateDetails>
        </state>
        <isExecuted>false</isExecuted>
        <baseAmount currencyCode="EUR">21.0000</baseAmount>
        <paymentDetails>
            <detail xsi:type="keyStringValuePair">
                <key>ProviderExternalID</key>
                <value>264479</value>
            </detail>
        </paymentDetails>
    </payment>
</handlePaymentStateChangedNotificationRequest>

Standalone Account Notification

Account notifications, if received from Trustly, are sent a as seperate PaymentAccountChangedNotification outside of the flow of the payment method.

Example handlePaymentAccountChangedNotification (with account notification):

<?xml version="1.0" encoding="UTF-8"?>
<handlePaymentAccountChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <paymentAccount>
      <merchantID xmlns="http://www.cqrpayments.com/PaymentProcessing">29101992</merchantID>
      <userID xmlns="http://www.cqrpayments.com/PaymentProcessing">pp_party332</userID>
      <paymentAccountID xmlns="http://www.cqrpayments.com/PaymentProcessing">29cd12e8-71ea-4f16-b446-17440237a34b</paymentAccountID>
      <paymentAccountTypeID xmlns="http://www.cqrpayments.com/PaymentProcessing">25</paymentAccountTypeID>
      <isActive xmlns="http://www.cqrpayments.com/PaymentProcessing">true</isActive>
      <isVisible xmlns="http://www.cqrpayments.com/PaymentProcessing">true</isVisible>
      <specificPaymentAccountData xmlns="http://www.cqrpayments.com/PaymentProcessing">
         <data xsi:type="keyStringValuePair">
            <key>AccountNumber</key>
            <value>1ebeb0db-f822-4675-a582-4228cce306fa</value>
         </data>
         <data xsi:type="keyStringValuePair">
            <key>AccountOwnerAddressName</key>
            <value>Examplestreet 1</value>
         </data>
         <data xsi:type="keyStringValuePair">
            <key>AccountOwnerAddressCity</key>
            <value>Helsinki</value>
         </data>
         <data xsi:type="keyStringValuePair">
            <key>AccountOwnerAddressPostalCode</key>
            <value>12345</value>
         </data>
         <data xsi:type="keyStringValuePair">
            <key>CustomerID</key>
            <value>FI080360-268A</value>
         </data>
         <data xsi:type="keyStringValuePair">
            <key>AccountOwnerCountryName</key>
            <value>FINLAND</value>
         </data>
         <data xsi:type="keyStringValuePair">
            <key>PaymentAccountLabel</key>
            <value>************000011</value>
         </data>
         <data xsi:type="keyStringValuePair">
            <key>BankName</key>
            <value>Demos Bank</value>
         </data>
         <data xsi:type="keyStringValuePair">
            <key>CustomerName</key>
            <value>Riku Pohjonen</value>
         </data>
         <data xsi:type="keyStringValuePair">
            <key>InitialMerchantTransactionID</key>
            <value>da97653a-03f5-44ba-b0be-d9c0a8a4d6b5</value>
         </data>
      </specificPaymentAccountData>
      <state xmlns="http://www.cqrpayments.com/PaymentProcessing">
         <id>6047666c-a75d-4196-9162-ce798925f716</id>
         <definition>2</definition>
         <createdOn>2021-04-16T05:59:44.9602539Z</createdOn>
         <paymentAccountStateDetails>
            <detail xsi:type="keyStringValuePair">
               <key>paymentAccountStateReasonMessage</key>
               <value>Wallet account created.</value>
            </detail>
         </paymentAccountStateDetails>
      </state>
   </paymentAccount>
</handlePaymentAccountChangedNotificationRequest>

Account details in notification:

Account detailDescription
PaymentAccountIDA payment account is being created at PXP. Trustly´s accountID has been saved at PXP.

It will be possible to initiate a bank transfer withdrawal with the payment method TrustlyInstantBankWithdrawal.
InitialMerchantTransactionIDThe merchantTransactionID of the payment with which is account was created.
AccountOwnerAddressNameThe address of the account holder, e.g. "Examplestreet 1"
AccountOwnerAddressCity The city of the account holder, e.g. "Examplecity"
AccountOwnerAddressPostalCode The zip code of the account holder, e.g. "12345"
CustomerID An ID that uniquely identifies the account holder (also called personID). Note: The format of this field will for some countries look different than the example, e.g. "SE198201019876",
AccountOwnerCountryName The country of the bank account / bank, e.g. "SWEDEN".
AccountNumber The Trustly account number value.
BankName Bankname of this acount. e.g. "Demo bank" or "SEB"
PaymentAccountLabelThe bank account number, shown as a masked value, e.g. "*** 084057". This value - called "descriptor" by Trustly - may contain spaces or other characters that are non-numerical (- or / for example). This value is meant to be used to display the value to the end user.
CustomerName The name on the account holder, e.g. "John Doe"

Trustly error codes

ProviderResponseCodeProviderResponseMessage
602ERROR_FUNCTION_ACCESS_DENIED - The merchant does not have access to this function.
607ERROR_HOST_ACCESS_DENIED - The IP address of the merchant has not been added to Trustly's IP-whitelist.
615ERROR_INVALID_AMOUNT - The Amount specified in the deposit call is invalid. The amount must be > 0 with 2 decimals.
616ERROR_INVALID_CREDENTIALS - The username and/or password used in the API call is incorrect.
620ERROR_UNKNOWN - There could be several reasons for this error, contact your integration manager for details.
623ERROR_INVALID_PARAMETERS - Some value or parameter in the deposit call does not match the expected format.
636ERROR_UNABLE_TO_VERIFY_RSA_SIGNATURE - The signature in the deposit call could not be verified using the merchant's public key. Either the wrong private key is used, or the the data object used to create the signature was serialized incorrectly.
637ERROR_DUPLICATE_MESSAGE_ID - The MessageID sent in the deposit has been used before.
638ERROR_ENDUSER_IS_BLOCKED - The enduser that initiated the payment is blocked.
645ERROR_INVALID_LOCALE - The Locale-attribute is sent with an incorrect value.
688ERROR_DUPLICATE_UUID - This uuid has been used before.
696ERROR_ENDUSERID_IS_NULL - The EndUserID sent in the request is null
697ERROR_MESSAGEID_IS_NULL - The MessageID sent in the request is null
698ERROR_INVALID_IP - The IP attribute sent is invalid. Only one IP address can be sent.
700ERROR_MALFORMED_SUCCESSURL - The SuccessURL sent in the request is malformed. It must be a valid http(s) address.
701ERROR_MALFORMED_FAILURL - The FailURL sent in the request is malformed. It must be a valid http(s) address.
702ERROR_MALFORMED_TEMPLATEURL - The TemplateURL sent in the request is malformed. It must be a valid http(s) address.
703ERROR_MALFORMED_URLTARGET - The URLTarget sent in the request is malformed.
704ERROR_MALFORMED_MESSAGEID - The MessageID sent in the request is malformed.
705ERROR_MALFORMED_NOTIFICATIONURL - The NotificationURL sent in the request is malformed. It must be a valid http(s) address.
706ERROR_MALFORMED_ENDUSERID - The EndUserID sent in the request is malformed.