| Current Path : /proc/thread-self/cwd/static/adminhtml/Magento/backend/it_IT/Magento_Paypal/js/payflowpro/ |
| Current File : //proc/thread-self/cwd/static/adminhtml/Magento/backend/it_IT/Magento_Paypal/js/payflowpro/vault.js |
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/*browser:true*/
define([
'jquery',
'uiComponent'
], function ($, Class) {
'use strict';
return Class.extend({
defaults: {
$selector: null,
selector: 'edit_form'
},
/**
* Set list of observable attributes
* @returns {exports.initObservable}
*/
initObservable: function () {
var self = this;
self.$selector = $('#' + self.selector);
this._super();
this.initEventHandlers();
return this;
},
/**
* Get payment code
* @returns {String}
*/
getCode: function () {
return 'payflowpro';
},
/**
* Init event handlers
*/
initEventHandlers: function () {
$('#' + this.container).find('[name="payment[token_switcher]"]')
.on('click', this.setPaymentDetails.bind(this));
},
/**
* Store payment details
*/
setPaymentDetails: function () {
this.$selector.find('[name="payment[public_hash]"]').val(this.publicHash);
}
});
});