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

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
@@ -21990,24 +21990,29 @@ var Paystack = (function (exports) {
21990
21990
  return data;
21991
21991
  });
21992
21992
  },
21993
- preChargeCheck: function preChargeCheck(bin, transactionId) {
21993
+ preChargeCheck: function preChargeCheck(_ref2) {
21994
+ var bin = _ref2.bin,
21995
+ transactionId = _ref2.transactionId,
21996
+ merchantKey = _ref2.merchantKey;
21994
21997
  var url = new URL("/transaction/pre_charge_check/".concat(bin), configToUse.paystackApiUrl).toString();
21995
21998
  var language = getLanguage();
21996
- var headers = _objectSpread2({}, language && {
21999
+ var headers = _objectSpread2({
22000
+ Authorization: "Bearer ".concat(merchantKey)
22001
+ }, language && {
21997
22002
  'Accept-Language': language
21998
22003
  });
21999
22004
  return axiosInstance.post(url, {
22000
22005
  transaction_id: transactionId
22001
22006
  }, {
22002
22007
  headers: headers
22003
- }).then(function (_ref2) {
22004
- var data = _ref2.data;
22008
+ }).then(function (_ref3) {
22009
+ var data = _ref3.data;
22005
22010
  return data;
22006
22011
  });
22007
22012
  },
22008
- fetchCountries: function fetchCountries(_ref3) {
22009
- var scope = _ref3.scope,
22010
- merchantKey = _ref3.merchantKey;
22013
+ fetchCountries: function fetchCountries(_ref4) {
22014
+ var scope = _ref4.scope,
22015
+ merchantKey = _ref4.merchantKey;
22011
22016
  var url = new URL('/address/country', configToUse.paystackApiUrl).toString();
22012
22017
  var language = getLanguage();
22013
22018
  var headers = _objectSpread2({
@@ -22025,9 +22030,9 @@ var Paystack = (function (exports) {
22025
22030
  return response.data;
22026
22031
  });
22027
22032
  },
22028
- fetchReachStates: function fetchReachStates(_ref4) {
22029
- var country = _ref4.country,
22030
- merchantKey = _ref4.merchantKey;
22033
+ fetchReachStates: function fetchReachStates(_ref5) {
22034
+ var country = _ref5.country,
22035
+ merchantKey = _ref5.merchantKey;
22031
22036
  var url = new URL("/address/country/".concat(country, "/state"), configToUse.paystackApiUrl).toString();
22032
22037
  var language = getLanguage();
22033
22038
  var headers = _objectSpread2({
@@ -22111,8 +22116,8 @@ var Paystack = (function (exports) {
22111
22116
  }
22112
22117
  }, {
22113
22118
  key: "preChargeCheck",
22114
- value: function preChargeCheck(bin, transactionId) {
22115
- return ToolkitAPI.preChargeCheck(bin, transactionId);
22119
+ value: function preChargeCheck(params) {
22120
+ return ToolkitAPI.preChargeCheck(params);
22116
22121
  }
22117
22122
  }]);
22118
22123
  return Toolkit;
package/es/checkout.js CHANGED
@@ -21987,24 +21987,29 @@ var ToolkitAPI = {
21987
21987
  return data;
21988
21988
  });
21989
21989
  },
21990
- preChargeCheck: function preChargeCheck(bin, transactionId) {
21990
+ preChargeCheck: function preChargeCheck(_ref2) {
21991
+ var bin = _ref2.bin,
21992
+ transactionId = _ref2.transactionId,
21993
+ merchantKey = _ref2.merchantKey;
21991
21994
  var url = new URL("/transaction/pre_charge_check/".concat(bin), configToUse.paystackApiUrl).toString();
21992
21995
  var language = getLanguage();
21993
- var headers = _objectSpread2({}, language && {
21996
+ var headers = _objectSpread2({
21997
+ Authorization: "Bearer ".concat(merchantKey)
21998
+ }, language && {
21994
21999
  'Accept-Language': language
21995
22000
  });
21996
22001
  return axiosInstance.post(url, {
21997
22002
  transaction_id: transactionId
21998
22003
  }, {
21999
22004
  headers: headers
22000
- }).then(function (_ref2) {
22001
- var data = _ref2.data;
22005
+ }).then(function (_ref3) {
22006
+ var data = _ref3.data;
22002
22007
  return data;
22003
22008
  });
22004
22009
  },
22005
- fetchCountries: function fetchCountries(_ref3) {
22006
- var scope = _ref3.scope,
22007
- merchantKey = _ref3.merchantKey;
22010
+ fetchCountries: function fetchCountries(_ref4) {
22011
+ var scope = _ref4.scope,
22012
+ merchantKey = _ref4.merchantKey;
22008
22013
  var url = new URL('/address/country', configToUse.paystackApiUrl).toString();
22009
22014
  var language = getLanguage();
22010
22015
  var headers = _objectSpread2({
@@ -22022,9 +22027,9 @@ var ToolkitAPI = {
22022
22027
  return response.data;
22023
22028
  });
22024
22029
  },
22025
- fetchReachStates: function fetchReachStates(_ref4) {
22026
- var country = _ref4.country,
22027
- merchantKey = _ref4.merchantKey;
22030
+ fetchReachStates: function fetchReachStates(_ref5) {
22031
+ var country = _ref5.country,
22032
+ merchantKey = _ref5.merchantKey;
22028
22033
  var url = new URL("/address/country/".concat(country, "/state"), configToUse.paystackApiUrl).toString();
22029
22034
  var language = getLanguage();
22030
22035
  var headers = _objectSpread2({
@@ -22108,8 +22113,8 @@ var Toolkit = /*#__PURE__*/function () {
22108
22113
  }
22109
22114
  }, {
22110
22115
  key: "preChargeCheck",
22111
- value: function preChargeCheck(bin, transactionId) {
22112
- return ToolkitAPI.preChargeCheck(bin, transactionId);
22116
+ value: function preChargeCheck(params) {
22117
+ return ToolkitAPI.preChargeCheck(params);
22113
22118
  }
22114
22119
  }]);
22115
22120
  return Toolkit;
package/lib/checkout.js CHANGED
@@ -21991,24 +21991,29 @@ var ToolkitAPI = {
21991
21991
  return data;
21992
21992
  });
21993
21993
  },
21994
- preChargeCheck: function preChargeCheck(bin, transactionId) {
21994
+ preChargeCheck: function preChargeCheck(_ref2) {
21995
+ var bin = _ref2.bin,
21996
+ transactionId = _ref2.transactionId,
21997
+ merchantKey = _ref2.merchantKey;
21995
21998
  var url = new URL("/transaction/pre_charge_check/".concat(bin), configToUse.paystackApiUrl).toString();
21996
21999
  var language = getLanguage();
21997
- var headers = _objectSpread2({}, language && {
22000
+ var headers = _objectSpread2({
22001
+ Authorization: "Bearer ".concat(merchantKey)
22002
+ }, language && {
21998
22003
  'Accept-Language': language
21999
22004
  });
22000
22005
  return axiosInstance.post(url, {
22001
22006
  transaction_id: transactionId
22002
22007
  }, {
22003
22008
  headers: headers
22004
- }).then(function (_ref2) {
22005
- var data = _ref2.data;
22009
+ }).then(function (_ref3) {
22010
+ var data = _ref3.data;
22006
22011
  return data;
22007
22012
  });
22008
22013
  },
22009
- fetchCountries: function fetchCountries(_ref3) {
22010
- var scope = _ref3.scope,
22011
- merchantKey = _ref3.merchantKey;
22014
+ fetchCountries: function fetchCountries(_ref4) {
22015
+ var scope = _ref4.scope,
22016
+ merchantKey = _ref4.merchantKey;
22012
22017
  var url = new URL('/address/country', configToUse.paystackApiUrl).toString();
22013
22018
  var language = getLanguage();
22014
22019
  var headers = _objectSpread2({
@@ -22026,9 +22031,9 @@ var ToolkitAPI = {
22026
22031
  return response.data;
22027
22032
  });
22028
22033
  },
22029
- fetchReachStates: function fetchReachStates(_ref4) {
22030
- var country = _ref4.country,
22031
- merchantKey = _ref4.merchantKey;
22034
+ fetchReachStates: function fetchReachStates(_ref5) {
22035
+ var country = _ref5.country,
22036
+ merchantKey = _ref5.merchantKey;
22032
22037
  var url = new URL("/address/country/".concat(country, "/state"), configToUse.paystackApiUrl).toString();
22033
22038
  var language = getLanguage();
22034
22039
  var headers = _objectSpread2({
@@ -22112,8 +22117,8 @@ var Toolkit = /*#__PURE__*/function () {
22112
22117
  }
22113
22118
  }, {
22114
22119
  key: "preChargeCheck",
22115
- value: function preChargeCheck(bin, transactionId) {
22116
- return ToolkitAPI.preChargeCheck(bin, transactionId);
22120
+ value: function preChargeCheck(params) {
22121
+ return ToolkitAPI.preChargeCheck(params);
22117
22122
  }
22118
22123
  }]);
22119
22124
  return Toolkit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.52.0-beta.12",
3
+ "version": "1.52.0-beta.13",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",