@paystack/checkout-js 1.26.0-dev.1 → 1.26.0-dev.10

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
  };
@@ -19831,42 +19833,48 @@ var Paystack = (function (exports) {
19831
19833
  });
19832
19834
  }
19833
19835
 
19836
+ var mobileMoney = {};
19837
+
19838
+ function mobileMoneyChargeAPI(params) {
19839
+ var _this = this;
19840
+
19841
+ return MobileMoneyAPI.charge(params).then(function (response) {
19842
+ if (response.status === 'success') {
19843
+ 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
+
19834
19854
  var MobileMoneyCharge = {
19835
19855
  chargeMobileMoney: function chargeMobileMoney(_ref) {
19836
- var _this = this;
19856
+ var _this2 = this;
19837
19857
 
19838
19858
  var phoneNumber = _ref.phoneNumber,
19839
19859
  provider = _ref.provider,
19840
19860
  voucher = _ref.voucher,
19841
19861
  registrationToken = _ref.registrationToken;
19842
19862
  return validate$1(phoneNumber).then(function () {
19843
- _this.logAttempt('mobile money');
19863
+ _this2.logAttempt('mobile money');
19844
19864
 
19845
19865
  var params = {
19846
19866
  provider: provider,
19847
19867
  voucher: voucher,
19848
19868
  registrationToken: registrationToken,
19849
- transaction: _this.id,
19869
+ transaction: _this2.id,
19850
19870
  phone: phoneNumber,
19851
- device: _this.deviceFingerprint,
19852
- channel_name: "MOBILE_MONEY_".concat(_this.id)
19871
+ device: _this2.deviceFingerprint,
19872
+ channel_name: "MOBILE_MONEY_".concat(_this2.id)
19853
19873
  };
19854
- return MobileMoneyAPI.charge(params).then(function (response) {
19855
- if (response.status === 'success') {
19856
- _this.mobileMoney = response;
19857
-
19858
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19859
- _this.logTokenRequest('mobile money');
19860
- }
19861
- }
19862
-
19863
- return response;
19864
- });
19874
+ return mobileMoneyChargeAPI(params);
19865
19875
  });
19866
19876
  },
19867
19877
  chargeMpesaOffline: function chargeMpesaOffline(_ref2) {
19868
- var _this2 = this;
19869
-
19870
19878
  var provider = _ref2.provider,
19871
19879
  voucher = _ref2.voucher,
19872
19880
  registrationToken = _ref2.registrationToken;
@@ -19876,21 +19884,10 @@ var Paystack = (function (exports) {
19876
19884
  voucher: voucher,
19877
19885
  registrationToken: registrationToken,
19878
19886
  transaction: this.id,
19879
- phone: null,
19880
19887
  device: this.deviceFingerprint,
19881
19888
  channel_name: "MOBILE_MONEY_".concat(this.id)
19882
19889
  };
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
- });
19890
+ return mobileMoneyChargeAPI(params);
19894
19891
  },
19895
19892
  authenticateMobileMoney: function authenticateMobileMoney(payload) {
19896
19893
  var _this3 = this;
@@ -19911,7 +19908,7 @@ var Paystack = (function (exports) {
19911
19908
  };
19912
19909
  return MobileMoneyAPI.charge(params).then(function (response) {
19913
19910
  if (response.status === 'success') {
19914
- _this3.mobileMoney = response;
19911
+ mobileMoney = response;
19915
19912
 
19916
19913
  if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19917
19914
  _this3.logTokenRequest('mobile money');
@@ -19939,7 +19936,7 @@ var Paystack = (function (exports) {
19939
19936
  });
19940
19937
  },
19941
19938
  listenForMobileMoneyCharge: function listenForMobileMoneyCharge(callback) {
19942
- if (this.mobileMoney.status !== 'success') {
19939
+ if (mobileMoney.status !== 'success') {
19943
19940
  return Promise.reject(Error('Please start a mobile money charge with Transaction.chargeMobileMoney()'));
19944
19941
  }
19945
19942
 
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
  };
@@ -19828,42 +19830,48 @@ function validate$1(phoneNumber) {
19828
19830
  });
19829
19831
  }
19830
19832
 
19833
+ var mobileMoney = {};
19834
+
19835
+ function mobileMoneyChargeAPI(params) {
19836
+ var _this = this;
19837
+
19838
+ return MobileMoneyAPI.charge(params).then(function (response) {
19839
+ if (response.status === 'success') {
19840
+ mobileMoney = response;
19841
+
19842
+ if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19843
+ _this.logTokenRequest('mobile money');
19844
+ }
19845
+ }
19846
+
19847
+ return response;
19848
+ });
19849
+ }
19850
+
19831
19851
  var MobileMoneyCharge = {
19832
19852
  chargeMobileMoney: function chargeMobileMoney(_ref) {
19833
- var _this = this;
19853
+ var _this2 = this;
19834
19854
 
19835
19855
  var phoneNumber = _ref.phoneNumber,
19836
19856
  provider = _ref.provider,
19837
19857
  voucher = _ref.voucher,
19838
19858
  registrationToken = _ref.registrationToken;
19839
19859
  return validate$1(phoneNumber).then(function () {
19840
- _this.logAttempt('mobile money');
19860
+ _this2.logAttempt('mobile money');
19841
19861
 
19842
19862
  var params = {
19843
19863
  provider: provider,
19844
19864
  voucher: voucher,
19845
19865
  registrationToken: registrationToken,
19846
- transaction: _this.id,
19866
+ transaction: _this2.id,
19847
19867
  phone: phoneNumber,
19848
- device: _this.deviceFingerprint,
19849
- channel_name: "MOBILE_MONEY_".concat(_this.id)
19868
+ device: _this2.deviceFingerprint,
19869
+ channel_name: "MOBILE_MONEY_".concat(_this2.id)
19850
19870
  };
19851
- return MobileMoneyAPI.charge(params).then(function (response) {
19852
- if (response.status === 'success') {
19853
- _this.mobileMoney = response;
19854
-
19855
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19856
- _this.logTokenRequest('mobile money');
19857
- }
19858
- }
19859
-
19860
- return response;
19861
- });
19871
+ return mobileMoneyChargeAPI(params);
19862
19872
  });
19863
19873
  },
19864
19874
  chargeMpesaOffline: function chargeMpesaOffline(_ref2) {
19865
- var _this2 = this;
19866
-
19867
19875
  var provider = _ref2.provider,
19868
19876
  voucher = _ref2.voucher,
19869
19877
  registrationToken = _ref2.registrationToken;
@@ -19873,21 +19881,10 @@ var MobileMoneyCharge = {
19873
19881
  voucher: voucher,
19874
19882
  registrationToken: registrationToken,
19875
19883
  transaction: this.id,
19876
- phone: null,
19877
19884
  device: this.deviceFingerprint,
19878
19885
  channel_name: "MOBILE_MONEY_".concat(this.id)
19879
19886
  };
19880
- return MobileMoneyAPI.charge(params).then(function (response) {
19881
- if (response.status === 'success') {
19882
- _this2.mobileMoney = response;
19883
-
19884
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19885
- _this2.logTokenRequest('mobile money');
19886
- }
19887
- }
19888
-
19889
- return response;
19890
- });
19887
+ return mobileMoneyChargeAPI(params);
19891
19888
  },
19892
19889
  authenticateMobileMoney: function authenticateMobileMoney(payload) {
19893
19890
  var _this3 = this;
@@ -19908,7 +19905,7 @@ var MobileMoneyCharge = {
19908
19905
  };
19909
19906
  return MobileMoneyAPI.charge(params).then(function (response) {
19910
19907
  if (response.status === 'success') {
19911
- _this3.mobileMoney = response;
19908
+ mobileMoney = response;
19912
19909
 
19913
19910
  if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19914
19911
  _this3.logTokenRequest('mobile money');
@@ -19936,7 +19933,7 @@ var MobileMoneyCharge = {
19936
19933
  });
19937
19934
  },
19938
19935
  listenForMobileMoneyCharge: function listenForMobileMoneyCharge(callback) {
19939
- if (this.mobileMoney.status !== 'success') {
19936
+ if (mobileMoney.status !== 'success') {
19940
19937
  return Promise.reject(Error('Please start a mobile money charge with Transaction.chargeMobileMoney()'));
19941
19938
  }
19942
19939
 
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
  };
@@ -19832,42 +19834,48 @@ function validate$1(phoneNumber) {
19832
19834
  });
19833
19835
  }
19834
19836
 
19837
+ var mobileMoney = {};
19838
+
19839
+ function mobileMoneyChargeAPI(params) {
19840
+ var _this = this;
19841
+
19842
+ return MobileMoneyAPI.charge(params).then(function (response) {
19843
+ if (response.status === 'success') {
19844
+ mobileMoney = response;
19845
+
19846
+ if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19847
+ _this.logTokenRequest('mobile money');
19848
+ }
19849
+ }
19850
+
19851
+ return response;
19852
+ });
19853
+ }
19854
+
19835
19855
  var MobileMoneyCharge = {
19836
19856
  chargeMobileMoney: function chargeMobileMoney(_ref) {
19837
- var _this = this;
19857
+ var _this2 = this;
19838
19858
 
19839
19859
  var phoneNumber = _ref.phoneNumber,
19840
19860
  provider = _ref.provider,
19841
19861
  voucher = _ref.voucher,
19842
19862
  registrationToken = _ref.registrationToken;
19843
19863
  return validate$1(phoneNumber).then(function () {
19844
- _this.logAttempt('mobile money');
19864
+ _this2.logAttempt('mobile money');
19845
19865
 
19846
19866
  var params = {
19847
19867
  provider: provider,
19848
19868
  voucher: voucher,
19849
19869
  registrationToken: registrationToken,
19850
- transaction: _this.id,
19870
+ transaction: _this2.id,
19851
19871
  phone: phoneNumber,
19852
- device: _this.deviceFingerprint,
19853
- channel_name: "MOBILE_MONEY_".concat(_this.id)
19872
+ device: _this2.deviceFingerprint,
19873
+ channel_name: "MOBILE_MONEY_".concat(_this2.id)
19854
19874
  };
19855
- return MobileMoneyAPI.charge(params).then(function (response) {
19856
- if (response.status === 'success') {
19857
- _this.mobileMoney = response;
19858
-
19859
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19860
- _this.logTokenRequest('mobile money');
19861
- }
19862
- }
19863
-
19864
- return response;
19865
- });
19875
+ return mobileMoneyChargeAPI(params);
19866
19876
  });
19867
19877
  },
19868
19878
  chargeMpesaOffline: function chargeMpesaOffline(_ref2) {
19869
- var _this2 = this;
19870
-
19871
19879
  var provider = _ref2.provider,
19872
19880
  voucher = _ref2.voucher,
19873
19881
  registrationToken = _ref2.registrationToken;
@@ -19877,21 +19885,10 @@ var MobileMoneyCharge = {
19877
19885
  voucher: voucher,
19878
19886
  registrationToken: registrationToken,
19879
19887
  transaction: this.id,
19880
- phone: null,
19881
19888
  device: this.deviceFingerprint,
19882
19889
  channel_name: "MOBILE_MONEY_".concat(this.id)
19883
19890
  };
19884
- return MobileMoneyAPI.charge(params).then(function (response) {
19885
- if (response.status === 'success') {
19886
- _this2.mobileMoney = response;
19887
-
19888
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19889
- _this2.logTokenRequest('mobile money');
19890
- }
19891
- }
19892
-
19893
- return response;
19894
- });
19891
+ return mobileMoneyChargeAPI(params);
19895
19892
  },
19896
19893
  authenticateMobileMoney: function authenticateMobileMoney(payload) {
19897
19894
  var _this3 = this;
@@ -19912,7 +19909,7 @@ var MobileMoneyCharge = {
19912
19909
  };
19913
19910
  return MobileMoneyAPI.charge(params).then(function (response) {
19914
19911
  if (response.status === 'success') {
19915
- _this3.mobileMoney = response;
19912
+ mobileMoney = response;
19916
19913
 
19917
19914
  if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19918
19915
  _this3.logTokenRequest('mobile money');
@@ -19940,7 +19937,7 @@ var MobileMoneyCharge = {
19940
19937
  });
19941
19938
  },
19942
19939
  listenForMobileMoneyCharge: function listenForMobileMoneyCharge(callback) {
19943
- if (this.mobileMoney.status !== 'success') {
19940
+ if (mobileMoney.status !== 'success') {
19944
19941
  return Promise.reject(Error('Please start a mobile money charge with Transaction.chargeMobileMoney()'));
19945
19942
  }
19946
19943
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.26.0-dev.1",
3
+ "version": "1.26.0-dev.10",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",