Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
VenmoView.prototype.initialize = function () {
var self = this;
var venmoConfiguration = assign({}, self.model.merchantConfiguration.venmo, {client: this.client});
self.model.asyncDependencyStarting();
return btVenmo.create(venmoConfiguration).then(function (venmoInstance) {
self.venmoInstance = venmoInstance;
if (!self.venmoInstance.hasTokenizationResult()) {
return Promise.resolve();
}
return self.venmoInstance.tokenize().then(function (payload) {
self.model.reportAppSwitchPayload(payload);
}).catch(function (err) {
if (self._isIgnorableError(err)) {
return;
}
self.model.reportAppSwitchError(paymentOptionIDs.venmo, err);
});
}).then(function () {
var button = self.getElementById('venmo-button');