@paystack/checkout-js 1.22.0-dev.9 → 1.22.1
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 +29 -21349
- package/es/checkout.js +29 -55
- package/lib/checkout.js +29 -55
- package/package.json +1 -1
package/es/checkout.js
CHANGED
|
@@ -20110,7 +20110,9 @@ if ($stringify) {
|
|
|
20110
20110
|
}
|
|
20111
20111
|
|
|
20112
20112
|
var AnalyticsAPIUtils = {
|
|
20113
|
-
saveLog: function saveLog(url,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,19 @@ 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,
|
|
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,
|
|
21073
|
-
|
|
21074
|
-
|
|
21075
|
-
var url = new URL("preauthorization/set_referrer/".concat(preauthorizationId), configToUse.paystackApiUrl).toString();
|
|
21076
|
-
return AnalyticsAPIUtils.saveReferrer(url, merchantKey, referrer);
|
|
21068
|
+
return AnalyticsAPIUtils.saveIp(url, {
|
|
21069
|
+
merchantKey: merchantKey
|
|
21070
|
+
});
|
|
21077
21071
|
}
|
|
21078
21072
|
};
|
|
21079
21073
|
|
|
@@ -21096,7 +21090,7 @@ var AnalyticsFunctions = {
|
|
|
21096
21090
|
logChannelSwitch: function logChannelSwitch(value) {
|
|
21097
21091
|
this.log.history.push({
|
|
21098
21092
|
type: 'action',
|
|
21099
|
-
message: "Set
|
|
21093
|
+
message: "Set charge method to: ".concat(value),
|
|
21100
21094
|
time: this.getTimeSpent()
|
|
21101
21095
|
});
|
|
21102
21096
|
return this.saveLog();
|
|
@@ -21145,9 +21139,6 @@ var AnalyticsFunctions = {
|
|
|
21145
21139
|
case 'success':
|
|
21146
21140
|
return this.logSuccess(channel);
|
|
21147
21141
|
|
|
21148
|
-
case 'pending':
|
|
21149
|
-
return this.logPending(channel);
|
|
21150
|
-
|
|
21151
21142
|
case 'failed':
|
|
21152
21143
|
return this.logError(response.message);
|
|
21153
21144
|
|
|
@@ -21167,7 +21158,7 @@ var AnalyticsFunctions = {
|
|
|
21167
21158
|
return this.saveLog();
|
|
21168
21159
|
},
|
|
21169
21160
|
logAttempt: function logAttempt(channel) {
|
|
21170
|
-
var message = 'Attempted to
|
|
21161
|
+
var message = 'Attempted to charge';
|
|
21171
21162
|
|
|
21172
21163
|
if (channel) {
|
|
21173
21164
|
message += " with ".concat(channel);
|
|
@@ -21191,7 +21182,7 @@ var AnalyticsFunctions = {
|
|
|
21191
21182
|
return this.saveLog();
|
|
21192
21183
|
},
|
|
21193
21184
|
logSuccess: function logSuccess(channel) {
|
|
21194
|
-
var message = 'Successfully
|
|
21185
|
+
var message = 'Successfully preauthorised funds';
|
|
21195
21186
|
|
|
21196
21187
|
if (channel) {
|
|
21197
21188
|
message += " with ".concat(channel);
|
|
@@ -21205,20 +21196,6 @@ var AnalyticsFunctions = {
|
|
|
21205
21196
|
});
|
|
21206
21197
|
return this.saveLog();
|
|
21207
21198
|
},
|
|
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
21199
|
logPageClose: function logPageClose() {
|
|
21223
21200
|
this.log.history.push({
|
|
21224
21201
|
type: 'close',
|
|
@@ -21247,9 +21224,6 @@ var AnalyticsFunctions = {
|
|
|
21247
21224
|
},
|
|
21248
21225
|
saveIpAddress: function saveIpAddress() {
|
|
21249
21226
|
return PreauthorizationAnalyticsAPI.saveIp(this.id, this.merchant.key);
|
|
21250
|
-
},
|
|
21251
|
-
saveReferrer: function saveReferrer(referrer) {
|
|
21252
|
-
return PreauthorizationAnalyticsAPI.saveReferrer(this.id, this.merchant.key, referrer);
|
|
21253
21227
|
}
|
|
21254
21228
|
};
|
|
21255
21229
|
|
package/lib/checkout.js
CHANGED
|
@@ -20114,7 +20114,9 @@ if ($stringify) {
|
|
|
20114
20114
|
}
|
|
20115
20115
|
|
|
20116
20116
|
var AnalyticsAPIUtils = {
|
|
20117
|
-
saveLog: function saveLog(url,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,19 @@ 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,
|
|
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,
|
|
21077
|
-
|
|
21078
|
-
|
|
21079
|
-
var url = new URL("preauthorization/set_referrer/".concat(preauthorizationId), configToUse.paystackApiUrl).toString();
|
|
21080
|
-
return AnalyticsAPIUtils.saveReferrer(url, merchantKey, referrer);
|
|
21072
|
+
return AnalyticsAPIUtils.saveIp(url, {
|
|
21073
|
+
merchantKey: merchantKey
|
|
21074
|
+
});
|
|
21081
21075
|
}
|
|
21082
21076
|
};
|
|
21083
21077
|
|
|
@@ -21100,7 +21094,7 @@ var AnalyticsFunctions = {
|
|
|
21100
21094
|
logChannelSwitch: function logChannelSwitch(value) {
|
|
21101
21095
|
this.log.history.push({
|
|
21102
21096
|
type: 'action',
|
|
21103
|
-
message: "Set
|
|
21097
|
+
message: "Set charge method to: ".concat(value),
|
|
21104
21098
|
time: this.getTimeSpent()
|
|
21105
21099
|
});
|
|
21106
21100
|
return this.saveLog();
|
|
@@ -21149,9 +21143,6 @@ var AnalyticsFunctions = {
|
|
|
21149
21143
|
case 'success':
|
|
21150
21144
|
return this.logSuccess(channel);
|
|
21151
21145
|
|
|
21152
|
-
case 'pending':
|
|
21153
|
-
return this.logPending(channel);
|
|
21154
|
-
|
|
21155
21146
|
case 'failed':
|
|
21156
21147
|
return this.logError(response.message);
|
|
21157
21148
|
|
|
@@ -21171,7 +21162,7 @@ var AnalyticsFunctions = {
|
|
|
21171
21162
|
return this.saveLog();
|
|
21172
21163
|
},
|
|
21173
21164
|
logAttempt: function logAttempt(channel) {
|
|
21174
|
-
var message = 'Attempted to
|
|
21165
|
+
var message = 'Attempted to charge';
|
|
21175
21166
|
|
|
21176
21167
|
if (channel) {
|
|
21177
21168
|
message += " with ".concat(channel);
|
|
@@ -21195,7 +21186,7 @@ var AnalyticsFunctions = {
|
|
|
21195
21186
|
return this.saveLog();
|
|
21196
21187
|
},
|
|
21197
21188
|
logSuccess: function logSuccess(channel) {
|
|
21198
|
-
var message = 'Successfully
|
|
21189
|
+
var message = 'Successfully preauthorised funds';
|
|
21199
21190
|
|
|
21200
21191
|
if (channel) {
|
|
21201
21192
|
message += " with ".concat(channel);
|
|
@@ -21209,20 +21200,6 @@ var AnalyticsFunctions = {
|
|
|
21209
21200
|
});
|
|
21210
21201
|
return this.saveLog();
|
|
21211
21202
|
},
|
|
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
21203
|
logPageClose: function logPageClose() {
|
|
21227
21204
|
this.log.history.push({
|
|
21228
21205
|
type: 'close',
|
|
@@ -21251,9 +21228,6 @@ var AnalyticsFunctions = {
|
|
|
21251
21228
|
},
|
|
21252
21229
|
saveIpAddress: function saveIpAddress() {
|
|
21253
21230
|
return PreauthorizationAnalyticsAPI.saveIp(this.id, this.merchant.key);
|
|
21254
|
-
},
|
|
21255
|
-
saveReferrer: function saveReferrer(referrer) {
|
|
21256
|
-
return PreauthorizationAnalyticsAPI.saveReferrer(this.id, this.merchant.key, referrer);
|
|
21257
21231
|
}
|
|
21258
21232
|
};
|
|
21259
21233
|
|