@paystack/checkout-js 1.22.0-dev.9 → 1.22.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
@@ -20110,7 +20110,9 @@ if ($stringify) {
20110
20110
  }
20111
20111
 
20112
20112
  var AnalyticsAPIUtils = {
20113
- saveLog: function saveLog(url, merchantKey, log) {
20113
+ saveLog: function saveLog(url, _ref) {
20114
+ var merchantKey = _ref.merchantKey,
20115
+ log = _ref.log;
20114
20116
  var language = getLanguage();
20115
20117
 
20116
20118
  var headers = _objectSpread2({
@@ -20141,7 +20143,8 @@ var AnalyticsAPIUtils = {
20141
20143
  return response.data.data.ip_address;
20142
20144
  });
20143
20145
  },
20144
- saveIp: function saveIp(url, merchantKey) {
20146
+ saveIp: function saveIp(url, _ref2) {
20147
+ var merchantKey = _ref2.merchantKey;
20145
20148
  var language = getLanguage();
20146
20149
 
20147
20150
  var headers = _objectSpread2({
@@ -20156,7 +20159,9 @@ var AnalyticsAPIUtils = {
20156
20159
  return response.data;
20157
20160
  });
20158
20161
  },
20159
- saveReferrer: function saveReferrer(url, merchantKey, referrer) {
20162
+ saveReferrer: function saveReferrer(url, _ref3) {
20163
+ var merchantKey = _ref3.merchantKey,
20164
+ referrer = _ref3.referrer;
20160
20165
  var language = getLanguage();
20161
20166
 
20162
20167
  var headers = _objectSpread2({
@@ -20178,18 +20183,26 @@ var AnalyticsAPIUtils = {
20178
20183
  var AnalyticsAPI = {
20179
20184
  saveLog: function saveLog(transactionId, merchantKey, log) {
20180
20185
  var url = new URL("transaction/update_log/".concat(transactionId), configToUse.paystackApiUrl).toString();
20181
- return AnalyticsAPIUtils.saveLog(url, merchantKey, log);
20186
+ return AnalyticsAPIUtils.saveLog(url, {
20187
+ merchantKey: merchantKey,
20188
+ log: log
20189
+ });
20182
20190
  },
20183
20191
  getIp: function getIp() {
20184
20192
  return AnalyticsAPIUtils.getIp();
20185
20193
  },
20186
20194
  saveIp: function saveIp(transactionId, merchantKey) {
20187
20195
  var url = new URL("transaction/set_ip/".concat(transactionId), configToUse.paystackApiUrl).toString();
20188
- return AnalyticsAPIUtils.saveIp(url, merchantKey);
20196
+ return AnalyticsAPIUtils.saveIp(url, {
20197
+ merchantKey: merchantKey
20198
+ });
20189
20199
  },
20190
20200
  saveReferrer: function saveReferrer(transactionId, merchantKey, referrer) {
20191
20201
  var url = new URL("transaction/set_referrer/".concat(transactionId), configToUse.paystackApiUrl).toString();
20192
- return AnalyticsAPIUtils.saveReferrer(url, merchantKey, referrer);
20202
+ return AnalyticsAPIUtils.saveReferrer(url, {
20203
+ merchantKey: merchantKey,
20204
+ referrer: referrer
20205
+ });
20193
20206
  }
20194
20207
  };
20195
20208
 
@@ -20751,21 +20764,6 @@ var ToolkitAPI = {
20751
20764
  resolvedCardBins[bin] = data;
20752
20765
  return data;
20753
20766
  });
20754
- },
20755
- resolveIPAddress: function resolveIPAddress(ipAddress) {
20756
- var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
20757
- var language = getLanguage();
20758
-
20759
- var headers = _objectSpread2({}, language && {
20760
- 'Accept-Language': language
20761
- });
20762
-
20763
- return axiosInstance.get(url, {
20764
- headers: headers
20765
- }).then(function (_ref2) {
20766
- var data = _ref2.data;
20767
- return data;
20768
- });
20769
20767
  }
20770
20768
  };
20771
20769
 
@@ -20831,11 +20829,6 @@ var Toolkit = /*#__PURE__*/function () {
20831
20829
  value: function resolveCardBin(bin) {
20832
20830
  return ToolkitAPI.resolveCardBin(bin);
20833
20831
  }
20834
- }, {
20835
- key: "resolveIPAddress",
20836
- value: function resolveIPAddress(ipAddress) {
20837
- return ToolkitAPI.resolveIPAddress(ipAddress);
20838
- }
20839
20832
  }]);
20840
20833
 
20841
20834
  return Toolkit;
@@ -21062,18 +21055,26 @@ var PreauthorisationAPI = {
21062
21055
  var PreauthorizationAnalyticsAPI = {
21063
21056
  saveLog: function saveLog(preauthorizationId, merchantKey, log) {
21064
21057
  var url = new URL("preauthorization/update_log/".concat(preauthorizationId), configToUse.paystackApiUrl).toString();
21065
- return AnalyticsAPIUtils.saveLog(url, merchantKey, log);
21058
+ return AnalyticsAPIUtils.saveLog(url, {
21059
+ merchantKey: merchantKey,
21060
+ log: log
21061
+ });
21066
21062
  },
21067
21063
  getIp: function getIp() {
21068
21064
  return AnalyticsAPIUtils.getIp();
21069
21065
  },
21070
21066
  saveIp: function saveIp(preauthorizationId, merchantKey) {
21071
21067
  var url = new URL("preauthorization/set_ip/".concat(preauthorizationId), configToUse.paystackApiUrl).toString();
21072
- return AnalyticsAPIUtils.saveIp(url, merchantKey);
21068
+ return AnalyticsAPIUtils.saveIp(url, {
21069
+ merchantKey: merchantKey
21070
+ });
21073
21071
  },
21074
21072
  saveReferrer: function saveReferrer(preauthorizationId, merchantKey, referrer) {
21075
21073
  var url = new URL("preauthorization/set_referrer/".concat(preauthorizationId), configToUse.paystackApiUrl).toString();
21076
- return AnalyticsAPIUtils.saveReferrer(url, merchantKey, referrer);
21074
+ return AnalyticsAPIUtils.saveReferrer(url, {
21075
+ merchantKey: merchantKey,
21076
+ referrer: referrer
21077
+ });
21077
21078
  }
21078
21079
  };
21079
21080
 
@@ -21096,7 +21097,7 @@ var AnalyticsFunctions = {
21096
21097
  logChannelSwitch: function logChannelSwitch(value) {
21097
21098
  this.log.history.push({
21098
21099
  type: 'action',
21099
- message: "Set payment method to: ".concat(value),
21100
+ message: "Set charge method to: ".concat(value),
21100
21101
  time: this.getTimeSpent()
21101
21102
  });
21102
21103
  return this.saveLog();
@@ -21145,9 +21146,6 @@ var AnalyticsFunctions = {
21145
21146
  case 'success':
21146
21147
  return this.logSuccess(channel);
21147
21148
 
21148
- case 'pending':
21149
- return this.logPending(channel);
21150
-
21151
21149
  case 'failed':
21152
21150
  return this.logError(response.message);
21153
21151
 
@@ -21167,7 +21165,7 @@ var AnalyticsFunctions = {
21167
21165
  return this.saveLog();
21168
21166
  },
21169
21167
  logAttempt: function logAttempt(channel) {
21170
- var message = 'Attempted to pay';
21168
+ var message = 'Attempted to charge';
21171
21169
 
21172
21170
  if (channel) {
21173
21171
  message += " with ".concat(channel);
@@ -21191,7 +21189,7 @@ var AnalyticsFunctions = {
21191
21189
  return this.saveLog();
21192
21190
  },
21193
21191
  logSuccess: function logSuccess(channel) {
21194
- var message = 'Successfully paid';
21192
+ var message = 'Successfully preauthorised funds';
21195
21193
 
21196
21194
  if (channel) {
21197
21195
  message += " with ".concat(channel);
@@ -21205,20 +21203,6 @@ var AnalyticsFunctions = {
21205
21203
  });
21206
21204
  return this.saveLog();
21207
21205
  },
21208
- logPending: function logPending(channel) {
21209
- var message = 'Payment in progress';
21210
-
21211
- if (channel) {
21212
- message += " with ".concat(channel);
21213
- }
21214
-
21215
- this.log.history.push({
21216
- type: 'pending',
21217
- message: message,
21218
- time: this.getTimeSpent()
21219
- });
21220
- return this.saveLog();
21221
- },
21222
21206
  logPageClose: function logPageClose() {
21223
21207
  this.log.history.push({
21224
21208
  type: 'close',
package/lib/checkout.js CHANGED
@@ -20114,7 +20114,9 @@ if ($stringify) {
20114
20114
  }
20115
20115
 
20116
20116
  var AnalyticsAPIUtils = {
20117
- saveLog: function saveLog(url, merchantKey, log) {
20117
+ saveLog: function saveLog(url, _ref) {
20118
+ var merchantKey = _ref.merchantKey,
20119
+ log = _ref.log;
20118
20120
  var language = getLanguage();
20119
20121
 
20120
20122
  var headers = _objectSpread2({
@@ -20145,7 +20147,8 @@ var AnalyticsAPIUtils = {
20145
20147
  return response.data.data.ip_address;
20146
20148
  });
20147
20149
  },
20148
- saveIp: function saveIp(url, merchantKey) {
20150
+ saveIp: function saveIp(url, _ref2) {
20151
+ var merchantKey = _ref2.merchantKey;
20149
20152
  var language = getLanguage();
20150
20153
 
20151
20154
  var headers = _objectSpread2({
@@ -20160,7 +20163,9 @@ var AnalyticsAPIUtils = {
20160
20163
  return response.data;
20161
20164
  });
20162
20165
  },
20163
- saveReferrer: function saveReferrer(url, merchantKey, referrer) {
20166
+ saveReferrer: function saveReferrer(url, _ref3) {
20167
+ var merchantKey = _ref3.merchantKey,
20168
+ referrer = _ref3.referrer;
20164
20169
  var language = getLanguage();
20165
20170
 
20166
20171
  var headers = _objectSpread2({
@@ -20182,18 +20187,26 @@ var AnalyticsAPIUtils = {
20182
20187
  var AnalyticsAPI = {
20183
20188
  saveLog: function saveLog(transactionId, merchantKey, log) {
20184
20189
  var url = new URL("transaction/update_log/".concat(transactionId), configToUse.paystackApiUrl).toString();
20185
- return AnalyticsAPIUtils.saveLog(url, merchantKey, log);
20190
+ return AnalyticsAPIUtils.saveLog(url, {
20191
+ merchantKey: merchantKey,
20192
+ log: log
20193
+ });
20186
20194
  },
20187
20195
  getIp: function getIp() {
20188
20196
  return AnalyticsAPIUtils.getIp();
20189
20197
  },
20190
20198
  saveIp: function saveIp(transactionId, merchantKey) {
20191
20199
  var url = new URL("transaction/set_ip/".concat(transactionId), configToUse.paystackApiUrl).toString();
20192
- return AnalyticsAPIUtils.saveIp(url, merchantKey);
20200
+ return AnalyticsAPIUtils.saveIp(url, {
20201
+ merchantKey: merchantKey
20202
+ });
20193
20203
  },
20194
20204
  saveReferrer: function saveReferrer(transactionId, merchantKey, referrer) {
20195
20205
  var url = new URL("transaction/set_referrer/".concat(transactionId), configToUse.paystackApiUrl).toString();
20196
- return AnalyticsAPIUtils.saveReferrer(url, merchantKey, referrer);
20206
+ return AnalyticsAPIUtils.saveReferrer(url, {
20207
+ merchantKey: merchantKey,
20208
+ referrer: referrer
20209
+ });
20197
20210
  }
20198
20211
  };
20199
20212
 
@@ -20755,21 +20768,6 @@ var ToolkitAPI = {
20755
20768
  resolvedCardBins[bin] = data;
20756
20769
  return data;
20757
20770
  });
20758
- },
20759
- resolveIPAddress: function resolveIPAddress(ipAddress) {
20760
- var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
20761
- var language = getLanguage();
20762
-
20763
- var headers = _objectSpread2({}, language && {
20764
- 'Accept-Language': language
20765
- });
20766
-
20767
- return axiosInstance.get(url, {
20768
- headers: headers
20769
- }).then(function (_ref2) {
20770
- var data = _ref2.data;
20771
- return data;
20772
- });
20773
20771
  }
20774
20772
  };
20775
20773
 
@@ -20835,11 +20833,6 @@ var Toolkit = /*#__PURE__*/function () {
20835
20833
  value: function resolveCardBin(bin) {
20836
20834
  return ToolkitAPI.resolveCardBin(bin);
20837
20835
  }
20838
- }, {
20839
- key: "resolveIPAddress",
20840
- value: function resolveIPAddress(ipAddress) {
20841
- return ToolkitAPI.resolveIPAddress(ipAddress);
20842
- }
20843
20836
  }]);
20844
20837
 
20845
20838
  return Toolkit;
@@ -21066,18 +21059,26 @@ var PreauthorisationAPI = {
21066
21059
  var PreauthorizationAnalyticsAPI = {
21067
21060
  saveLog: function saveLog(preauthorizationId, merchantKey, log) {
21068
21061
  var url = new URL("preauthorization/update_log/".concat(preauthorizationId), configToUse.paystackApiUrl).toString();
21069
- return AnalyticsAPIUtils.saveLog(url, merchantKey, log);
21062
+ return AnalyticsAPIUtils.saveLog(url, {
21063
+ merchantKey: merchantKey,
21064
+ log: log
21065
+ });
21070
21066
  },
21071
21067
  getIp: function getIp() {
21072
21068
  return AnalyticsAPIUtils.getIp();
21073
21069
  },
21074
21070
  saveIp: function saveIp(preauthorizationId, merchantKey) {
21075
21071
  var url = new URL("preauthorization/set_ip/".concat(preauthorizationId), configToUse.paystackApiUrl).toString();
21076
- return AnalyticsAPIUtils.saveIp(url, merchantKey);
21072
+ return AnalyticsAPIUtils.saveIp(url, {
21073
+ merchantKey: merchantKey
21074
+ });
21077
21075
  },
21078
21076
  saveReferrer: function saveReferrer(preauthorizationId, merchantKey, referrer) {
21079
21077
  var url = new URL("preauthorization/set_referrer/".concat(preauthorizationId), configToUse.paystackApiUrl).toString();
21080
- return AnalyticsAPIUtils.saveReferrer(url, merchantKey, referrer);
21078
+ return AnalyticsAPIUtils.saveReferrer(url, {
21079
+ merchantKey: merchantKey,
21080
+ referrer: referrer
21081
+ });
21081
21082
  }
21082
21083
  };
21083
21084
 
@@ -21100,7 +21101,7 @@ var AnalyticsFunctions = {
21100
21101
  logChannelSwitch: function logChannelSwitch(value) {
21101
21102
  this.log.history.push({
21102
21103
  type: 'action',
21103
- message: "Set payment method to: ".concat(value),
21104
+ message: "Set charge method to: ".concat(value),
21104
21105
  time: this.getTimeSpent()
21105
21106
  });
21106
21107
  return this.saveLog();
@@ -21149,9 +21150,6 @@ var AnalyticsFunctions = {
21149
21150
  case 'success':
21150
21151
  return this.logSuccess(channel);
21151
21152
 
21152
- case 'pending':
21153
- return this.logPending(channel);
21154
-
21155
21153
  case 'failed':
21156
21154
  return this.logError(response.message);
21157
21155
 
@@ -21171,7 +21169,7 @@ var AnalyticsFunctions = {
21171
21169
  return this.saveLog();
21172
21170
  },
21173
21171
  logAttempt: function logAttempt(channel) {
21174
- var message = 'Attempted to pay';
21172
+ var message = 'Attempted to charge';
21175
21173
 
21176
21174
  if (channel) {
21177
21175
  message += " with ".concat(channel);
@@ -21195,7 +21193,7 @@ var AnalyticsFunctions = {
21195
21193
  return this.saveLog();
21196
21194
  },
21197
21195
  logSuccess: function logSuccess(channel) {
21198
- var message = 'Successfully paid';
21196
+ var message = 'Successfully preauthorised funds';
21199
21197
 
21200
21198
  if (channel) {
21201
21199
  message += " with ".concat(channel);
@@ -21209,20 +21207,6 @@ var AnalyticsFunctions = {
21209
21207
  });
21210
21208
  return this.saveLog();
21211
21209
  },
21212
- logPending: function logPending(channel) {
21213
- var message = 'Payment in progress';
21214
-
21215
- if (channel) {
21216
- message += " with ".concat(channel);
21217
- }
21218
-
21219
- this.log.history.push({
21220
- type: 'pending',
21221
- message: message,
21222
- time: this.getTimeSpent()
21223
- });
21224
- return this.saveLog();
21225
- },
21226
21210
  logPageClose: function logPageClose() {
21227
21211
  this.log.history.push({
21228
21212
  type: 'close',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/checkout-js",
3
- "version": "1.22.0-dev.9",
3
+ "version": "1.22.0",
4
4
  "description": "Client-side JS library for billing on Paystack",
5
5
  "main": "lib/checkout.js",
6
6
  "module": "es/checkout.js",