text: /**
   * Copyright 2019 BlockChyp, Inc. All rights reserved. Use of this code is governed by a
   * license that can be found in the LICENSE file.
   *
   * This file was generated automatically. Changes to this file will be lost every time the
   * code is regenerated.
   */
  
  describe('UpdateTransactionDisplay', function () {
    var uuidv4 = require('uuid/v4');
    var Config = require('../itest/support/config').config;
    Config.load();
    var BlockChyp = require('../index.js');
    var lastTransactionId, lastTransactionRef, lastCustomerId, lastToken;
  
    beforeEach(function () {
      originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
      jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
    });
  
    it('Can update transaction line item display', function (done) {
      var client = BlockChyp.newClient(Config.getCreds())
      client.setGatewayHost(Config.getGatewayHost())
      client.setTestGatewayHost(Config.getTestGatewayHost())
  
      var testDelay = process.env.BC_TEST_DELAY
      var testDelayInt = 0
      if (testDelay) {
        testDelayInt = parseInt(testDelay)
      }
  
      if (testDelay > 0) {
        var messageRequest = {
          test: true,
          terminalName: Config.getTerminalName(),
          message: 'Running UpdateTransactionDisplay in ' + testDelay + ' seconds...'
        }
        client.message(messageRequest)
          .then(function (httpResponse) {
            let response = httpResponse.data
            expect(response.success).toBe(true)
          })
          .catch(function (error) {
            console.log('Error:', error)
            done()
          })
      }
  
      setTimeout(function () {
        // setup request object
        let request = {
          test: true,
          terminalName: Config.getTerminalName(),
          transaction: {
            subtotal: '35.00',
            tax: '5.00',
            total: '70.00',
            items: [
              {
                description: 'Leki Trekking Poles',
                price: '35.00',
                quantity: 2,
                extended: '70.00',
                discounts: [
                  {
                    description: 'memberDiscount',
                    amount: '10.00',
                  },
                ],
              },
            ],
          },
        }
  
        client.updateTransactionDisplay(request)
          .then(function (httpResponse) {
            let response = httpResponse.data
            console.log('TEST RESPONSE:' + JSON.stringify(response))
  
            // response assertions
            expect(response.success).toBe(true)
            done()
          })
          .catch(function (error) {
            console.log('Error:', error)
            done()
          })
      }, testDelayInt * 1000);
    });
  });
  