@paystack/checkout-js 1.46.0-dev.1 → 1.46.0-dev.3
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 +18 -115
- package/es/checkout.js +18 -115
- package/lib/checkout.js +18 -115
- package/package.json +1 -1
- package/dist/checkout.js.map +0 -1
- package/es/checkout.js.map +0 -1
- package/lib/checkout.js.map +0 -1
package/lib/checkout.js
CHANGED
|
@@ -6340,22 +6340,19 @@ var devConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
|
6340
6340
|
checkoutUrl: 'http://localhost:8080/',
|
|
6341
6341
|
paymentBaseUrl: 'https://legacy-staging.paystack.co/',
|
|
6342
6342
|
paystackApiUrl: 'https://studio-api.paystack.co/',
|
|
6343
|
-
pusherKey: '1c7b262ee18455815893'
|
|
6344
|
-
pusherUrl: 'https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js'
|
|
6343
|
+
pusherKey: '1c7b262ee18455815893'
|
|
6345
6344
|
});
|
|
6346
6345
|
var stagingConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
6347
6346
|
checkoutUrl: 'https://checkout-studio.paystack.com/',
|
|
6348
6347
|
paymentBaseUrl: 'https://legacy-staging.paystack.co/',
|
|
6349
6348
|
paystackApiUrl: 'https://studio-api.paystack.co/',
|
|
6350
|
-
pusherKey: '1c7b262ee18455815893'
|
|
6351
|
-
pusherUrl: 'https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js'
|
|
6349
|
+
pusherKey: '1c7b262ee18455815893'
|
|
6352
6350
|
});
|
|
6353
6351
|
var productionConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
6354
6352
|
checkoutUrl: 'https://checkout.paystack.com/',
|
|
6355
6353
|
paymentBaseUrl: 'https://standard.paystack.co/',
|
|
6356
6354
|
paystackApiUrl: 'https://api.paystack.co/',
|
|
6357
|
-
pusherKey: '8e4b9b7ca3418bd5cdc8'
|
|
6358
|
-
pusherUrl: 'https://checkout.paystack.com/static/vendor/pusher.min.js'
|
|
6355
|
+
pusherKey: '8e4b9b7ca3418bd5cdc8'
|
|
6359
6356
|
});
|
|
6360
6357
|
var configToEnvironmentMapping = {
|
|
6361
6358
|
dev: devConfig,
|
|
@@ -12116,17 +12113,6 @@ var TransactionAPI = {
|
|
|
12116
12113
|
}).then(function (response) {
|
|
12117
12114
|
return response.data;
|
|
12118
12115
|
});
|
|
12119
|
-
},
|
|
12120
|
-
initializeCustomerSubscriptionAuthorization: function initializeCustomerSubscriptionAuthorization(params, publicKey) {
|
|
12121
|
-
var url = new URL('/customer/authorization/initialize_subscription', configToUse.paystackApiUrl).toString();
|
|
12122
|
-
var headers = {
|
|
12123
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12124
|
-
};
|
|
12125
|
-
return axiosInstance.post(url, params, {
|
|
12126
|
-
headers: headers
|
|
12127
|
-
}).then(function (response) {
|
|
12128
|
-
return response.data;
|
|
12129
|
-
});
|
|
12130
12116
|
}
|
|
12131
12117
|
};
|
|
12132
12118
|
|
|
@@ -12144,34 +12130,6 @@ var PayWithTransferAPI = {
|
|
|
12144
12130
|
}).then(function (response) {
|
|
12145
12131
|
return ChargeResponses.parse(response.data);
|
|
12146
12132
|
});
|
|
12147
|
-
},
|
|
12148
|
-
incorrectAmountDecision: function incorrectAmountDecision(params, publicKey) {
|
|
12149
|
-
var language = getLanguage();
|
|
12150
|
-
var headers = _objectSpread2({
|
|
12151
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12152
|
-
}, language && {
|
|
12153
|
-
'Accept-Language': language
|
|
12154
|
-
});
|
|
12155
|
-
var url = new URL('pay-with-transfer/incorrect-amount/decision', configToUse.paystackApiUrl).toString();
|
|
12156
|
-
return axiosInstance.post(url, params, {
|
|
12157
|
-
headers: headers
|
|
12158
|
-
}).then(function (response) {
|
|
12159
|
-
return ChargeResponses.parse(response.data);
|
|
12160
|
-
});
|
|
12161
|
-
},
|
|
12162
|
-
authenticatePayer: function authenticatePayer(params, publicKey) {
|
|
12163
|
-
var language = getLanguage();
|
|
12164
|
-
var headers = _objectSpread2({
|
|
12165
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12166
|
-
}, language && {
|
|
12167
|
-
'Accept-Language': language
|
|
12168
|
-
});
|
|
12169
|
-
var url = new URL('pay-with-transfer/authenticate-payer', configToUse.paystackApiUrl).toString();
|
|
12170
|
-
return axiosInstance.post(url, params, {
|
|
12171
|
-
headers: headers
|
|
12172
|
-
}).then(function (response) {
|
|
12173
|
-
return ChargeResponses.parse(response.data);
|
|
12174
|
-
});
|
|
12175
12133
|
}
|
|
12176
12134
|
};
|
|
12177
12135
|
|
|
@@ -12200,25 +12158,6 @@ var PayWithTransferCharge = {
|
|
|
12200
12158
|
paymentMethod: 'bank_transfer'
|
|
12201
12159
|
};
|
|
12202
12160
|
return this.listenForCharge(listenerOptions, callback);
|
|
12203
|
-
},
|
|
12204
|
-
sendIncorrectAmountDecision: function sendIncorrectAmountDecision(decisionMade) {
|
|
12205
|
-
var params = {
|
|
12206
|
-
transaction_id: this.id,
|
|
12207
|
-
decision: decisionMade
|
|
12208
|
-
};
|
|
12209
|
-
return PayWithTransferAPI.incorrectAmountDecision(params, this.merchant.key);
|
|
12210
|
-
},
|
|
12211
|
-
sendAuthenticatePayer: function sendAuthenticatePayer(_ref2) {
|
|
12212
|
-
var amountPaid = _ref2.amountPaid,
|
|
12213
|
-
payerAccountNumber = _ref2.payerAccountNumber,
|
|
12214
|
-
payerBankSlug = _ref2.payerBankSlug;
|
|
12215
|
-
var params = {
|
|
12216
|
-
transaction_id: this.id,
|
|
12217
|
-
amount: amountPaid,
|
|
12218
|
-
payer_account_number: payerAccountNumber,
|
|
12219
|
-
payer_bank_slug: payerBankSlug
|
|
12220
|
-
};
|
|
12221
|
-
return PayWithTransferAPI.authenticatePayer(params, this.merchant.key);
|
|
12222
12161
|
}
|
|
12223
12162
|
};
|
|
12224
12163
|
|
|
@@ -18935,7 +18874,19 @@ cardValidator.creditCardType.addCard({
|
|
|
18935
18874
|
size: 3
|
|
18936
18875
|
}
|
|
18937
18876
|
});
|
|
18877
|
+
cardValidator.creditCardType.addCard({
|
|
18878
|
+
niceType: 'Afrigo',
|
|
18879
|
+
type: 'afrigo',
|
|
18880
|
+
patterns: [[56445600, 56445699], [56400001, 56409999]],
|
|
18881
|
+
gaps: [4, 8, 12],
|
|
18882
|
+
lengths: [18],
|
|
18883
|
+
code: {
|
|
18884
|
+
name: 'CVV',
|
|
18885
|
+
size: 3
|
|
18886
|
+
}
|
|
18887
|
+
});
|
|
18938
18888
|
cardValidator.creditCardType.changeOrder('verve', 0);
|
|
18889
|
+
cardValidator.creditCardType.changeOrder('afrigo', 1);
|
|
18939
18890
|
var Card$2 = {
|
|
18940
18891
|
getEncryptedPin: function getEncryptedPin(pin) {
|
|
18941
18892
|
return pin ? encrypt(pin) : undefined;
|
|
@@ -21211,10 +21162,6 @@ var AnalyticsFunctions$1 = _objectSpread2(_objectSpread2({}, CapitecPayAnalytics
|
|
|
21211
21162
|
},
|
|
21212
21163
|
saveReferrer: function saveReferrer(referrer) {
|
|
21213
21164
|
return AnalyticsAPI.saveReferrer(this.id, this.merchant.key, referrer);
|
|
21214
|
-
},
|
|
21215
|
-
setAmountByChannel: function setAmountByChannel(channelName) {
|
|
21216
|
-
var _this$channelFeesConf;
|
|
21217
|
-
this.amount = ((_this$channelFeesConf = this.channelFeesConfig[channelName]) === null || _this$channelFeesConf === void 0 ? void 0 : _this$channelFeesConf.amount) || this.originalAmount;
|
|
21218
21165
|
}
|
|
21219
21166
|
});
|
|
21220
21167
|
|
|
@@ -21358,7 +21305,7 @@ var linkAPI = {
|
|
|
21358
21305
|
}, _callee4);
|
|
21359
21306
|
}))();
|
|
21360
21307
|
},
|
|
21361
|
-
|
|
21308
|
+
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21362
21309
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
21363
21310
|
var url, language, headers, payload, response;
|
|
21364
21311
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -21525,28 +21472,12 @@ var linkChargeFunctions = {
|
|
|
21525
21472
|
});
|
|
21526
21473
|
},
|
|
21527
21474
|
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21528
|
-
return
|
|
21529
|
-
},
|
|
21530
|
-
getDirectDebitManagedAccount: function getDirectDebitManagedAccount(params) {
|
|
21531
|
-
return linkAPI.generateDirectDebitManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21475
|
+
return linkAPI.generateLinkManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21532
21476
|
device: this.deviceFingerprint,
|
|
21533
21477
|
transactionId: this.id
|
|
21534
21478
|
}));
|
|
21535
21479
|
},
|
|
21536
|
-
getManagedAccount: function getManagedAccount(_ref5) {
|
|
21537
|
-
var fulfilLateNotification = _ref5.fulfilLateNotification,
|
|
21538
|
-
preferredProvider = _ref5.preferredProvider;
|
|
21539
|
-
var params = {
|
|
21540
|
-
transaction_id: this.id,
|
|
21541
|
-
fulfil_late_notification: fulfilLateNotification,
|
|
21542
|
-
preferred_provider: preferredProvider
|
|
21543
|
-
};
|
|
21544
|
-
return PayWithTransferAPI.generateManagedAccount(params, this.merchant.key);
|
|
21545
|
-
},
|
|
21546
21480
|
listenForLinkBankPayWithTransferCharge: function listenForLinkBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21547
|
-
return this.listenForBankPayWithTransferCharge(pusherChannel, callback);
|
|
21548
|
-
},
|
|
21549
|
-
listenForBankPayWithTransferCharge: function listenForBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21550
21481
|
var listenerOptions = {
|
|
21551
21482
|
channel: pusherChannel,
|
|
21552
21483
|
paymentMethod: 'bank_transfer'
|
|
@@ -21580,7 +21511,6 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21580
21511
|
this.status = data.transaction_status || data.status;
|
|
21581
21512
|
this.accessCode = data.access_code;
|
|
21582
21513
|
this.amount = data.amount;
|
|
21583
|
-
this.originalAmount = data.amount;
|
|
21584
21514
|
this.domain = data.domain;
|
|
21585
21515
|
this.isTest = data.domain === 'test';
|
|
21586
21516
|
this.currency = data.currency;
|
|
@@ -21686,13 +21616,6 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21686
21616
|
return response && response.data;
|
|
21687
21617
|
});
|
|
21688
21618
|
}
|
|
21689
|
-
}, {
|
|
21690
|
-
key: "initializeCustomerSubscriptionAuthorization",
|
|
21691
|
-
value: function initializeCustomerSubscriptionAuthorization(payload) {
|
|
21692
|
-
return TransactionAPI.initializeCustomerSubscriptionAuthorization(payload, this.merchant.key).then(function (response) {
|
|
21693
|
-
return response && response.data;
|
|
21694
|
-
});
|
|
21695
|
-
}
|
|
21696
21619
|
}]);
|
|
21697
21620
|
return TransactionInstance;
|
|
21698
21621
|
}();
|
|
@@ -21756,7 +21679,7 @@ var Transaction = {
|
|
|
21756
21679
|
}
|
|
21757
21680
|
throw new Error('This function should be used with transaction data from the API');
|
|
21758
21681
|
case 5:
|
|
21759
|
-
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {
|
|
21682
|
+
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {}, {
|
|
21760
21683
|
deviceFingerprint: deviceFingerprint
|
|
21761
21684
|
}))));
|
|
21762
21685
|
case 6:
|
|
@@ -21914,19 +21837,6 @@ var ToolkitAPI = {
|
|
|
21914
21837
|
resolvedCardBins[bin] = data;
|
|
21915
21838
|
return data;
|
|
21916
21839
|
});
|
|
21917
|
-
},
|
|
21918
|
-
resolveIPAddress: function resolveIPAddress(ipAddress) {
|
|
21919
|
-
var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
|
|
21920
|
-
var language = getLanguage();
|
|
21921
|
-
var headers = _objectSpread2({}, language && {
|
|
21922
|
-
'Accept-Language': language
|
|
21923
|
-
});
|
|
21924
|
-
return axiosInstance.get(url, {
|
|
21925
|
-
headers: headers
|
|
21926
|
-
}).then(function (_ref2) {
|
|
21927
|
-
var data = _ref2.data;
|
|
21928
|
-
return data;
|
|
21929
|
-
});
|
|
21930
21840
|
}
|
|
21931
21841
|
};
|
|
21932
21842
|
|
|
@@ -21984,11 +21894,6 @@ var Toolkit = /*#__PURE__*/function () {
|
|
|
21984
21894
|
value: function resolveCardBin(bin) {
|
|
21985
21895
|
return ToolkitAPI.resolveCardBin(bin);
|
|
21986
21896
|
}
|
|
21987
|
-
}, {
|
|
21988
|
-
key: "resolveIPAddress",
|
|
21989
|
-
value: function resolveIPAddress(ipAddress) {
|
|
21990
|
-
return ToolkitAPI.resolveIPAddress(ipAddress);
|
|
21991
|
-
}
|
|
21992
21897
|
}]);
|
|
21993
21898
|
return Toolkit;
|
|
21994
21899
|
}();
|
|
@@ -22276,7 +22181,6 @@ var AnalyticsFunctions = {
|
|
|
22276
22181
|
return this.saveLog();
|
|
22277
22182
|
},
|
|
22278
22183
|
logAPIResponse: function logAPIResponse(response, channel) {
|
|
22279
|
-
console.log('api response', response);
|
|
22280
22184
|
switch (response.status) {
|
|
22281
22185
|
case 'authorized':
|
|
22282
22186
|
return this.logAuthorized(channel);
|
|
@@ -22453,4 +22357,3 @@ exports.Card = Card$1;
|
|
|
22453
22357
|
exports.Preauthorization = Preauthorization;
|
|
22454
22358
|
exports.Toolkit = Toolkit;
|
|
22455
22359
|
exports.Transaction = Transaction;
|
|
22456
|
-
//# sourceMappingURL=checkout.js.map
|