@paystack/checkout-js 1.26.0 → 1.27.0

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/es/checkout.js CHANGED
@@ -19774,66 +19774,86 @@ function validate$1(phoneNumber) {
19774
19774
  }
19775
19775
 
19776
19776
  var MobileMoneyCharge = {
19777
- chargeMobileMoney: function chargeMobileMoney(_ref) {
19777
+ mobileMoneyChargeAPI: function mobileMoneyChargeAPI(params) {
19778
19778
  var _this = this;
19779
19779
 
19780
+ return MobileMoneyAPI.charge(params).then(function (response) {
19781
+ if (response.status === 'success') {
19782
+ _this.mobileMoney = response;
19783
+
19784
+ if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19785
+ _this.logTokenRequest('mobile money');
19786
+ }
19787
+ }
19788
+
19789
+ return response;
19790
+ });
19791
+ },
19792
+ chargeMobileMoney: function chargeMobileMoney(_ref) {
19793
+ var _this2 = this;
19794
+
19780
19795
  var phoneNumber = _ref.phoneNumber,
19781
19796
  provider = _ref.provider,
19782
19797
  voucher = _ref.voucher,
19783
19798
  registrationToken = _ref.registrationToken;
19784
19799
  return validate$1(phoneNumber).then(function () {
19785
- _this.logAttempt('mobile money');
19800
+ _this2.logAttempt('mobile money');
19786
19801
 
19787
19802
  var params = {
19788
19803
  provider: provider,
19789
19804
  voucher: voucher,
19790
19805
  registrationToken: registrationToken,
19791
- transaction: _this.id,
19806
+ transaction: _this2.id,
19792
19807
  phone: phoneNumber,
19793
- device: _this.deviceFingerprint,
19794
- channel_name: "MOBILE_MONEY_".concat(_this.id)
19808
+ device: _this2.deviceFingerprint,
19809
+ channel_name: "MOBILE_MONEY_".concat(_this2.id)
19795
19810
  };
19796
- return MobileMoneyAPI.charge(params).then(function (response) {
19797
- if (response.status === 'success') {
19798
- _this.mobileMoney = response;
19799
-
19800
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19801
- _this.logTokenRequest('mobile money');
19802
- }
19803
- }
19804
-
19805
- return response;
19806
- });
19811
+ return _this2.mobileMoneyChargeAPI(params);
19807
19812
  });
19808
19813
  },
19814
+ chargeMpesaOffline: function chargeMpesaOffline(_ref2) {
19815
+ var provider = _ref2.provider,
19816
+ voucher = _ref2.voucher,
19817
+ registrationToken = _ref2.registrationToken;
19818
+ this.logAttempt('mobile money');
19819
+ var params = {
19820
+ provider: provider,
19821
+ voucher: voucher,
19822
+ registrationToken: registrationToken,
19823
+ transaction: this.id,
19824
+ device: this.deviceFingerprint,
19825
+ channel_name: "MOBILE_MONEY_".concat(this.id)
19826
+ };
19827
+ return this.mobileMoneyChargeAPI(params);
19828
+ },
19809
19829
  authenticateMobileMoney: function authenticateMobileMoney(payload) {
19810
- var _this2 = this;
19830
+ var _this3 = this;
19811
19831
 
19812
19832
  var phoneNumber = payload.phoneNumber,
19813
19833
  provider = payload.provider,
19814
19834
  registrationToken = payload.registrationToken;
19815
19835
  return validate$1(phoneNumber).then(function () {
19816
- _this2.logMobileMoneyActions(payload);
19836
+ _this3.logMobileMoneyActions(payload);
19817
19837
 
19818
19838
  var params = {
19819
19839
  provider: provider,
19820
19840
  registrationToken: registrationToken,
19821
- transaction: _this2.id,
19841
+ transaction: _this3.id,
19822
19842
  phone: phoneNumber,
19823
- device: _this2.deviceFingerprint,
19824
- channel_name: "MOBILE_MONEY_".concat(_this2.id)
19843
+ device: _this3.deviceFingerprint,
19844
+ channel_name: "MOBILE_MONEY_".concat(_this3.id)
19825
19845
  };
19826
19846
  return MobileMoneyAPI.charge(params).then(function (response) {
19827
19847
  if (response.status === 'success') {
19828
- _this2.mobileMoney = response;
19848
+ _this3.mobileMoney = response;
19829
19849
 
19830
19850
  if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19831
- _this2.logTokenRequest('mobile money');
19851
+ _this3.logTokenRequest('mobile money');
19832
19852
  }
19833
19853
  } else if (response.errors && response.errors.data && response.errors.data.status === 'awaiting_registration_token') {
19834
- _this2.logTokenAuthenticationFailure(response.message);
19854
+ _this3.logTokenAuthenticationFailure(response.message);
19835
19855
  } else {
19836
- _this2.logError(response.message);
19856
+ _this3.logError(response.message);
19837
19857
  }
19838
19858
 
19839
19859
  return response;
@@ -19841,13 +19861,13 @@ var MobileMoneyCharge = {
19841
19861
  });
19842
19862
  },
19843
19863
  submitMobileMoneyCode: function submitMobileMoneyCode(payload) {
19844
- var _this3 = this;
19864
+ var _this4 = this;
19845
19865
 
19846
19866
  return MobileMoneyAPI.submitCode({
19847
19867
  code: payload.code,
19848
19868
  transaction: this.id
19849
19869
  }).then(function (response) {
19850
- _this3.logAPIResponse(response, 'mobile_money');
19870
+ _this4.logAPIResponse(response, 'mobile_money');
19851
19871
 
19852
19872
  return response;
19853
19873
  });
package/lib/checkout.js CHANGED
@@ -19778,66 +19778,86 @@ function validate$1(phoneNumber) {
19778
19778
  }
19779
19779
 
19780
19780
  var MobileMoneyCharge = {
19781
- chargeMobileMoney: function chargeMobileMoney(_ref) {
19781
+ mobileMoneyChargeAPI: function mobileMoneyChargeAPI(params) {
19782
19782
  var _this = this;
19783
19783
 
19784
+ return MobileMoneyAPI.charge(params).then(function (response) {
19785
+ if (response.status === 'success') {
19786
+ _this.mobileMoney = response;
19787
+
19788
+ if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19789
+ _this.logTokenRequest('mobile money');
19790
+ }
19791
+ }
19792
+
19793
+ return response;
19794
+ });
19795
+ },
19796
+ chargeMobileMoney: function chargeMobileMoney(_ref) {
19797
+ var _this2 = this;
19798
+
19784
19799
  var phoneNumber = _ref.phoneNumber,
19785
19800
  provider = _ref.provider,
19786
19801
  voucher = _ref.voucher,
19787
19802
  registrationToken = _ref.registrationToken;
19788
19803
  return validate$1(phoneNumber).then(function () {
19789
- _this.logAttempt('mobile money');
19804
+ _this2.logAttempt('mobile money');
19790
19805
 
19791
19806
  var params = {
19792
19807
  provider: provider,
19793
19808
  voucher: voucher,
19794
19809
  registrationToken: registrationToken,
19795
- transaction: _this.id,
19810
+ transaction: _this2.id,
19796
19811
  phone: phoneNumber,
19797
- device: _this.deviceFingerprint,
19798
- channel_name: "MOBILE_MONEY_".concat(_this.id)
19812
+ device: _this2.deviceFingerprint,
19813
+ channel_name: "MOBILE_MONEY_".concat(_this2.id)
19799
19814
  };
19800
- return MobileMoneyAPI.charge(params).then(function (response) {
19801
- if (response.status === 'success') {
19802
- _this.mobileMoney = response;
19803
-
19804
- if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19805
- _this.logTokenRequest('mobile money');
19806
- }
19807
- }
19808
-
19809
- return response;
19810
- });
19815
+ return _this2.mobileMoneyChargeAPI(params);
19811
19816
  });
19812
19817
  },
19818
+ chargeMpesaOffline: function chargeMpesaOffline(_ref2) {
19819
+ var provider = _ref2.provider,
19820
+ voucher = _ref2.voucher,
19821
+ registrationToken = _ref2.registrationToken;
19822
+ this.logAttempt('mobile money');
19823
+ var params = {
19824
+ provider: provider,
19825
+ voucher: voucher,
19826
+ registrationToken: registrationToken,
19827
+ transaction: this.id,
19828
+ device: this.deviceFingerprint,
19829
+ channel_name: "MOBILE_MONEY_".concat(this.id)
19830
+ };
19831
+ return this.mobileMoneyChargeAPI(params);
19832
+ },
19813
19833
  authenticateMobileMoney: function authenticateMobileMoney(payload) {
19814
- var _this2 = this;
19834
+ var _this3 = this;
19815
19835
 
19816
19836
  var phoneNumber = payload.phoneNumber,
19817
19837
  provider = payload.provider,
19818
19838
  registrationToken = payload.registrationToken;
19819
19839
  return validate$1(phoneNumber).then(function () {
19820
- _this2.logMobileMoneyActions(payload);
19840
+ _this3.logMobileMoneyActions(payload);
19821
19841
 
19822
19842
  var params = {
19823
19843
  provider: provider,
19824
19844
  registrationToken: registrationToken,
19825
- transaction: _this2.id,
19845
+ transaction: _this3.id,
19826
19846
  phone: phoneNumber,
19827
- device: _this2.deviceFingerprint,
19828
- channel_name: "MOBILE_MONEY_".concat(_this2.id)
19847
+ device: _this3.deviceFingerprint,
19848
+ channel_name: "MOBILE_MONEY_".concat(_this3.id)
19829
19849
  };
19830
19850
  return MobileMoneyAPI.charge(params).then(function (response) {
19831
19851
  if (response.status === 'success') {
19832
- _this2.mobileMoney = response;
19852
+ _this3.mobileMoney = response;
19833
19853
 
19834
19854
  if (response.data && response.data.display && response.data.display.otpSentCount === 1) {
19835
- _this2.logTokenRequest('mobile money');
19855
+ _this3.logTokenRequest('mobile money');
19836
19856
  }
19837
19857
  } else if (response.errors && response.errors.data && response.errors.data.status === 'awaiting_registration_token') {
19838
- _this2.logTokenAuthenticationFailure(response.message);
19858
+ _this3.logTokenAuthenticationFailure(response.message);
19839
19859
  } else {
19840
- _this2.logError(response.message);
19860
+ _this3.logError(response.message);
19841
19861
  }
19842
19862
 
19843
19863
  return response;
@@ -19845,13 +19865,13 @@ var MobileMoneyCharge = {
19845
19865
  });
19846
19866
  },
19847
19867
  submitMobileMoneyCode: function submitMobileMoneyCode(payload) {
19848
- var _this3 = this;
19868
+ var _this4 = this;
19849
19869
 
19850
19870
  return MobileMoneyAPI.submitCode({
19851
19871
  code: payload.code,
19852
19872
  transaction: this.id
19853
19873
  }).then(function (response) {
19854
- _this3.logAPIResponse(response, 'mobile_money');
19874
+ _this4.logAPIResponse(response, 'mobile_money');
19855
19875
 
19856
19876
  return response;
19857
19877
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",