cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent amount tempering with checkout.js

New Community Member

Prevent amount tempering with checkout.js

Hi,

 

I'm integrating a simple payment with checkout.js, the amount of the payment will be dynamic according to the product selected from the same page.

How can I prevent amount tempering when the user checkout? Apparently the total amount can be easily changed from the JS console.

 

 

<script>

var totalAmt = 200; // change according to selection

...

// Set up a payment
payment: function ( data, actions ) {
return actions.payment.create( {

...
transactions: [ {
  amount: {
    total:totalAmt,
    currency: 'USD'
},
item_list: {
  items: itemsVariable
},

} ]
} );
},

...

 

</script>

 

Tags (2)