Hosted Payments Redirect

You can use the following template to create URLs for redirecting a customer to a Hosted Payments Form.

https://<converge-api-url>?sessionId=<payment-session-id>

The Converge-API-URL is the URL for the environment you are currently using. Typically these will be either:

  • Sandbox:

    • https://uat2.api.converge.eu.elavonaws.com/
    • https://uat2.hpp.converge.eu.elavonaws.com/
  • Production:

    • https://api.eu.convergepay.com/
    • https://hpp.eu.convergepay.com/

On top of that, you will need a Session ID. This is obtained from creating a payment session. For more information, see Server-Side Scripting and the Payment Sessions resource.

The Hosted Payments Page supports most modern browsers. However, it does not support Internet Explorer and Microsoft Edge.

Example: A Client-Side Approach

One way to approach executing this redirect is to have a button that initiates the checkout when it's clicked.

First, create an HTML button that invokes a redirect function on click. Then, define a function that the previous button invokes. This function should handle the work of creating a Hosted Payments Page redirect URL and redirects the client's browser to the location.

There are multiple ways to make this function. The following function is one possible approach.

async function hostedRedirect&#40;&#41; {
   const sessionId = await paymentSession&#40;&#41;; // A function that returns a payment session ID.
   // Use a string literal to append the session ID to the URL.
   const redirectUrl = 'https://uat2.hpp.converge.eu.elavonaws.com?sessionId=${sessionId}';
   // Redirect the window to the payment session.
   window.location = redirectURL; }