Skip to content

Commit

Permalink
0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Sep 7, 2017
1 parent 904945d commit 79f34a8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/qiwi"
,"version": "0.2.0"
,"version": "0.2.1"
,"description": "The «Visa QIWI Wallet» (QIWI Кошелёк) payment extension for Magento 2."
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/qiwi"
Expand All @@ -11,7 +11,7 @@
"homepage": "https://mage2.pro/users/dmitry_fedyuk",
"role": "Developer"
}]
,"require": {"mage2pro/core": ">=2.11.23", "mage2pro/phone": ">=1.0.5"}
,"require": {"mage2pro/core": ">=2.11.25", "mage2pro/phone": ">=1.0.6"}
,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\Qiwi\\": ""}}
,"keywords": [
"API"
Expand Down
30 changes: 26 additions & 4 deletions view/frontend/web/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 2017-09-06
define([
'Df_Payment/custom'
], function(parent) {'use strict';
'df', 'Df_Payment/billingAddressChange', 'Df_Payment/custom', 'jquery'
], function(df, baChange, parent, $) {'use strict';
/** 2017-09-06 @uses Class::extend() https://github.com/magento/magento2/blob/2.2.0-rc2.3/app/code/Magento/Ui/view/base/web/js/lib/core/class.js#L106-L140 */
return parent.extend({
defaults: {df: {formTemplate: 'Dfe_Qiwi/main'}, phone: ''},
Expand All @@ -16,14 +16,36 @@ return parent.extend({
* @see Df_Payment/mixin::dfData()
* @returns {Object}
*/
dfData: function() {return df.o.merge(this._super(), {phone: this.phone()});},
dfData: function() {return df.o.merge(this._super(), {phone: df.s.normalizePhone(this.phone())});},
/**
* 2017-09-06
* @override
* @see Df_Payment/custom::initialize()
* @returns {exports}
*/
initialize: function() {this._super(); this.phone('+552131398000'); return this;},
initialize: function() {
this._super();
/** @type {Object} */ var c = window.checkoutConfig.customerData;
var _this = this;
baChange(function(a) {
var newValue = null;
if (a.telephone && a.telephone.length) {
newValue = a.telephone;
}
else if (c && c.telephone && c.telephone.length) {
newValue = c.telephone;
}
if (newValue) {
newValue = df.s.normalizePhone(newValue);
_this.phone(newValue);
var $form = _this.dfForm();
if ($form) {
$('[type=tel]', $form).intlTelInput('setNumber', newValue);
}
}
});
return this;
},
/**
* 2017-09-06 The method should return `this` because it is used in a chain:
* this._super()
Expand Down

0 comments on commit 79f34a8

Please sign in to comment.