Initiate New Payment (Backend2Backend)

The Backend2Backend Integration can be used for initiating payments for all payment methods, including Card On File (Tokenization) and MOTO (Mail Order and Telephone Order) payments and installment payments.

The following diagram describes the process:

Step 1: Merchant calls initiatePayment

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentRequest xmlns=""
    <amount currencyCode="EUR">100</amount>
        <email>[email protected]</email>


        <data xsi:type="keyStringValuePair">
            <value>some description</value>
        <data xsi:type="keyStringValuePair">
    <data xsi:type="keyStringValuePair">

            <data xsi:type="keyStringValuePair">
            <data xsi:type="keyStringValuePair">
            <data xsi:type="keyStringValuePair">
                <value>John Doe</value>
            <data xsi:type="keyIntValuePair">
            <data xsi:type="keyIntValuePair">


Payment methods usually differ in the data provided in the initiatePaymentRequest.specificPaymentData and specificPaymentAccountData collections of key-value fields.


Dynamically populate the specific xxxData collections

For a completely configurable approach allowing new payment methods to be activated without coding a so-called “Dynamic Mapper” could be implemented which dynamically generates form fields, gathers the data from the customer and then fills initiatePaymentRequest.specificPaymentData and specificPaymentAccountData collections.


Payment country is a mandatory parameter for certain types of merchant activity

For certain types of merchant activities which may fall under some country-specific restrictions, we have to know the country from which this payment is triggered.

In such cases, please be sure to pass the 'CountryCode2' specificPayment detail.

If this detail is not passed, we will try to infer the country from the address of the user.
if neither is passed, PXP Financial will not be able to process this payment.

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentResponse xmlns=""
  <payment xsi:type="paymentWithPaymentAccount">
      <value>VISA Deposit</value>
    <amount currencyCode="EUR">100.00</amount>
            <description>Approved or completed successfully</description>
                <detail xsi:type="keyStringValuePair">
                <detail xsi:type="keyStringValuePair">
        <baseAmount currencyCode="EUR">100</baseAmount>

The following fields in the initiatePaymentResponse should be parsed:

  • The payment state definition ID can be retrieved from payment.state.definition.key
  • The payment method ID can be retrieved from payment.paymentMethod.key

The values should be matched against the Payment Methods and one of the 3 possible routes should be followed:

  1. If the payment state indicates that a redirection should be performed then extract value for key RedirectionUrl from the payment.state.paymentStateDetails collection and redirect the user to this URL
  2. If the payment state indicates that the transaction was successfully processed then display or redirect the user to a success page
  3. If the payment state + method pair could not be matched against the list of payment methods then match the specific error state with the corresponding error description. If such is found then display the corresponding error message or page. If the payment state + method pair could not be matched then display a general/default error message or page.


isExecuted vs. paymentMethod.key + state.definition.key

Whether a payment was processed successfully can be identified by looking in initiatePaymentRequest for either isExecuted=true flag or for a combination of 'paymentMethod.key' + 'state.definition.key' which indicates credit/debit as per Payment Methods. The difference is that once set, isExecuted=true remains true also in subsequent request to get the current state of the payment (by calling getPayments), whereas the state can change (e.g. to SettledWithProvider)

Step 2: PaymentService calls handlePaymentStateChangedNotification

Refer to PaymentStateChangedNotification for instructions on how to handle the notification.