(function (w, d, n, s, p) { w[n] = w[n] || function () { (w[n].q = w[n].q || []).push(arguments) }, w[n].l = +new Date(); s = d.createElement('script'), p = d.scripts[0]; s.async = s.src = 'https://s3-us-west-2.amazonaws.com/tg-in-checkout-widget-dev/js/client-widget.min.js'; p.parentNode.insertBefore(s, p); })(window, document, 'tg'); function setSize(size, key) { tg ('configure', { apiKey: key, currency: 'USD', size: size, locale: 'en_US', sandbox: true, costsOfItems: ['1.50', '20.00', '3.00'], loadedCb: function () { console.log('loaded callback2'); }, optInCb: function () { console.log('opted in callback2'); }, optOutCb: function () { console.log('opted out callback2'); }, updatedCb: function () { console.log('updated'); }, onErrorCb: function (err) { console.log(err); console.log('Error has occurred callback'); } }); }