@paystack/checkout-js 1.26.0-dev.2 → 1.26.0-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/checkout.js CHANGED
@@ -19202,14 +19202,16 @@ var Paystack = (function (exports) {
19202
19202
  });
19203
19203
  },
19204
19204
  chargeSavedCard: function chargeSavedCard(_ref5) {
19205
- var cardCode = _ref5.cardCode;
19205
+ var cardCode = _ref5.cardCode,
19206
+ _ref5$selectedCurrenc = _ref5.selectedCurrency,
19207
+ selectedCurrency = _ref5$selectedCurrenc === void 0 ? this.currency : _ref5$selectedCurrenc;
19206
19208
  this.logAttempt(savedCardMethods.payment);
19207
19209
  return CardAPI$1.chargeSavedCard({
19208
19210
  cardCode: cardCode,
19209
19211
  transaction: this.id,
19210
19212
  token: this.savedCardsToken,
19211
19213
  device: this.deviceFingerprint,
19212
- selectedCurrency: this.currency
19214
+ selectedCurrency: selectedCurrency
19213
19215
  });
19214
19216
  }
19215
19217
  };
@@ -19832,41 +19834,45 @@ var Paystack = (function (exports) {
19832
19834
  }
19833
19835
 
19834
19836
  var MobileMoneyCharge = {
19835
- chargeMobileMoney: function chargeMobileMoney(_ref) {
19837
+ mobileMoneyChargeAPI: function mobileMoneyChargeAPI(params) {
19836
19838
  var _this = this;
19837
19839
 
19840
+ return MobileMoneyAPI.charge(params).then(function (response) {
19841
+ if (response.status === 'success') {
19842
+ _this.mobileMoney = response;
19843
+
19844
+ if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19845
+ _this.logTokenRequest('mobile money');
19846
+ }
19847
+ }
19848
+
19849
+ return response;
19850
+ });
19851
+ },
19852
+ chargeMobileMoney: function chargeMobileMoney(_ref) {
19853
+ var _this2 = this;
19854
+
19838
19855
  var phoneNumber = _ref.phoneNumber,
19839
19856
  provider = _ref.provider,
19840
19857
  voucher = _ref.voucher,
19841
19858
  registrationToken = _ref.registrationToken;
19842
19859
  return validate$1(phoneNumber).then(function () {
19843
- _this.logAttempt('mobile money');
19860
+ _this2.logAttempt('mobile money');
19844
19861
 
19845
19862
  var params = {
19846
19863
  provider: provider,
19847
19864
  voucher: voucher,
19848
19865
  registrationToken: registrationToken,
19849
- transaction: _this.id,
19866
+ transaction: _this2.id,
19850
19867
  phone: phoneNumber,
19851
- device: _this.deviceFingerprint,
19852
- channel_name: "MOBILE_MONEY_".concat(_this.id)
19868
+ device: _this2.deviceFingerprint,
19869
+ channel_name: "MOBILE_MONEY_".concat(_this2.id)
19853
19870
  };
19854
- return MobileMoneyAPI.charge(params).then(function (response) {
19855
- if (response.status === 'success') {
19856
- _this.mobileMoney = response;
19857
19871
 
19858
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19859
- _this.logTokenRequest('mobile money');
19860
- }
19861
- }
19862
-
19863
- return response;
19864
- });
19872
+ _this2.mobileMoneyChargeAPI(params);
19865
19873
  });
19866
19874
  },
19867
19875
  chargeMpesaOffline: function chargeMpesaOffline(_ref2) {
19868
- var _this2 = this;
19869
-
19870
19876
  var provider = _ref2.provider,
19871
19877
  voucher = _ref2.voucher,
19872
19878
  registrationToken = _ref2.registrationToken;
@@ -19879,17 +19885,7 @@ var Paystack = (function (exports) {
19879
19885
  device: this.deviceFingerprint,
19880
19886
  channel_name: "MOBILE_MONEY_".concat(this.id)
19881
19887
  };
19882
- return MobileMoneyAPI.charge(params).then(function (response) {
19883
- if (response.status === 'success') {
19884
- _this2.mobileMoney = response;
19885
-
19886
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19887
- _this2.logTokenRequest('mobile money');
19888
- }
19889
- }
19890
-
19891
- return response;
19892
- });
19888
+ this.mobileMoneyChargeAPI(params);
19893
19889
  },
19894
19890
  authenticateMobileMoney: function authenticateMobileMoney(payload) {
19895
19891
  var _this3 = this;
package/es/checkout.js CHANGED
@@ -19199,14 +19199,16 @@ var CardCharge = {
19199
19199
  });
19200
19200
  },
19201
19201
  chargeSavedCard: function chargeSavedCard(_ref5) {
19202
- var cardCode = _ref5.cardCode;
19202
+ var cardCode = _ref5.cardCode,
19203
+ _ref5$selectedCurrenc = _ref5.selectedCurrency,
19204
+ selectedCurrency = _ref5$selectedCurrenc === void 0 ? this.currency : _ref5$selectedCurrenc;
19203
19205
  this.logAttempt(savedCardMethods.payment);
19204
19206
  return CardAPI$1.chargeSavedCard({
19205
19207
  cardCode: cardCode,
19206
19208
  transaction: this.id,
19207
19209
  token: this.savedCardsToken,
19208
19210
  device: this.deviceFingerprint,
19209
- selectedCurrency: this.currency
19211
+ selectedCurrency: selectedCurrency
19210
19212
  });
19211
19213
  }
19212
19214
  };
@@ -19829,41 +19831,45 @@ function validate$1(phoneNumber) {
19829
19831
  }
19830
19832
 
19831
19833
  var MobileMoneyCharge = {
19832
- chargeMobileMoney: function chargeMobileMoney(_ref) {
19834
+ mobileMoneyChargeAPI: function mobileMoneyChargeAPI(params) {
19833
19835
  var _this = this;
19834
19836
 
19837
+ return MobileMoneyAPI.charge(params).then(function (response) {
19838
+ if (response.status === 'success') {
19839
+ _this.mobileMoney = response;
19840
+
19841
+ if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19842
+ _this.logTokenRequest('mobile money');
19843
+ }
19844
+ }
19845
+
19846
+ return response;
19847
+ });
19848
+ },
19849
+ chargeMobileMoney: function chargeMobileMoney(_ref) {
19850
+ var _this2 = this;
19851
+
19835
19852
  var phoneNumber = _ref.phoneNumber,
19836
19853
  provider = _ref.provider,
19837
19854
  voucher = _ref.voucher,
19838
19855
  registrationToken = _ref.registrationToken;
19839
19856
  return validate$1(phoneNumber).then(function () {
19840
- _this.logAttempt('mobile money');
19857
+ _this2.logAttempt('mobile money');
19841
19858
 
19842
19859
  var params = {
19843
19860
  provider: provider,
19844
19861
  voucher: voucher,
19845
19862
  registrationToken: registrationToken,
19846
- transaction: _this.id,
19863
+ transaction: _this2.id,
19847
19864
  phone: phoneNumber,
19848
- device: _this.deviceFingerprint,
19849
- channel_name: "MOBILE_MONEY_".concat(_this.id)
19865
+ device: _this2.deviceFingerprint,
19866
+ channel_name: "MOBILE_MONEY_".concat(_this2.id)
19850
19867
  };
19851
- return MobileMoneyAPI.charge(params).then(function (response) {
19852
- if (response.status === 'success') {
19853
- _this.mobileMoney = response;
19854
19868
 
19855
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19856
- _this.logTokenRequest('mobile money');
19857
- }
19858
- }
19859
-
19860
- return response;
19861
- });
19869
+ _this2.mobileMoneyChargeAPI(params);
19862
19870
  });
19863
19871
  },
19864
19872
  chargeMpesaOffline: function chargeMpesaOffline(_ref2) {
19865
- var _this2 = this;
19866
-
19867
19873
  var provider = _ref2.provider,
19868
19874
  voucher = _ref2.voucher,
19869
19875
  registrationToken = _ref2.registrationToken;
@@ -19876,17 +19882,7 @@ var MobileMoneyCharge = {
19876
19882
  device: this.deviceFingerprint,
19877
19883
  channel_name: "MOBILE_MONEY_".concat(this.id)
19878
19884
  };
19879
- return MobileMoneyAPI.charge(params).then(function (response) {
19880
- if (response.status === 'success') {
19881
- _this2.mobileMoney = response;
19882
-
19883
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19884
- _this2.logTokenRequest('mobile money');
19885
- }
19886
- }
19887
-
19888
- return response;
19889
- });
19885
+ this.mobileMoneyChargeAPI(params);
19890
19886
  },
19891
19887
  authenticateMobileMoney: function authenticateMobileMoney(payload) {
19892
19888
  var _this3 = this;
package/lib/checkout.js CHANGED
@@ -19203,14 +19203,16 @@ var CardCharge = {
19203
19203
  });
19204
19204
  },
19205
19205
  chargeSavedCard: function chargeSavedCard(_ref5) {
19206
- var cardCode = _ref5.cardCode;
19206
+ var cardCode = _ref5.cardCode,
19207
+ _ref5$selectedCurrenc = _ref5.selectedCurrency,
19208
+ selectedCurrency = _ref5$selectedCurrenc === void 0 ? this.currency : _ref5$selectedCurrenc;
19207
19209
  this.logAttempt(savedCardMethods.payment);
19208
19210
  return CardAPI$1.chargeSavedCard({
19209
19211
  cardCode: cardCode,
19210
19212
  transaction: this.id,
19211
19213
  token: this.savedCardsToken,
19212
19214
  device: this.deviceFingerprint,
19213
- selectedCurrency: this.currency
19215
+ selectedCurrency: selectedCurrency
19214
19216
  });
19215
19217
  }
19216
19218
  };
@@ -19833,41 +19835,45 @@ function validate$1(phoneNumber) {
19833
19835
  }
19834
19836
 
19835
19837
  var MobileMoneyCharge = {
19836
- chargeMobileMoney: function chargeMobileMoney(_ref) {
19838
+ mobileMoneyChargeAPI: function mobileMoneyChargeAPI(params) {
19837
19839
  var _this = this;
19838
19840
 
19841
+ return MobileMoneyAPI.charge(params).then(function (response) {
19842
+ if (response.status === 'success') {
19843
+ _this.mobileMoney = response;
19844
+
19845
+ if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19846
+ _this.logTokenRequest('mobile money');
19847
+ }
19848
+ }
19849
+
19850
+ return response;
19851
+ });
19852
+ },
19853
+ chargeMobileMoney: function chargeMobileMoney(_ref) {
19854
+ var _this2 = this;
19855
+
19839
19856
  var phoneNumber = _ref.phoneNumber,
19840
19857
  provider = _ref.provider,
19841
19858
  voucher = _ref.voucher,
19842
19859
  registrationToken = _ref.registrationToken;
19843
19860
  return validate$1(phoneNumber).then(function () {
19844
- _this.logAttempt('mobile money');
19861
+ _this2.logAttempt('mobile money');
19845
19862
 
19846
19863
  var params = {
19847
19864
  provider: provider,
19848
19865
  voucher: voucher,
19849
19866
  registrationToken: registrationToken,
19850
- transaction: _this.id,
19867
+ transaction: _this2.id,
19851
19868
  phone: phoneNumber,
19852
- device: _this.deviceFingerprint,
19853
- channel_name: "MOBILE_MONEY_".concat(_this.id)
19869
+ device: _this2.deviceFingerprint,
19870
+ channel_name: "MOBILE_MONEY_".concat(_this2.id)
19854
19871
  };
19855
- return MobileMoneyAPI.charge(params).then(function (response) {
19856
- if (response.status === 'success') {
19857
- _this.mobileMoney = response;
19858
19872
 
19859
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19860
- _this.logTokenRequest('mobile money');
19861
- }
19862
- }
19863
-
19864
- return response;
19865
- });
19873
+ _this2.mobileMoneyChargeAPI(params);
19866
19874
  });
19867
19875
  },
19868
19876
  chargeMpesaOffline: function chargeMpesaOffline(_ref2) {
19869
- var _this2 = this;
19870
-
19871
19877
  var provider = _ref2.provider,
19872
19878
  voucher = _ref2.voucher,
19873
19879
  registrationToken = _ref2.registrationToken;
@@ -19880,17 +19886,7 @@ var MobileMoneyCharge = {
19880
19886
  device: this.deviceFingerprint,
19881
19887
  channel_name: "MOBILE_MONEY_".concat(this.id)
19882
19888
  };
19883
- return MobileMoneyAPI.charge(params).then(function (response) {
19884
- if (response.status === 'success') {
19885
- _this2.mobileMoney = response;
19886
-
19887
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19888
- _this2.logTokenRequest('mobile money');
19889
- }
19890
- }
19891
-
19892
- return response;
19893
- });
19889
+ this.mobileMoneyChargeAPI(params);
19894
19890
  },
19895
19891
  authenticateMobileMoney: function authenticateMobileMoney(payload) {
19896
19892
  var _this3 = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.26.0-dev.2",
3
+ "version": "1.26.0-dev.4",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",