Depending on the integration type you have implemented, the method for launching the Open Banking & E-Mandate flow varies.

In order to launch the Open Banking Payment and E-Mandate signup flow, the merchant needs:

  • A User Interface Payment ID (the userInterfacePaymentId returned in the Create Payment request).
  • A Bacs Service User Number - SUN (the creditorSchemeIdentifier). If you do not know your Service User number, please contact the Nuapay Support team or your Account Manager.

These elements are required for both the CHECKOT and the REDIRECT integrations.

CHECKOUT Mode

In CHECKOUT mode, in order to launch the Payment & E-Mandate flow, you will need to:

  • Call the Create Payment endpoint to retrieve the userInterfacePaymentId.
  • Apply CSS and JS file references to your payment page.
  • Add a Pay button, which calls the showPaymentUI function.

Calling the Create Payment Endpoint

The Open Banking payment endpoint returns a payment identifier on a successful invocation.

To generate a payment ID:

  1. Generate a server-to-server call to /payments.
  2. Ensure that you have referenced your API Key or OAuth token in the request.
  3. The /payments service is described in Create Payment.
  4. In the response, you will need to store the userInterfacePaymentId.

Adding the CSS and JS File References

On your payment page you will need to add the following:

For Sandbox

<script src="https://sandbox.nuapay.com/tpp-ui/js/nuapay-open-banking.js"></script>
<link rel="stylesheet" type="text/css" href="https://sandbox.nuapay.com/tpp-ui/css/nuapay-open-banking.css" />

For Production

<script src="https://api.nuapay.com/tpp-ui/js/nuapay-open-banking.js"></script>
<link rel="stylesheet" type="text/css" href="https://api.nuapay.com/tpp-ui/css/nuapay-open-banking.css" />

Adding The Open Banking Pay Button

At this point you have:

  • Retrieved the userInterfacePaymentId (via the Create Payment service).
  • Added the JS and CSS references to your payment page.

To enable the PAY button you will need to add an onclick event. See the example below:

<a class="btn btn-primary" href="#" onclick="NuapayOpenBanking.showPaymentUI('123456', 772d0ef5-596b-43de-a6a0-832c9ab7a7a5';'https://sandbox.nuapay.com/tpp-ui/’);">Pay Now</a>

The funtion takes three parameters:

  1. The creditorSchemeId (i.e. the SUN; 123456 in the example above).
  2. The userInterfaceIdentifier (772d0ef5-596b-43de-a6a0-832c9ab7a7a5 in the example above)
  3. The url (https://sandbox.nuapay.com/tpp-ui/)

Note that you will need to specify the correct URL based on whether you are testing or working in Production:

SANDBOX https://sandbox.nuapay.com/tpp-ui/
PRODUCTION https://api.nuapay.com/tpp-ui/

REDIRECT Mode

To launch the Payment and E-Mandate flow In REDIRECT mode:

  • Call the Create Payment endpoint to retrieve the userInterfacePaymentId.
  • Constuct the required URL to pass to the PSU as a payment link.

In the standard REDIRECT Open Banking payment, a URL similar to the following is used:

/tpp-ui/redirect?userInterfacePaymentId=userInterfacePaymentId

To launch the Payment and E-Mandate flow, the URL becomes:

/tpp-ui/payment-ui/redirect?creditorSchemeId=SUN&userInterfacePaymentId=userInterfacePaymentId

Note that the URL:

  • Includes /payment-ui/
  • The value of the SUN is the 6-digit identifier (not the encoded identifier).