@paystack/checkout-js 1.52.0-beta.11 → 1.52.0-beta.12

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
@@ -19155,7 +19155,8 @@ var Paystack = (function (exports) {
19155
19155
  resumeCardCharge: function resumeCardCharge(_ref2) {
19156
19156
  var device = _ref2.device,
19157
19157
  accessCode = _ref2.accessCode,
19158
- pin = _ref2.pin;
19158
+ pin = _ref2.pin,
19159
+ customFields = _ref2.customFields;
19159
19160
  var url = "".concat(configToUse.paymentBaseUrl, "charge/resume/").concat(accessCode);
19160
19161
  var language = getLanguage();
19161
19162
  var headers = _objectSpread2({
@@ -19163,11 +19164,11 @@ var Paystack = (function (exports) {
19163
19164
  }, language && {
19164
19165
  'Accept-Language': language
19165
19166
  });
19166
- var data = _objectSpread2({
19167
+ var data = _objectSpread2(_objectSpread2({
19167
19168
  device: device
19168
19169
  }, pin && {
19169
19170
  handle: pin
19170
- });
19171
+ }), customFields && customFields);
19171
19172
  var urlEncodedData = formUrlencoded(data);
19172
19173
  return axiosInstance.post(url, urlEncodedData, {
19173
19174
  headers: headers
@@ -19589,12 +19590,15 @@ var Paystack = (function (exports) {
19589
19590
  resumeCardCharge: function resumeCardCharge(_ref2) {
19590
19591
  var _this5 = this;
19591
19592
  var accessCode = _ref2.accessCode,
19592
- pin = _ref2.pin;
19593
+ pin = _ref2.pin,
19594
+ _ref2$customFields = _ref2.customFields,
19595
+ customFields = _ref2$customFields === void 0 ? {} : _ref2$customFields;
19593
19596
  var params = _objectSpread2(_objectSpread2({}, pin && {
19594
19597
  pin: encrypt(pin)
19595
19598
  }), {}, {
19596
19599
  accessCode: accessCode,
19597
- device: this.deviceFingerprint
19600
+ device: this.deviceFingerprint,
19601
+ customFields: customFields
19598
19602
  });
19599
19603
  return CardAPI$1.resumeCardCharge(params).then(function (response) {
19600
19604
  _this5.logAPIResponse(response, paymentMethod$5);
@@ -21691,6 +21695,7 @@ var Paystack = (function (exports) {
21691
21695
  this.subscription = data.subscription || null;
21692
21696
  this.planDetails = data.plan_details || null;
21693
21697
  this.exchangeRate = data.exchange_rate || null;
21698
+ this.preChargeCheckEnabled = data.pre_charge_check_enabled || false;
21694
21699
  this.savedCardsConfig = data.saved_cards || {};
21695
21700
  this.supportedBanks = data.supported_banks || [];
21696
21701
  this.isWhiteLabeled = data.whitelabel || null;
@@ -21985,9 +21990,24 @@ var Paystack = (function (exports) {
21985
21990
  return data;
21986
21991
  });
21987
21992
  },
21988
- fetchCountries: function fetchCountries(_ref2) {
21989
- var scope = _ref2.scope,
21990
- merchantKey = _ref2.merchantKey;
21993
+ preChargeCheck: function preChargeCheck(bin, transactionId) {
21994
+ var url = new URL("/transaction/pre_charge_check/".concat(bin), configToUse.paystackApiUrl).toString();
21995
+ var language = getLanguage();
21996
+ var headers = _objectSpread2({}, language && {
21997
+ 'Accept-Language': language
21998
+ });
21999
+ return axiosInstance.post(url, {
22000
+ transaction_id: transactionId
22001
+ }, {
22002
+ headers: headers
22003
+ }).then(function (_ref2) {
22004
+ var data = _ref2.data;
22005
+ return data;
22006
+ });
22007
+ },
22008
+ fetchCountries: function fetchCountries(_ref3) {
22009
+ var scope = _ref3.scope,
22010
+ merchantKey = _ref3.merchantKey;
21991
22011
  var url = new URL('/address/country', configToUse.paystackApiUrl).toString();
21992
22012
  var language = getLanguage();
21993
22013
  var headers = _objectSpread2({
@@ -22005,9 +22025,9 @@ var Paystack = (function (exports) {
22005
22025
  return response.data;
22006
22026
  });
22007
22027
  },
22008
- fetchReachStates: function fetchReachStates(_ref3) {
22009
- var country = _ref3.country,
22010
- merchantKey = _ref3.merchantKey;
22028
+ fetchReachStates: function fetchReachStates(_ref4) {
22029
+ var country = _ref4.country,
22030
+ merchantKey = _ref4.merchantKey;
22011
22031
  var url = new URL("/address/country/".concat(country, "/state"), configToUse.paystackApiUrl).toString();
22012
22032
  var language = getLanguage();
22013
22033
  var headers = _objectSpread2({
@@ -22089,6 +22109,11 @@ var Paystack = (function (exports) {
22089
22109
  value: function resolveCardBin(bin) {
22090
22110
  return ToolkitAPI.resolveCardBin(bin);
22091
22111
  }
22112
+ }, {
22113
+ key: "preChargeCheck",
22114
+ value: function preChargeCheck(bin, transactionId) {
22115
+ return ToolkitAPI.preChargeCheck(bin, transactionId);
22116
+ }
22092
22117
  }]);
22093
22118
  return Toolkit;
22094
22119
  }();
package/es/checkout.js CHANGED
@@ -19152,7 +19152,8 @@ var CardAPI$1 = {
19152
19152
  resumeCardCharge: function resumeCardCharge(_ref2) {
19153
19153
  var device = _ref2.device,
19154
19154
  accessCode = _ref2.accessCode,
19155
- pin = _ref2.pin;
19155
+ pin = _ref2.pin,
19156
+ customFields = _ref2.customFields;
19156
19157
  var url = "".concat(configToUse.paymentBaseUrl, "charge/resume/").concat(accessCode);
19157
19158
  var language = getLanguage();
19158
19159
  var headers = _objectSpread2({
@@ -19160,11 +19161,11 @@ var CardAPI$1 = {
19160
19161
  }, language && {
19161
19162
  'Accept-Language': language
19162
19163
  });
19163
- var data = _objectSpread2({
19164
+ var data = _objectSpread2(_objectSpread2({
19164
19165
  device: device
19165
19166
  }, pin && {
19166
19167
  handle: pin
19167
- });
19168
+ }), customFields && customFields);
19168
19169
  var urlEncodedData = formUrlencoded(data);
19169
19170
  return axiosInstance.post(url, urlEncodedData, {
19170
19171
  headers: headers
@@ -19586,12 +19587,15 @@ var CardCharge = {
19586
19587
  resumeCardCharge: function resumeCardCharge(_ref2) {
19587
19588
  var _this5 = this;
19588
19589
  var accessCode = _ref2.accessCode,
19589
- pin = _ref2.pin;
19590
+ pin = _ref2.pin,
19591
+ _ref2$customFields = _ref2.customFields,
19592
+ customFields = _ref2$customFields === void 0 ? {} : _ref2$customFields;
19590
19593
  var params = _objectSpread2(_objectSpread2({}, pin && {
19591
19594
  pin: encrypt(pin)
19592
19595
  }), {}, {
19593
19596
  accessCode: accessCode,
19594
- device: this.deviceFingerprint
19597
+ device: this.deviceFingerprint,
19598
+ customFields: customFields
19595
19599
  });
19596
19600
  return CardAPI$1.resumeCardCharge(params).then(function (response) {
19597
19601
  _this5.logAPIResponse(response, paymentMethod$5);
@@ -21688,6 +21692,7 @@ var TransactionInstance = /*#__PURE__*/function () {
21688
21692
  this.subscription = data.subscription || null;
21689
21693
  this.planDetails = data.plan_details || null;
21690
21694
  this.exchangeRate = data.exchange_rate || null;
21695
+ this.preChargeCheckEnabled = data.pre_charge_check_enabled || false;
21691
21696
  this.savedCardsConfig = data.saved_cards || {};
21692
21697
  this.supportedBanks = data.supported_banks || [];
21693
21698
  this.isWhiteLabeled = data.whitelabel || null;
@@ -21982,9 +21987,24 @@ var ToolkitAPI = {
21982
21987
  return data;
21983
21988
  });
21984
21989
  },
21985
- fetchCountries: function fetchCountries(_ref2) {
21986
- var scope = _ref2.scope,
21987
- merchantKey = _ref2.merchantKey;
21990
+ preChargeCheck: function preChargeCheck(bin, transactionId) {
21991
+ var url = new URL("/transaction/pre_charge_check/".concat(bin), configToUse.paystackApiUrl).toString();
21992
+ var language = getLanguage();
21993
+ var headers = _objectSpread2({}, language && {
21994
+ 'Accept-Language': language
21995
+ });
21996
+ return axiosInstance.post(url, {
21997
+ transaction_id: transactionId
21998
+ }, {
21999
+ headers: headers
22000
+ }).then(function (_ref2) {
22001
+ var data = _ref2.data;
22002
+ return data;
22003
+ });
22004
+ },
22005
+ fetchCountries: function fetchCountries(_ref3) {
22006
+ var scope = _ref3.scope,
22007
+ merchantKey = _ref3.merchantKey;
21988
22008
  var url = new URL('/address/country', configToUse.paystackApiUrl).toString();
21989
22009
  var language = getLanguage();
21990
22010
  var headers = _objectSpread2({
@@ -22002,9 +22022,9 @@ var ToolkitAPI = {
22002
22022
  return response.data;
22003
22023
  });
22004
22024
  },
22005
- fetchReachStates: function fetchReachStates(_ref3) {
22006
- var country = _ref3.country,
22007
- merchantKey = _ref3.merchantKey;
22025
+ fetchReachStates: function fetchReachStates(_ref4) {
22026
+ var country = _ref4.country,
22027
+ merchantKey = _ref4.merchantKey;
22008
22028
  var url = new URL("/address/country/".concat(country, "/state"), configToUse.paystackApiUrl).toString();
22009
22029
  var language = getLanguage();
22010
22030
  var headers = _objectSpread2({
@@ -22086,6 +22106,11 @@ var Toolkit = /*#__PURE__*/function () {
22086
22106
  value: function resolveCardBin(bin) {
22087
22107
  return ToolkitAPI.resolveCardBin(bin);
22088
22108
  }
22109
+ }, {
22110
+ key: "preChargeCheck",
22111
+ value: function preChargeCheck(bin, transactionId) {
22112
+ return ToolkitAPI.preChargeCheck(bin, transactionId);
22113
+ }
22089
22114
  }]);
22090
22115
  return Toolkit;
22091
22116
  }();
package/lib/checkout.js CHANGED
@@ -19156,7 +19156,8 @@ var CardAPI$1 = {
19156
19156
  resumeCardCharge: function resumeCardCharge(_ref2) {
19157
19157
  var device = _ref2.device,
19158
19158
  accessCode = _ref2.accessCode,
19159
- pin = _ref2.pin;
19159
+ pin = _ref2.pin,
19160
+ customFields = _ref2.customFields;
19160
19161
  var url = "".concat(configToUse.paymentBaseUrl, "charge/resume/").concat(accessCode);
19161
19162
  var language = getLanguage();
19162
19163
  var headers = _objectSpread2({
@@ -19164,11 +19165,11 @@ var CardAPI$1 = {
19164
19165
  }, language && {
19165
19166
  'Accept-Language': language
19166
19167
  });
19167
- var data = _objectSpread2({
19168
+ var data = _objectSpread2(_objectSpread2({
19168
19169
  device: device
19169
19170
  }, pin && {
19170
19171
  handle: pin
19171
- });
19172
+ }), customFields && customFields);
19172
19173
  var urlEncodedData = formUrlencoded(data);
19173
19174
  return axiosInstance.post(url, urlEncodedData, {
19174
19175
  headers: headers
@@ -19590,12 +19591,15 @@ var CardCharge = {
19590
19591
  resumeCardCharge: function resumeCardCharge(_ref2) {
19591
19592
  var _this5 = this;
19592
19593
  var accessCode = _ref2.accessCode,
19593
- pin = _ref2.pin;
19594
+ pin = _ref2.pin,
19595
+ _ref2$customFields = _ref2.customFields,
19596
+ customFields = _ref2$customFields === void 0 ? {} : _ref2$customFields;
19594
19597
  var params = _objectSpread2(_objectSpread2({}, pin && {
19595
19598
  pin: encrypt(pin)
19596
19599
  }), {}, {
19597
19600
  accessCode: accessCode,
19598
- device: this.deviceFingerprint
19601
+ device: this.deviceFingerprint,
19602
+ customFields: customFields
19599
19603
  });
19600
19604
  return CardAPI$1.resumeCardCharge(params).then(function (response) {
19601
19605
  _this5.logAPIResponse(response, paymentMethod$5);
@@ -21692,6 +21696,7 @@ var TransactionInstance = /*#__PURE__*/function () {
21692
21696
  this.subscription = data.subscription || null;
21693
21697
  this.planDetails = data.plan_details || null;
21694
21698
  this.exchangeRate = data.exchange_rate || null;
21699
+ this.preChargeCheckEnabled = data.pre_charge_check_enabled || false;
21695
21700
  this.savedCardsConfig = data.saved_cards || {};
21696
21701
  this.supportedBanks = data.supported_banks || [];
21697
21702
  this.isWhiteLabeled = data.whitelabel || null;
@@ -21986,9 +21991,24 @@ var ToolkitAPI = {
21986
21991
  return data;
21987
21992
  });
21988
21993
  },
21989
- fetchCountries: function fetchCountries(_ref2) {
21990
- var scope = _ref2.scope,
21991
- merchantKey = _ref2.merchantKey;
21994
+ preChargeCheck: function preChargeCheck(bin, transactionId) {
21995
+ var url = new URL("/transaction/pre_charge_check/".concat(bin), configToUse.paystackApiUrl).toString();
21996
+ var language = getLanguage();
21997
+ var headers = _objectSpread2({}, language && {
21998
+ 'Accept-Language': language
21999
+ });
22000
+ return axiosInstance.post(url, {
22001
+ transaction_id: transactionId
22002
+ }, {
22003
+ headers: headers
22004
+ }).then(function (_ref2) {
22005
+ var data = _ref2.data;
22006
+ return data;
22007
+ });
22008
+ },
22009
+ fetchCountries: function fetchCountries(_ref3) {
22010
+ var scope = _ref3.scope,
22011
+ merchantKey = _ref3.merchantKey;
21992
22012
  var url = new URL('/address/country', configToUse.paystackApiUrl).toString();
21993
22013
  var language = getLanguage();
21994
22014
  var headers = _objectSpread2({
@@ -22006,9 +22026,9 @@ var ToolkitAPI = {
22006
22026
  return response.data;
22007
22027
  });
22008
22028
  },
22009
- fetchReachStates: function fetchReachStates(_ref3) {
22010
- var country = _ref3.country,
22011
- merchantKey = _ref3.merchantKey;
22029
+ fetchReachStates: function fetchReachStates(_ref4) {
22030
+ var country = _ref4.country,
22031
+ merchantKey = _ref4.merchantKey;
22012
22032
  var url = new URL("/address/country/".concat(country, "/state"), configToUse.paystackApiUrl).toString();
22013
22033
  var language = getLanguage();
22014
22034
  var headers = _objectSpread2({
@@ -22090,6 +22110,11 @@ var Toolkit = /*#__PURE__*/function () {
22090
22110
  value: function resolveCardBin(bin) {
22091
22111
  return ToolkitAPI.resolveCardBin(bin);
22092
22112
  }
22113
+ }, {
22114
+ key: "preChargeCheck",
22115
+ value: function preChargeCheck(bin, transactionId) {
22116
+ return ToolkitAPI.preChargeCheck(bin, transactionId);
22117
+ }
22093
22118
  }]);
22094
22119
  return Toolkit;
22095
22120
  }();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.52.0-beta.11",
3
+ "version": "1.52.0-beta.12",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",