Prevent tampering of JavaScript values
<p>I'm implementing a MasterCard payment gateway to a website.
In the official guide, JavaScript is used to pass the amount to be charged, and to which merchant the money goes to.</p>

<p>It looks like a user can potentially change any of the values and have the gateway return a success message back to us.</p>

<p>Even the success message doesn't seem to have much details for revalidation.</p>

<p>I can't think of a way to prevent this other than somehow converting the JavaScript to server-side code.</p>

<p>Official guide:
<a href="https://ap-gateway.mastercard.com/api/documentation/integrationGuidelines/hostedCheckout/integrationModelHostedCheckout.html" rel="nofollow noreferrer">https://ap-gateway.mastercard.com/api/documentation/integrationGuidelines/hostedCheckout/integrationModelHostedCheckout.html</a></p>