realex-payments-apiglobal-payments-api

How to update the amount of HPP iframe?


How to update the amount of HPP iframe without recreate the iframe element?

In a single page application, the amount of steps matters. So, how can I show all fields (amount to pay, card details...) to user and give to him the chance to change any field without lost the values?


Solution

  • The HPP is designed to be called at the end of the checkout process when all the transaction variables have been determined. Once it's loaded you can't alter the amount. For two reasons:

    1. Amount is a fixed parameter you pass in the request to HPP
    2. It's also included in the security signature (hash) of the transaction

    So for example, could you add a "Confirm Purchase" button and only after that is clicked, the HPP is loaded into the iFrame and the transaction variables cannot be changed?

    Best,

    Global Payments