@paystack/checkout-js 1.46.0-dev.2 → 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 +15 -109
- package/es/checkout.js +15 -109
- package/lib/checkout.js +15 -109
- 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/dist/checkout.js
CHANGED
|
@@ -12112,17 +12112,6 @@ var Paystack = (function (exports) {
|
|
|
12112
12112
|
}).then(function (response) {
|
|
12113
12113
|
return response.data;
|
|
12114
12114
|
});
|
|
12115
|
-
},
|
|
12116
|
-
initializeCustomerSubscriptionAuthorization: function initializeCustomerSubscriptionAuthorization(params, publicKey) {
|
|
12117
|
-
var url = new URL('/customer/authorization/initialize_subscription', configToUse.paystackApiUrl).toString();
|
|
12118
|
-
var headers = {
|
|
12119
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12120
|
-
};
|
|
12121
|
-
return axiosInstance.post(url, params, {
|
|
12122
|
-
headers: headers
|
|
12123
|
-
}).then(function (response) {
|
|
12124
|
-
return response.data;
|
|
12125
|
-
});
|
|
12126
12115
|
}
|
|
12127
12116
|
};
|
|
12128
12117
|
|
|
@@ -12140,34 +12129,6 @@ var Paystack = (function (exports) {
|
|
|
12140
12129
|
}).then(function (response) {
|
|
12141
12130
|
return ChargeResponses.parse(response.data);
|
|
12142
12131
|
});
|
|
12143
|
-
},
|
|
12144
|
-
incorrectAmountDecision: function incorrectAmountDecision(params, publicKey) {
|
|
12145
|
-
var language = getLanguage();
|
|
12146
|
-
var headers = _objectSpread2({
|
|
12147
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12148
|
-
}, language && {
|
|
12149
|
-
'Accept-Language': language
|
|
12150
|
-
});
|
|
12151
|
-
var url = new URL('pay-with-transfer/incorrect-amount/decision', configToUse.paystackApiUrl).toString();
|
|
12152
|
-
return axiosInstance.post(url, params, {
|
|
12153
|
-
headers: headers
|
|
12154
|
-
}).then(function (response) {
|
|
12155
|
-
return ChargeResponses.parse(response.data);
|
|
12156
|
-
});
|
|
12157
|
-
},
|
|
12158
|
-
authenticatePayer: function authenticatePayer(params, publicKey) {
|
|
12159
|
-
var language = getLanguage();
|
|
12160
|
-
var headers = _objectSpread2({
|
|
12161
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12162
|
-
}, language && {
|
|
12163
|
-
'Accept-Language': language
|
|
12164
|
-
});
|
|
12165
|
-
var url = new URL('pay-with-transfer/authenticate-payer', configToUse.paystackApiUrl).toString();
|
|
12166
|
-
return axiosInstance.post(url, params, {
|
|
12167
|
-
headers: headers
|
|
12168
|
-
}).then(function (response) {
|
|
12169
|
-
return ChargeResponses.parse(response.data);
|
|
12170
|
-
});
|
|
12171
12132
|
}
|
|
12172
12133
|
};
|
|
12173
12134
|
|
|
@@ -12196,25 +12157,6 @@ var Paystack = (function (exports) {
|
|
|
12196
12157
|
paymentMethod: 'bank_transfer'
|
|
12197
12158
|
};
|
|
12198
12159
|
return this.listenForCharge(listenerOptions, callback);
|
|
12199
|
-
},
|
|
12200
|
-
sendIncorrectAmountDecision: function sendIncorrectAmountDecision(decisionMade) {
|
|
12201
|
-
var params = {
|
|
12202
|
-
transaction_id: this.id,
|
|
12203
|
-
decision: decisionMade
|
|
12204
|
-
};
|
|
12205
|
-
return PayWithTransferAPI.incorrectAmountDecision(params, this.merchant.key);
|
|
12206
|
-
},
|
|
12207
|
-
sendAuthenticatePayer: function sendAuthenticatePayer(_ref2) {
|
|
12208
|
-
var amountPaid = _ref2.amountPaid,
|
|
12209
|
-
payerAccountNumber = _ref2.payerAccountNumber,
|
|
12210
|
-
payerBankSlug = _ref2.payerBankSlug;
|
|
12211
|
-
var params = {
|
|
12212
|
-
transaction_id: this.id,
|
|
12213
|
-
amount: amountPaid,
|
|
12214
|
-
payer_account_number: payerAccountNumber,
|
|
12215
|
-
payer_bank_slug: payerBankSlug
|
|
12216
|
-
};
|
|
12217
|
-
return PayWithTransferAPI.authenticatePayer(params, this.merchant.key);
|
|
12218
12160
|
}
|
|
12219
12161
|
};
|
|
12220
12162
|
|
|
@@ -18931,7 +18873,19 @@ var Paystack = (function (exports) {
|
|
|
18931
18873
|
size: 3
|
|
18932
18874
|
}
|
|
18933
18875
|
});
|
|
18876
|
+
cardValidator.creditCardType.addCard({
|
|
18877
|
+
niceType: 'Afrigo',
|
|
18878
|
+
type: 'afrigo',
|
|
18879
|
+
patterns: [[56445600, 56445699], [56400001, 56409999]],
|
|
18880
|
+
gaps: [4, 8, 12],
|
|
18881
|
+
lengths: [18],
|
|
18882
|
+
code: {
|
|
18883
|
+
name: 'CVV',
|
|
18884
|
+
size: 3
|
|
18885
|
+
}
|
|
18886
|
+
});
|
|
18934
18887
|
cardValidator.creditCardType.changeOrder('verve', 0);
|
|
18888
|
+
cardValidator.creditCardType.changeOrder('afrigo', 1);
|
|
18935
18889
|
var Card$2 = {
|
|
18936
18890
|
getEncryptedPin: function getEncryptedPin(pin) {
|
|
18937
18891
|
return pin ? encrypt(pin) : undefined;
|
|
@@ -21207,10 +21161,6 @@ var Paystack = (function (exports) {
|
|
|
21207
21161
|
},
|
|
21208
21162
|
saveReferrer: function saveReferrer(referrer) {
|
|
21209
21163
|
return AnalyticsAPI.saveReferrer(this.id, this.merchant.key, referrer);
|
|
21210
|
-
},
|
|
21211
|
-
setAmountByChannel: function setAmountByChannel(channelName) {
|
|
21212
|
-
var _this$channelFeesConf;
|
|
21213
|
-
this.amount = ((_this$channelFeesConf = this.channelFeesConfig[channelName]) === null || _this$channelFeesConf === void 0 ? void 0 : _this$channelFeesConf.amount) || this.originalAmount;
|
|
21214
21164
|
}
|
|
21215
21165
|
});
|
|
21216
21166
|
|
|
@@ -21354,7 +21304,7 @@ var Paystack = (function (exports) {
|
|
|
21354
21304
|
}, _callee4);
|
|
21355
21305
|
}))();
|
|
21356
21306
|
},
|
|
21357
|
-
|
|
21307
|
+
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21358
21308
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
21359
21309
|
var url, language, headers, payload, response;
|
|
21360
21310
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -21521,28 +21471,12 @@ var Paystack = (function (exports) {
|
|
|
21521
21471
|
});
|
|
21522
21472
|
},
|
|
21523
21473
|
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21524
|
-
return
|
|
21525
|
-
},
|
|
21526
|
-
getDirectDebitManagedAccount: function getDirectDebitManagedAccount(params) {
|
|
21527
|
-
return linkAPI.generateDirectDebitManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21474
|
+
return linkAPI.generateLinkManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21528
21475
|
device: this.deviceFingerprint,
|
|
21529
21476
|
transactionId: this.id
|
|
21530
21477
|
}));
|
|
21531
21478
|
},
|
|
21532
|
-
getManagedAccount: function getManagedAccount(_ref5) {
|
|
21533
|
-
var fulfilLateNotification = _ref5.fulfilLateNotification,
|
|
21534
|
-
preferredProvider = _ref5.preferredProvider;
|
|
21535
|
-
var params = {
|
|
21536
|
-
transaction_id: this.id,
|
|
21537
|
-
fulfil_late_notification: fulfilLateNotification,
|
|
21538
|
-
preferred_provider: preferredProvider
|
|
21539
|
-
};
|
|
21540
|
-
return PayWithTransferAPI.generateManagedAccount(params, this.merchant.key);
|
|
21541
|
-
},
|
|
21542
21479
|
listenForLinkBankPayWithTransferCharge: function listenForLinkBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21543
|
-
return this.listenForBankPayWithTransferCharge(pusherChannel, callback);
|
|
21544
|
-
},
|
|
21545
|
-
listenForBankPayWithTransferCharge: function listenForBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21546
21480
|
var listenerOptions = {
|
|
21547
21481
|
channel: pusherChannel,
|
|
21548
21482
|
paymentMethod: 'bank_transfer'
|
|
@@ -21576,7 +21510,6 @@ var Paystack = (function (exports) {
|
|
|
21576
21510
|
this.status = data.transaction_status || data.status;
|
|
21577
21511
|
this.accessCode = data.access_code;
|
|
21578
21512
|
this.amount = data.amount;
|
|
21579
|
-
this.originalAmount = data.amount;
|
|
21580
21513
|
this.domain = data.domain;
|
|
21581
21514
|
this.isTest = data.domain === 'test';
|
|
21582
21515
|
this.currency = data.currency;
|
|
@@ -21682,13 +21615,6 @@ var Paystack = (function (exports) {
|
|
|
21682
21615
|
return response && response.data;
|
|
21683
21616
|
});
|
|
21684
21617
|
}
|
|
21685
|
-
}, {
|
|
21686
|
-
key: "initializeCustomerSubscriptionAuthorization",
|
|
21687
|
-
value: function initializeCustomerSubscriptionAuthorization(payload) {
|
|
21688
|
-
return TransactionAPI.initializeCustomerSubscriptionAuthorization(payload, this.merchant.key).then(function (response) {
|
|
21689
|
-
return response && response.data;
|
|
21690
|
-
});
|
|
21691
|
-
}
|
|
21692
21618
|
}]);
|
|
21693
21619
|
return TransactionInstance;
|
|
21694
21620
|
}();
|
|
@@ -21752,7 +21678,7 @@ var Paystack = (function (exports) {
|
|
|
21752
21678
|
}
|
|
21753
21679
|
throw new Error('This function should be used with transaction data from the API');
|
|
21754
21680
|
case 5:
|
|
21755
|
-
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {
|
|
21681
|
+
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {}, {
|
|
21756
21682
|
deviceFingerprint: deviceFingerprint
|
|
21757
21683
|
}))));
|
|
21758
21684
|
case 6:
|
|
@@ -21910,19 +21836,6 @@ var Paystack = (function (exports) {
|
|
|
21910
21836
|
resolvedCardBins[bin] = data;
|
|
21911
21837
|
return data;
|
|
21912
21838
|
});
|
|
21913
|
-
},
|
|
21914
|
-
resolveIPAddress: function resolveIPAddress(ipAddress) {
|
|
21915
|
-
var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
|
|
21916
|
-
var language = getLanguage();
|
|
21917
|
-
var headers = _objectSpread2({}, language && {
|
|
21918
|
-
'Accept-Language': language
|
|
21919
|
-
});
|
|
21920
|
-
return axiosInstance.get(url, {
|
|
21921
|
-
headers: headers
|
|
21922
|
-
}).then(function (_ref2) {
|
|
21923
|
-
var data = _ref2.data;
|
|
21924
|
-
return data;
|
|
21925
|
-
});
|
|
21926
21839
|
}
|
|
21927
21840
|
};
|
|
21928
21841
|
|
|
@@ -21980,11 +21893,6 @@ var Paystack = (function (exports) {
|
|
|
21980
21893
|
value: function resolveCardBin(bin) {
|
|
21981
21894
|
return ToolkitAPI.resolveCardBin(bin);
|
|
21982
21895
|
}
|
|
21983
|
-
}, {
|
|
21984
|
-
key: "resolveIPAddress",
|
|
21985
|
-
value: function resolveIPAddress(ipAddress) {
|
|
21986
|
-
return ToolkitAPI.resolveIPAddress(ipAddress);
|
|
21987
|
-
}
|
|
21988
21896
|
}]);
|
|
21989
21897
|
return Toolkit;
|
|
21990
21898
|
}();
|
|
@@ -22272,7 +22180,6 @@ var Paystack = (function (exports) {
|
|
|
22272
22180
|
return this.saveLog();
|
|
22273
22181
|
},
|
|
22274
22182
|
logAPIResponse: function logAPIResponse(response, channel) {
|
|
22275
|
-
console.log('api response', response);
|
|
22276
22183
|
switch (response.status) {
|
|
22277
22184
|
case 'authorized':
|
|
22278
22185
|
return this.logAuthorized(channel);
|
|
@@ -22455,4 +22362,3 @@ var Paystack = (function (exports) {
|
|
|
22455
22362
|
return exports;
|
|
22456
22363
|
|
|
22457
22364
|
})({});
|
|
22458
|
-
//# sourceMappingURL=checkout.js.map
|
package/es/checkout.js
CHANGED
|
@@ -12109,17 +12109,6 @@ var TransactionAPI = {
|
|
|
12109
12109
|
}).then(function (response) {
|
|
12110
12110
|
return response.data;
|
|
12111
12111
|
});
|
|
12112
|
-
},
|
|
12113
|
-
initializeCustomerSubscriptionAuthorization: function initializeCustomerSubscriptionAuthorization(params, publicKey) {
|
|
12114
|
-
var url = new URL('/customer/authorization/initialize_subscription', configToUse.paystackApiUrl).toString();
|
|
12115
|
-
var headers = {
|
|
12116
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12117
|
-
};
|
|
12118
|
-
return axiosInstance.post(url, params, {
|
|
12119
|
-
headers: headers
|
|
12120
|
-
}).then(function (response) {
|
|
12121
|
-
return response.data;
|
|
12122
|
-
});
|
|
12123
12112
|
}
|
|
12124
12113
|
};
|
|
12125
12114
|
|
|
@@ -12137,34 +12126,6 @@ var PayWithTransferAPI = {
|
|
|
12137
12126
|
}).then(function (response) {
|
|
12138
12127
|
return ChargeResponses.parse(response.data);
|
|
12139
12128
|
});
|
|
12140
|
-
},
|
|
12141
|
-
incorrectAmountDecision: function incorrectAmountDecision(params, publicKey) {
|
|
12142
|
-
var language = getLanguage();
|
|
12143
|
-
var headers = _objectSpread2({
|
|
12144
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12145
|
-
}, language && {
|
|
12146
|
-
'Accept-Language': language
|
|
12147
|
-
});
|
|
12148
|
-
var url = new URL('pay-with-transfer/incorrect-amount/decision', configToUse.paystackApiUrl).toString();
|
|
12149
|
-
return axiosInstance.post(url, params, {
|
|
12150
|
-
headers: headers
|
|
12151
|
-
}).then(function (response) {
|
|
12152
|
-
return ChargeResponses.parse(response.data);
|
|
12153
|
-
});
|
|
12154
|
-
},
|
|
12155
|
-
authenticatePayer: function authenticatePayer(params, publicKey) {
|
|
12156
|
-
var language = getLanguage();
|
|
12157
|
-
var headers = _objectSpread2({
|
|
12158
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12159
|
-
}, language && {
|
|
12160
|
-
'Accept-Language': language
|
|
12161
|
-
});
|
|
12162
|
-
var url = new URL('pay-with-transfer/authenticate-payer', configToUse.paystackApiUrl).toString();
|
|
12163
|
-
return axiosInstance.post(url, params, {
|
|
12164
|
-
headers: headers
|
|
12165
|
-
}).then(function (response) {
|
|
12166
|
-
return ChargeResponses.parse(response.data);
|
|
12167
|
-
});
|
|
12168
12129
|
}
|
|
12169
12130
|
};
|
|
12170
12131
|
|
|
@@ -12193,25 +12154,6 @@ var PayWithTransferCharge = {
|
|
|
12193
12154
|
paymentMethod: 'bank_transfer'
|
|
12194
12155
|
};
|
|
12195
12156
|
return this.listenForCharge(listenerOptions, callback);
|
|
12196
|
-
},
|
|
12197
|
-
sendIncorrectAmountDecision: function sendIncorrectAmountDecision(decisionMade) {
|
|
12198
|
-
var params = {
|
|
12199
|
-
transaction_id: this.id,
|
|
12200
|
-
decision: decisionMade
|
|
12201
|
-
};
|
|
12202
|
-
return PayWithTransferAPI.incorrectAmountDecision(params, this.merchant.key);
|
|
12203
|
-
},
|
|
12204
|
-
sendAuthenticatePayer: function sendAuthenticatePayer(_ref2) {
|
|
12205
|
-
var amountPaid = _ref2.amountPaid,
|
|
12206
|
-
payerAccountNumber = _ref2.payerAccountNumber,
|
|
12207
|
-
payerBankSlug = _ref2.payerBankSlug;
|
|
12208
|
-
var params = {
|
|
12209
|
-
transaction_id: this.id,
|
|
12210
|
-
amount: amountPaid,
|
|
12211
|
-
payer_account_number: payerAccountNumber,
|
|
12212
|
-
payer_bank_slug: payerBankSlug
|
|
12213
|
-
};
|
|
12214
|
-
return PayWithTransferAPI.authenticatePayer(params, this.merchant.key);
|
|
12215
12157
|
}
|
|
12216
12158
|
};
|
|
12217
12159
|
|
|
@@ -18928,7 +18870,19 @@ cardValidator.creditCardType.addCard({
|
|
|
18928
18870
|
size: 3
|
|
18929
18871
|
}
|
|
18930
18872
|
});
|
|
18873
|
+
cardValidator.creditCardType.addCard({
|
|
18874
|
+
niceType: 'Afrigo',
|
|
18875
|
+
type: 'afrigo',
|
|
18876
|
+
patterns: [[56445600, 56445699], [56400001, 56409999]],
|
|
18877
|
+
gaps: [4, 8, 12],
|
|
18878
|
+
lengths: [18],
|
|
18879
|
+
code: {
|
|
18880
|
+
name: 'CVV',
|
|
18881
|
+
size: 3
|
|
18882
|
+
}
|
|
18883
|
+
});
|
|
18931
18884
|
cardValidator.creditCardType.changeOrder('verve', 0);
|
|
18885
|
+
cardValidator.creditCardType.changeOrder('afrigo', 1);
|
|
18932
18886
|
var Card$2 = {
|
|
18933
18887
|
getEncryptedPin: function getEncryptedPin(pin) {
|
|
18934
18888
|
return pin ? encrypt(pin) : undefined;
|
|
@@ -21204,10 +21158,6 @@ var AnalyticsFunctions$1 = _objectSpread2(_objectSpread2({}, CapitecPayAnalytics
|
|
|
21204
21158
|
},
|
|
21205
21159
|
saveReferrer: function saveReferrer(referrer) {
|
|
21206
21160
|
return AnalyticsAPI.saveReferrer(this.id, this.merchant.key, referrer);
|
|
21207
|
-
},
|
|
21208
|
-
setAmountByChannel: function setAmountByChannel(channelName) {
|
|
21209
|
-
var _this$channelFeesConf;
|
|
21210
|
-
this.amount = ((_this$channelFeesConf = this.channelFeesConfig[channelName]) === null || _this$channelFeesConf === void 0 ? void 0 : _this$channelFeesConf.amount) || this.originalAmount;
|
|
21211
21161
|
}
|
|
21212
21162
|
});
|
|
21213
21163
|
|
|
@@ -21351,7 +21301,7 @@ var linkAPI = {
|
|
|
21351
21301
|
}, _callee4);
|
|
21352
21302
|
}))();
|
|
21353
21303
|
},
|
|
21354
|
-
|
|
21304
|
+
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21355
21305
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
21356
21306
|
var url, language, headers, payload, response;
|
|
21357
21307
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -21518,28 +21468,12 @@ var linkChargeFunctions = {
|
|
|
21518
21468
|
});
|
|
21519
21469
|
},
|
|
21520
21470
|
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21521
|
-
return
|
|
21522
|
-
},
|
|
21523
|
-
getDirectDebitManagedAccount: function getDirectDebitManagedAccount(params) {
|
|
21524
|
-
return linkAPI.generateDirectDebitManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21471
|
+
return linkAPI.generateLinkManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21525
21472
|
device: this.deviceFingerprint,
|
|
21526
21473
|
transactionId: this.id
|
|
21527
21474
|
}));
|
|
21528
21475
|
},
|
|
21529
|
-
getManagedAccount: function getManagedAccount(_ref5) {
|
|
21530
|
-
var fulfilLateNotification = _ref5.fulfilLateNotification,
|
|
21531
|
-
preferredProvider = _ref5.preferredProvider;
|
|
21532
|
-
var params = {
|
|
21533
|
-
transaction_id: this.id,
|
|
21534
|
-
fulfil_late_notification: fulfilLateNotification,
|
|
21535
|
-
preferred_provider: preferredProvider
|
|
21536
|
-
};
|
|
21537
|
-
return PayWithTransferAPI.generateManagedAccount(params, this.merchant.key);
|
|
21538
|
-
},
|
|
21539
21476
|
listenForLinkBankPayWithTransferCharge: function listenForLinkBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21540
|
-
return this.listenForBankPayWithTransferCharge(pusherChannel, callback);
|
|
21541
|
-
},
|
|
21542
|
-
listenForBankPayWithTransferCharge: function listenForBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21543
21477
|
var listenerOptions = {
|
|
21544
21478
|
channel: pusherChannel,
|
|
21545
21479
|
paymentMethod: 'bank_transfer'
|
|
@@ -21573,7 +21507,6 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21573
21507
|
this.status = data.transaction_status || data.status;
|
|
21574
21508
|
this.accessCode = data.access_code;
|
|
21575
21509
|
this.amount = data.amount;
|
|
21576
|
-
this.originalAmount = data.amount;
|
|
21577
21510
|
this.domain = data.domain;
|
|
21578
21511
|
this.isTest = data.domain === 'test';
|
|
21579
21512
|
this.currency = data.currency;
|
|
@@ -21679,13 +21612,6 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21679
21612
|
return response && response.data;
|
|
21680
21613
|
});
|
|
21681
21614
|
}
|
|
21682
|
-
}, {
|
|
21683
|
-
key: "initializeCustomerSubscriptionAuthorization",
|
|
21684
|
-
value: function initializeCustomerSubscriptionAuthorization(payload) {
|
|
21685
|
-
return TransactionAPI.initializeCustomerSubscriptionAuthorization(payload, this.merchant.key).then(function (response) {
|
|
21686
|
-
return response && response.data;
|
|
21687
|
-
});
|
|
21688
|
-
}
|
|
21689
21615
|
}]);
|
|
21690
21616
|
return TransactionInstance;
|
|
21691
21617
|
}();
|
|
@@ -21749,7 +21675,7 @@ var Transaction = {
|
|
|
21749
21675
|
}
|
|
21750
21676
|
throw new Error('This function should be used with transaction data from the API');
|
|
21751
21677
|
case 5:
|
|
21752
|
-
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {
|
|
21678
|
+
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {}, {
|
|
21753
21679
|
deviceFingerprint: deviceFingerprint
|
|
21754
21680
|
}))));
|
|
21755
21681
|
case 6:
|
|
@@ -21907,19 +21833,6 @@ var ToolkitAPI = {
|
|
|
21907
21833
|
resolvedCardBins[bin] = data;
|
|
21908
21834
|
return data;
|
|
21909
21835
|
});
|
|
21910
|
-
},
|
|
21911
|
-
resolveIPAddress: function resolveIPAddress(ipAddress) {
|
|
21912
|
-
var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
|
|
21913
|
-
var language = getLanguage();
|
|
21914
|
-
var headers = _objectSpread2({}, language && {
|
|
21915
|
-
'Accept-Language': language
|
|
21916
|
-
});
|
|
21917
|
-
return axiosInstance.get(url, {
|
|
21918
|
-
headers: headers
|
|
21919
|
-
}).then(function (_ref2) {
|
|
21920
|
-
var data = _ref2.data;
|
|
21921
|
-
return data;
|
|
21922
|
-
});
|
|
21923
21836
|
}
|
|
21924
21837
|
};
|
|
21925
21838
|
|
|
@@ -21977,11 +21890,6 @@ var Toolkit = /*#__PURE__*/function () {
|
|
|
21977
21890
|
value: function resolveCardBin(bin) {
|
|
21978
21891
|
return ToolkitAPI.resolveCardBin(bin);
|
|
21979
21892
|
}
|
|
21980
|
-
}, {
|
|
21981
|
-
key: "resolveIPAddress",
|
|
21982
|
-
value: function resolveIPAddress(ipAddress) {
|
|
21983
|
-
return ToolkitAPI.resolveIPAddress(ipAddress);
|
|
21984
|
-
}
|
|
21985
21893
|
}]);
|
|
21986
21894
|
return Toolkit;
|
|
21987
21895
|
}();
|
|
@@ -22269,7 +22177,6 @@ var AnalyticsFunctions = {
|
|
|
22269
22177
|
return this.saveLog();
|
|
22270
22178
|
},
|
|
22271
22179
|
logAPIResponse: function logAPIResponse(response, channel) {
|
|
22272
|
-
console.log('api response', response);
|
|
22273
22180
|
switch (response.status) {
|
|
22274
22181
|
case 'authorized':
|
|
22275
22182
|
return this.logAuthorized(channel);
|
|
@@ -22442,4 +22349,3 @@ var Preauthorization = {
|
|
|
22442
22349
|
};
|
|
22443
22350
|
|
|
22444
22351
|
export { BankAccount, Card$1 as Card, Preauthorization, Toolkit, Transaction };
|
|
22445
|
-
//# sourceMappingURL=checkout.js.map
|
package/lib/checkout.js
CHANGED
|
@@ -12113,17 +12113,6 @@ var TransactionAPI = {
|
|
|
12113
12113
|
}).then(function (response) {
|
|
12114
12114
|
return response.data;
|
|
12115
12115
|
});
|
|
12116
|
-
},
|
|
12117
|
-
initializeCustomerSubscriptionAuthorization: function initializeCustomerSubscriptionAuthorization(params, publicKey) {
|
|
12118
|
-
var url = new URL('/customer/authorization/initialize_subscription', configToUse.paystackApiUrl).toString();
|
|
12119
|
-
var headers = {
|
|
12120
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12121
|
-
};
|
|
12122
|
-
return axiosInstance.post(url, params, {
|
|
12123
|
-
headers: headers
|
|
12124
|
-
}).then(function (response) {
|
|
12125
|
-
return response.data;
|
|
12126
|
-
});
|
|
12127
12116
|
}
|
|
12128
12117
|
};
|
|
12129
12118
|
|
|
@@ -12141,34 +12130,6 @@ var PayWithTransferAPI = {
|
|
|
12141
12130
|
}).then(function (response) {
|
|
12142
12131
|
return ChargeResponses.parse(response.data);
|
|
12143
12132
|
});
|
|
12144
|
-
},
|
|
12145
|
-
incorrectAmountDecision: function incorrectAmountDecision(params, publicKey) {
|
|
12146
|
-
var language = getLanguage();
|
|
12147
|
-
var headers = _objectSpread2({
|
|
12148
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12149
|
-
}, language && {
|
|
12150
|
-
'Accept-Language': language
|
|
12151
|
-
});
|
|
12152
|
-
var url = new URL('pay-with-transfer/incorrect-amount/decision', configToUse.paystackApiUrl).toString();
|
|
12153
|
-
return axiosInstance.post(url, params, {
|
|
12154
|
-
headers: headers
|
|
12155
|
-
}).then(function (response) {
|
|
12156
|
-
return ChargeResponses.parse(response.data);
|
|
12157
|
-
});
|
|
12158
|
-
},
|
|
12159
|
-
authenticatePayer: function authenticatePayer(params, publicKey) {
|
|
12160
|
-
var language = getLanguage();
|
|
12161
|
-
var headers = _objectSpread2({
|
|
12162
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12163
|
-
}, language && {
|
|
12164
|
-
'Accept-Language': language
|
|
12165
|
-
});
|
|
12166
|
-
var url = new URL('pay-with-transfer/authenticate-payer', configToUse.paystackApiUrl).toString();
|
|
12167
|
-
return axiosInstance.post(url, params, {
|
|
12168
|
-
headers: headers
|
|
12169
|
-
}).then(function (response) {
|
|
12170
|
-
return ChargeResponses.parse(response.data);
|
|
12171
|
-
});
|
|
12172
12133
|
}
|
|
12173
12134
|
};
|
|
12174
12135
|
|
|
@@ -12197,25 +12158,6 @@ var PayWithTransferCharge = {
|
|
|
12197
12158
|
paymentMethod: 'bank_transfer'
|
|
12198
12159
|
};
|
|
12199
12160
|
return this.listenForCharge(listenerOptions, callback);
|
|
12200
|
-
},
|
|
12201
|
-
sendIncorrectAmountDecision: function sendIncorrectAmountDecision(decisionMade) {
|
|
12202
|
-
var params = {
|
|
12203
|
-
transaction_id: this.id,
|
|
12204
|
-
decision: decisionMade
|
|
12205
|
-
};
|
|
12206
|
-
return PayWithTransferAPI.incorrectAmountDecision(params, this.merchant.key);
|
|
12207
|
-
},
|
|
12208
|
-
sendAuthenticatePayer: function sendAuthenticatePayer(_ref2) {
|
|
12209
|
-
var amountPaid = _ref2.amountPaid,
|
|
12210
|
-
payerAccountNumber = _ref2.payerAccountNumber,
|
|
12211
|
-
payerBankSlug = _ref2.payerBankSlug;
|
|
12212
|
-
var params = {
|
|
12213
|
-
transaction_id: this.id,
|
|
12214
|
-
amount: amountPaid,
|
|
12215
|
-
payer_account_number: payerAccountNumber,
|
|
12216
|
-
payer_bank_slug: payerBankSlug
|
|
12217
|
-
};
|
|
12218
|
-
return PayWithTransferAPI.authenticatePayer(params, this.merchant.key);
|
|
12219
12161
|
}
|
|
12220
12162
|
};
|
|
12221
12163
|
|
|
@@ -18932,7 +18874,19 @@ cardValidator.creditCardType.addCard({
|
|
|
18932
18874
|
size: 3
|
|
18933
18875
|
}
|
|
18934
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
|
+
});
|
|
18935
18888
|
cardValidator.creditCardType.changeOrder('verve', 0);
|
|
18889
|
+
cardValidator.creditCardType.changeOrder('afrigo', 1);
|
|
18936
18890
|
var Card$2 = {
|
|
18937
18891
|
getEncryptedPin: function getEncryptedPin(pin) {
|
|
18938
18892
|
return pin ? encrypt(pin) : undefined;
|
|
@@ -21208,10 +21162,6 @@ var AnalyticsFunctions$1 = _objectSpread2(_objectSpread2({}, CapitecPayAnalytics
|
|
|
21208
21162
|
},
|
|
21209
21163
|
saveReferrer: function saveReferrer(referrer) {
|
|
21210
21164
|
return AnalyticsAPI.saveReferrer(this.id, this.merchant.key, referrer);
|
|
21211
|
-
},
|
|
21212
|
-
setAmountByChannel: function setAmountByChannel(channelName) {
|
|
21213
|
-
var _this$channelFeesConf;
|
|
21214
|
-
this.amount = ((_this$channelFeesConf = this.channelFeesConfig[channelName]) === null || _this$channelFeesConf === void 0 ? void 0 : _this$channelFeesConf.amount) || this.originalAmount;
|
|
21215
21165
|
}
|
|
21216
21166
|
});
|
|
21217
21167
|
|
|
@@ -21355,7 +21305,7 @@ var linkAPI = {
|
|
|
21355
21305
|
}, _callee4);
|
|
21356
21306
|
}))();
|
|
21357
21307
|
},
|
|
21358
|
-
|
|
21308
|
+
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21359
21309
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
21360
21310
|
var url, language, headers, payload, response;
|
|
21361
21311
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -21522,28 +21472,12 @@ var linkChargeFunctions = {
|
|
|
21522
21472
|
});
|
|
21523
21473
|
},
|
|
21524
21474
|
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21525
|
-
return
|
|
21526
|
-
},
|
|
21527
|
-
getDirectDebitManagedAccount: function getDirectDebitManagedAccount(params) {
|
|
21528
|
-
return linkAPI.generateDirectDebitManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21475
|
+
return linkAPI.generateLinkManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21529
21476
|
device: this.deviceFingerprint,
|
|
21530
21477
|
transactionId: this.id
|
|
21531
21478
|
}));
|
|
21532
21479
|
},
|
|
21533
|
-
getManagedAccount: function getManagedAccount(_ref5) {
|
|
21534
|
-
var fulfilLateNotification = _ref5.fulfilLateNotification,
|
|
21535
|
-
preferredProvider = _ref5.preferredProvider;
|
|
21536
|
-
var params = {
|
|
21537
|
-
transaction_id: this.id,
|
|
21538
|
-
fulfil_late_notification: fulfilLateNotification,
|
|
21539
|
-
preferred_provider: preferredProvider
|
|
21540
|
-
};
|
|
21541
|
-
return PayWithTransferAPI.generateManagedAccount(params, this.merchant.key);
|
|
21542
|
-
},
|
|
21543
21480
|
listenForLinkBankPayWithTransferCharge: function listenForLinkBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21544
|
-
return this.listenForBankPayWithTransferCharge(pusherChannel, callback);
|
|
21545
|
-
},
|
|
21546
|
-
listenForBankPayWithTransferCharge: function listenForBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21547
21481
|
var listenerOptions = {
|
|
21548
21482
|
channel: pusherChannel,
|
|
21549
21483
|
paymentMethod: 'bank_transfer'
|
|
@@ -21577,7 +21511,6 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21577
21511
|
this.status = data.transaction_status || data.status;
|
|
21578
21512
|
this.accessCode = data.access_code;
|
|
21579
21513
|
this.amount = data.amount;
|
|
21580
|
-
this.originalAmount = data.amount;
|
|
21581
21514
|
this.domain = data.domain;
|
|
21582
21515
|
this.isTest = data.domain === 'test';
|
|
21583
21516
|
this.currency = data.currency;
|
|
@@ -21683,13 +21616,6 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21683
21616
|
return response && response.data;
|
|
21684
21617
|
});
|
|
21685
21618
|
}
|
|
21686
|
-
}, {
|
|
21687
|
-
key: "initializeCustomerSubscriptionAuthorization",
|
|
21688
|
-
value: function initializeCustomerSubscriptionAuthorization(payload) {
|
|
21689
|
-
return TransactionAPI.initializeCustomerSubscriptionAuthorization(payload, this.merchant.key).then(function (response) {
|
|
21690
|
-
return response && response.data;
|
|
21691
|
-
});
|
|
21692
|
-
}
|
|
21693
21619
|
}]);
|
|
21694
21620
|
return TransactionInstance;
|
|
21695
21621
|
}();
|
|
@@ -21753,7 +21679,7 @@ var Transaction = {
|
|
|
21753
21679
|
}
|
|
21754
21680
|
throw new Error('This function should be used with transaction data from the API');
|
|
21755
21681
|
case 5:
|
|
21756
|
-
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {
|
|
21682
|
+
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {}, {
|
|
21757
21683
|
deviceFingerprint: deviceFingerprint
|
|
21758
21684
|
}))));
|
|
21759
21685
|
case 6:
|
|
@@ -21911,19 +21837,6 @@ var ToolkitAPI = {
|
|
|
21911
21837
|
resolvedCardBins[bin] = data;
|
|
21912
21838
|
return data;
|
|
21913
21839
|
});
|
|
21914
|
-
},
|
|
21915
|
-
resolveIPAddress: function resolveIPAddress(ipAddress) {
|
|
21916
|
-
var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
|
|
21917
|
-
var language = getLanguage();
|
|
21918
|
-
var headers = _objectSpread2({}, language && {
|
|
21919
|
-
'Accept-Language': language
|
|
21920
|
-
});
|
|
21921
|
-
return axiosInstance.get(url, {
|
|
21922
|
-
headers: headers
|
|
21923
|
-
}).then(function (_ref2) {
|
|
21924
|
-
var data = _ref2.data;
|
|
21925
|
-
return data;
|
|
21926
|
-
});
|
|
21927
21840
|
}
|
|
21928
21841
|
};
|
|
21929
21842
|
|
|
@@ -21981,11 +21894,6 @@ var Toolkit = /*#__PURE__*/function () {
|
|
|
21981
21894
|
value: function resolveCardBin(bin) {
|
|
21982
21895
|
return ToolkitAPI.resolveCardBin(bin);
|
|
21983
21896
|
}
|
|
21984
|
-
}, {
|
|
21985
|
-
key: "resolveIPAddress",
|
|
21986
|
-
value: function resolveIPAddress(ipAddress) {
|
|
21987
|
-
return ToolkitAPI.resolveIPAddress(ipAddress);
|
|
21988
|
-
}
|
|
21989
21897
|
}]);
|
|
21990
21898
|
return Toolkit;
|
|
21991
21899
|
}();
|
|
@@ -22273,7 +22181,6 @@ var AnalyticsFunctions = {
|
|
|
22273
22181
|
return this.saveLog();
|
|
22274
22182
|
},
|
|
22275
22183
|
logAPIResponse: function logAPIResponse(response, channel) {
|
|
22276
|
-
console.log('api response', response);
|
|
22277
22184
|
switch (response.status) {
|
|
22278
22185
|
case 'authorized':
|
|
22279
22186
|
return this.logAuthorized(channel);
|
|
@@ -22450,4 +22357,3 @@ exports.Card = Card$1;
|
|
|
22450
22357
|
exports.Preauthorization = Preauthorization;
|
|
22451
22358
|
exports.Toolkit = Toolkit;
|
|
22452
22359
|
exports.Transaction = Transaction;
|
|
22453
|
-
//# sourceMappingURL=checkout.js.map
|