Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // updates the screen on the card reader for the customer
- window.addEventListener('prices-updated', event => {
- console.log('prices-updated');
- console.log(event.detail.info);
- var info = [];
- $(event.detail.info).each(function($index)
- {
- info[$index] = {
- description: this[0],
- quantity: this[1],
- amount: this[2] * 100,
- }
- });
- var subtotal = $('#subtotal').val();
- var tax = $('#tax').val();
- var total = $('#total').val();
- terminal.setReaderDisplay({
- type: 'cart',
- cart: {
- line_items: info,
- tax: tax * 100,
- total: total * 100,
- currency: 'usd',
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement