@paystack/checkout-js 1.45.0-dev.4 → 1.45.1-dev.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 +8 -151
- package/es/checkout.js +8 -151
- package/lib/checkout.js +8 -151
- 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
|
@@ -6339,22 +6339,19 @@ var Paystack = (function (exports) {
|
|
|
6339
6339
|
checkoutUrl: 'http://localhost:8080/',
|
|
6340
6340
|
paymentBaseUrl: 'https://legacy-staging.paystack.co/',
|
|
6341
6341
|
paystackApiUrl: 'https://studio-api.paystack.co/',
|
|
6342
|
-
pusherKey: '1c7b262ee18455815893'
|
|
6343
|
-
pusherUrl: 'https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js'
|
|
6342
|
+
pusherKey: '1c7b262ee18455815893'
|
|
6344
6343
|
});
|
|
6345
6344
|
var stagingConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
6346
6345
|
checkoutUrl: 'https://checkout-studio.paystack.com/',
|
|
6347
6346
|
paymentBaseUrl: 'https://legacy-staging.paystack.co/',
|
|
6348
6347
|
paystackApiUrl: 'https://studio-api.paystack.co/',
|
|
6349
|
-
pusherKey: '1c7b262ee18455815893'
|
|
6350
|
-
pusherUrl: 'https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js'
|
|
6348
|
+
pusherKey: '1c7b262ee18455815893'
|
|
6351
6349
|
});
|
|
6352
6350
|
var productionConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
6353
6351
|
checkoutUrl: 'https://checkout.paystack.com/',
|
|
6354
6352
|
paymentBaseUrl: 'https://standard.paystack.co/',
|
|
6355
6353
|
paystackApiUrl: 'https://api.paystack.co/',
|
|
6356
|
-
pusherKey: '8e4b9b7ca3418bd5cdc8'
|
|
6357
|
-
pusherUrl: 'https://checkout.paystack.com/static/vendor/pusher.min.js'
|
|
6354
|
+
pusherKey: '8e4b9b7ca3418bd5cdc8'
|
|
6358
6355
|
});
|
|
6359
6356
|
var configToEnvironmentMapping = {
|
|
6360
6357
|
dev: devConfig,
|
|
@@ -6538,35 +6535,11 @@ var Paystack = (function (exports) {
|
|
|
6538
6535
|
}
|
|
6539
6536
|
};
|
|
6540
6537
|
|
|
6541
|
-
|
|
6542
|
-
var pusherLoaded = function pusherLoaded() {
|
|
6543
|
-
return document.getElementById(pusherScriptId);
|
|
6544
|
-
};
|
|
6545
|
-
var loadPusher = function loadPusher() {
|
|
6546
|
-
if (!window) {
|
|
6547
|
-
return Promise.reject(new Error('Window object not available'));
|
|
6548
|
-
}
|
|
6549
|
-
if (pusherLoaded()) {
|
|
6550
|
-
return Promise.resolve(true);
|
|
6551
|
-
}
|
|
6552
|
-
return new Promise(function (resolve, reject) {
|
|
6553
|
-
var script = document.createElement('script');
|
|
6554
|
-
script.src = configToUse.pusherUrl;
|
|
6555
|
-
script.id = pusherScriptId;
|
|
6556
|
-
script.onload = function () {
|
|
6557
|
-
resolve(true);
|
|
6558
|
-
};
|
|
6559
|
-
script.onerror = function () {
|
|
6560
|
-
script.remove();
|
|
6561
|
-
reject(new Error('Failed to load Pusher script'));
|
|
6562
|
-
};
|
|
6563
|
-
document.head.appendChild(script);
|
|
6564
|
-
});
|
|
6565
|
-
};
|
|
6538
|
+
/* eslint-env browser */
|
|
6566
6539
|
|
|
6567
6540
|
// `context` is passed through to set the class property of `isListening` to true/false
|
|
6568
6541
|
// and provide the logAPIResponse analytics function
|
|
6569
|
-
// eslint-disable-next-line consistent-return
|
|
6542
|
+
// eslint-disable-next-line consistent-return, import/prefer-default-export
|
|
6570
6543
|
var subscribeToChargeEvents = function subscribeToChargeEvents(options, context, callback) {
|
|
6571
6544
|
var channel = options.channel,
|
|
6572
6545
|
paymentMethod = options.paymentMethod;
|
|
@@ -12139,17 +12112,6 @@ var Paystack = (function (exports) {
|
|
|
12139
12112
|
}).then(function (response) {
|
|
12140
12113
|
return response.data;
|
|
12141
12114
|
});
|
|
12142
|
-
},
|
|
12143
|
-
initializeCustomerSubscriptionAuthorization: function initializeCustomerSubscriptionAuthorization(params, publicKey) {
|
|
12144
|
-
var url = new URL('/customer/authorization/initialize_subscription', configToUse.paystackApiUrl).toString();
|
|
12145
|
-
var headers = {
|
|
12146
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12147
|
-
};
|
|
12148
|
-
return axiosInstance.post(url, params, {
|
|
12149
|
-
headers: headers
|
|
12150
|
-
}).then(function (response) {
|
|
12151
|
-
return response.data;
|
|
12152
|
-
});
|
|
12153
12115
|
}
|
|
12154
12116
|
};
|
|
12155
12117
|
|
|
@@ -12167,34 +12129,6 @@ var Paystack = (function (exports) {
|
|
|
12167
12129
|
}).then(function (response) {
|
|
12168
12130
|
return ChargeResponses.parse(response.data);
|
|
12169
12131
|
});
|
|
12170
|
-
},
|
|
12171
|
-
incorrectAmountDecision: function incorrectAmountDecision(params, publicKey) {
|
|
12172
|
-
var language = getLanguage();
|
|
12173
|
-
var headers = _objectSpread2({
|
|
12174
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12175
|
-
}, language && {
|
|
12176
|
-
'Accept-Language': language
|
|
12177
|
-
});
|
|
12178
|
-
var url = new URL('pay-with-transfer/incorrect-amount/decision', configToUse.paystackApiUrl).toString();
|
|
12179
|
-
return axiosInstance.post(url, params, {
|
|
12180
|
-
headers: headers
|
|
12181
|
-
}).then(function (response) {
|
|
12182
|
-
return ChargeResponses.parse(response.data);
|
|
12183
|
-
});
|
|
12184
|
-
},
|
|
12185
|
-
authenticatePayer: function authenticatePayer(params, publicKey) {
|
|
12186
|
-
var language = getLanguage();
|
|
12187
|
-
var headers = _objectSpread2({
|
|
12188
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12189
|
-
}, language && {
|
|
12190
|
-
'Accept-Language': language
|
|
12191
|
-
});
|
|
12192
|
-
var url = new URL('pay-with-transfer/authenticate-payer', configToUse.paystackApiUrl).toString();
|
|
12193
|
-
return axiosInstance.post(url, params, {
|
|
12194
|
-
headers: headers
|
|
12195
|
-
}).then(function (response) {
|
|
12196
|
-
return ChargeResponses.parse(response.data);
|
|
12197
|
-
});
|
|
12198
12132
|
}
|
|
12199
12133
|
};
|
|
12200
12134
|
|
|
@@ -12223,25 +12157,6 @@ var Paystack = (function (exports) {
|
|
|
12223
12157
|
paymentMethod: 'bank_transfer'
|
|
12224
12158
|
};
|
|
12225
12159
|
return this.listenForCharge(listenerOptions, callback);
|
|
12226
|
-
},
|
|
12227
|
-
sendIncorrectAmountDecision: function sendIncorrectAmountDecision(decisionMade) {
|
|
12228
|
-
var params = {
|
|
12229
|
-
transaction_id: this.id,
|
|
12230
|
-
decision: decisionMade
|
|
12231
|
-
};
|
|
12232
|
-
return PayWithTransferAPI.incorrectAmountDecision(params, this.merchant.key);
|
|
12233
|
-
},
|
|
12234
|
-
sendAuthenticatePayer: function sendAuthenticatePayer(_ref2) {
|
|
12235
|
-
var amountPaid = _ref2.amountPaid,
|
|
12236
|
-
payerAccountNumber = _ref2.payerAccountNumber,
|
|
12237
|
-
payerBankSlug = _ref2.payerBankSlug;
|
|
12238
|
-
var params = {
|
|
12239
|
-
transaction_id: this.id,
|
|
12240
|
-
amount: amountPaid,
|
|
12241
|
-
payer_account_number: payerAccountNumber,
|
|
12242
|
-
payer_bank_slug: payerBankSlug
|
|
12243
|
-
};
|
|
12244
|
-
return PayWithTransferAPI.authenticatePayer(params, this.merchant.key);
|
|
12245
12160
|
}
|
|
12246
12161
|
};
|
|
12247
12162
|
|
|
@@ -21234,10 +21149,6 @@ var Paystack = (function (exports) {
|
|
|
21234
21149
|
},
|
|
21235
21150
|
saveReferrer: function saveReferrer(referrer) {
|
|
21236
21151
|
return AnalyticsAPI.saveReferrer(this.id, this.merchant.key, referrer);
|
|
21237
|
-
},
|
|
21238
|
-
setAmountByChannel: function setAmountByChannel(channelName) {
|
|
21239
|
-
var _this$channelFeesConf;
|
|
21240
|
-
this.amount = ((_this$channelFeesConf = this.channelFeesConfig[channelName]) === null || _this$channelFeesConf === void 0 ? void 0 : _this$channelFeesConf.amount) || this.originalAmount;
|
|
21241
21152
|
}
|
|
21242
21153
|
});
|
|
21243
21154
|
|
|
@@ -21381,7 +21292,7 @@ var Paystack = (function (exports) {
|
|
|
21381
21292
|
}, _callee4);
|
|
21382
21293
|
}))();
|
|
21383
21294
|
},
|
|
21384
|
-
|
|
21295
|
+
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21385
21296
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
21386
21297
|
var url, language, headers, payload, response;
|
|
21387
21298
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -21548,28 +21459,12 @@ var Paystack = (function (exports) {
|
|
|
21548
21459
|
});
|
|
21549
21460
|
},
|
|
21550
21461
|
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21551
|
-
return
|
|
21552
|
-
},
|
|
21553
|
-
getDirectDebitManagedAccount: function getDirectDebitManagedAccount(params) {
|
|
21554
|
-
return linkAPI.generateDirectDebitManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21462
|
+
return linkAPI.generateLinkManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21555
21463
|
device: this.deviceFingerprint,
|
|
21556
21464
|
transactionId: this.id
|
|
21557
21465
|
}));
|
|
21558
21466
|
},
|
|
21559
|
-
getManagedAccount: function getManagedAccount(_ref5) {
|
|
21560
|
-
var fulfilLateNotification = _ref5.fulfilLateNotification,
|
|
21561
|
-
preferredProvider = _ref5.preferredProvider;
|
|
21562
|
-
var params = {
|
|
21563
|
-
transaction_id: this.id,
|
|
21564
|
-
fulfil_late_notification: fulfilLateNotification,
|
|
21565
|
-
preferred_provider: preferredProvider
|
|
21566
|
-
};
|
|
21567
|
-
return PayWithTransferAPI.generateManagedAccount(params, this.merchant.key);
|
|
21568
|
-
},
|
|
21569
21467
|
listenForLinkBankPayWithTransferCharge: function listenForLinkBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21570
|
-
return this.listenForBankPayWithTransferCharge(pusherChannel, callback);
|
|
21571
|
-
},
|
|
21572
|
-
listenForBankPayWithTransferCharge: function listenForBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21573
21468
|
var listenerOptions = {
|
|
21574
21469
|
channel: pusherChannel,
|
|
21575
21470
|
paymentMethod: 'bank_transfer'
|
|
@@ -21603,7 +21498,6 @@ var Paystack = (function (exports) {
|
|
|
21603
21498
|
this.status = data.transaction_status || data.status;
|
|
21604
21499
|
this.accessCode = data.access_code;
|
|
21605
21500
|
this.amount = data.amount;
|
|
21606
|
-
this.originalAmount = data.amount;
|
|
21607
21501
|
this.domain = data.domain;
|
|
21608
21502
|
this.isTest = data.domain === 'test';
|
|
21609
21503
|
this.currency = data.currency;
|
|
@@ -21647,15 +21541,6 @@ var Paystack = (function (exports) {
|
|
|
21647
21541
|
this.reference = data.reference;
|
|
21648
21542
|
this.linkConfig = data.link_config || {};
|
|
21649
21543
|
|
|
21650
|
-
/**
|
|
21651
|
-
* We initialize parameters we send to the API as empty strings
|
|
21652
|
-
* when we don't have them instead of null because the API expects
|
|
21653
|
-
* these parameters as URL params which means parameters are eventually converted to strings
|
|
21654
|
-
*/
|
|
21655
|
-
|
|
21656
|
-
// Load pusher
|
|
21657
|
-
loadPusher();
|
|
21658
|
-
|
|
21659
21544
|
// Analytics
|
|
21660
21545
|
this.log = null;
|
|
21661
21546
|
Object.assign(this, AnalyticsFunctions$1);
|
|
@@ -21718,13 +21603,6 @@ var Paystack = (function (exports) {
|
|
|
21718
21603
|
return response && response.data;
|
|
21719
21604
|
});
|
|
21720
21605
|
}
|
|
21721
|
-
}, {
|
|
21722
|
-
key: "initializeCustomerSubscriptionAuthorization",
|
|
21723
|
-
value: function initializeCustomerSubscriptionAuthorization(payload) {
|
|
21724
|
-
return TransactionAPI.initializeCustomerSubscriptionAuthorization(payload, this.merchant.key).then(function (response) {
|
|
21725
|
-
return response && response.data;
|
|
21726
|
-
});
|
|
21727
|
-
}
|
|
21728
21606
|
}]);
|
|
21729
21607
|
return TransactionInstance;
|
|
21730
21608
|
}();
|
|
@@ -21788,7 +21666,7 @@ var Paystack = (function (exports) {
|
|
|
21788
21666
|
}
|
|
21789
21667
|
throw new Error('This function should be used with transaction data from the API');
|
|
21790
21668
|
case 5:
|
|
21791
|
-
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {
|
|
21669
|
+
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {}, {
|
|
21792
21670
|
deviceFingerprint: deviceFingerprint
|
|
21793
21671
|
}))));
|
|
21794
21672
|
case 6:
|
|
@@ -21946,19 +21824,6 @@ var Paystack = (function (exports) {
|
|
|
21946
21824
|
resolvedCardBins[bin] = data;
|
|
21947
21825
|
return data;
|
|
21948
21826
|
});
|
|
21949
|
-
},
|
|
21950
|
-
resolveIPAddress: function resolveIPAddress(ipAddress) {
|
|
21951
|
-
var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
|
|
21952
|
-
var language = getLanguage();
|
|
21953
|
-
var headers = _objectSpread2({}, language && {
|
|
21954
|
-
'Accept-Language': language
|
|
21955
|
-
});
|
|
21956
|
-
return axiosInstance.get(url, {
|
|
21957
|
-
headers: headers
|
|
21958
|
-
}).then(function (_ref2) {
|
|
21959
|
-
var data = _ref2.data;
|
|
21960
|
-
return data;
|
|
21961
|
-
});
|
|
21962
21827
|
}
|
|
21963
21828
|
};
|
|
21964
21829
|
|
|
@@ -22016,11 +21881,6 @@ var Paystack = (function (exports) {
|
|
|
22016
21881
|
value: function resolveCardBin(bin) {
|
|
22017
21882
|
return ToolkitAPI.resolveCardBin(bin);
|
|
22018
21883
|
}
|
|
22019
|
-
}, {
|
|
22020
|
-
key: "resolveIPAddress",
|
|
22021
|
-
value: function resolveIPAddress(ipAddress) {
|
|
22022
|
-
return ToolkitAPI.resolveIPAddress(ipAddress);
|
|
22023
|
-
}
|
|
22024
21884
|
}]);
|
|
22025
21885
|
return Toolkit;
|
|
22026
21886
|
}();
|
|
@@ -22308,7 +22168,6 @@ var Paystack = (function (exports) {
|
|
|
22308
22168
|
return this.saveLog();
|
|
22309
22169
|
},
|
|
22310
22170
|
logAPIResponse: function logAPIResponse(response, channel) {
|
|
22311
|
-
console.log('api response', response);
|
|
22312
22171
|
switch (response.status) {
|
|
22313
22172
|
case 'authorized':
|
|
22314
22173
|
return this.logAuthorized(channel);
|
|
@@ -22416,7 +22275,6 @@ var Paystack = (function (exports) {
|
|
|
22416
22275
|
key: data.merchant_key
|
|
22417
22276
|
};
|
|
22418
22277
|
this.card = {};
|
|
22419
|
-
loadPusher();
|
|
22420
22278
|
this.log = null;
|
|
22421
22279
|
Object.assign(this, AnalyticsFunctions);
|
|
22422
22280
|
this.initializeLog(data.log);
|
|
@@ -22492,4 +22350,3 @@ var Paystack = (function (exports) {
|
|
|
22492
22350
|
return exports;
|
|
22493
22351
|
|
|
22494
22352
|
})({});
|
|
22495
|
-
//# sourceMappingURL=checkout.js.map
|
package/es/checkout.js
CHANGED
|
@@ -6336,22 +6336,19 @@ var devConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
|
6336
6336
|
checkoutUrl: 'http://localhost:8080/',
|
|
6337
6337
|
paymentBaseUrl: 'https://legacy-staging.paystack.co/',
|
|
6338
6338
|
paystackApiUrl: 'https://studio-api.paystack.co/',
|
|
6339
|
-
pusherKey: '1c7b262ee18455815893'
|
|
6340
|
-
pusherUrl: 'https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js'
|
|
6339
|
+
pusherKey: '1c7b262ee18455815893'
|
|
6341
6340
|
});
|
|
6342
6341
|
var stagingConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
6343
6342
|
checkoutUrl: 'https://checkout-studio.paystack.com/',
|
|
6344
6343
|
paymentBaseUrl: 'https://legacy-staging.paystack.co/',
|
|
6345
6344
|
paystackApiUrl: 'https://studio-api.paystack.co/',
|
|
6346
|
-
pusherKey: '1c7b262ee18455815893'
|
|
6347
|
-
pusherUrl: 'https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js'
|
|
6345
|
+
pusherKey: '1c7b262ee18455815893'
|
|
6348
6346
|
});
|
|
6349
6347
|
var productionConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
6350
6348
|
checkoutUrl: 'https://checkout.paystack.com/',
|
|
6351
6349
|
paymentBaseUrl: 'https://standard.paystack.co/',
|
|
6352
6350
|
paystackApiUrl: 'https://api.paystack.co/',
|
|
6353
|
-
pusherKey: '8e4b9b7ca3418bd5cdc8'
|
|
6354
|
-
pusherUrl: 'https://checkout.paystack.com/static/vendor/pusher.min.js'
|
|
6351
|
+
pusherKey: '8e4b9b7ca3418bd5cdc8'
|
|
6355
6352
|
});
|
|
6356
6353
|
var configToEnvironmentMapping = {
|
|
6357
6354
|
dev: devConfig,
|
|
@@ -6535,35 +6532,11 @@ var ChargeResponses = {
|
|
|
6535
6532
|
}
|
|
6536
6533
|
};
|
|
6537
6534
|
|
|
6538
|
-
|
|
6539
|
-
var pusherLoaded = function pusherLoaded() {
|
|
6540
|
-
return document.getElementById(pusherScriptId);
|
|
6541
|
-
};
|
|
6542
|
-
var loadPusher = function loadPusher() {
|
|
6543
|
-
if (!window) {
|
|
6544
|
-
return Promise.reject(new Error('Window object not available'));
|
|
6545
|
-
}
|
|
6546
|
-
if (pusherLoaded()) {
|
|
6547
|
-
return Promise.resolve(true);
|
|
6548
|
-
}
|
|
6549
|
-
return new Promise(function (resolve, reject) {
|
|
6550
|
-
var script = document.createElement('script');
|
|
6551
|
-
script.src = configToUse.pusherUrl;
|
|
6552
|
-
script.id = pusherScriptId;
|
|
6553
|
-
script.onload = function () {
|
|
6554
|
-
resolve(true);
|
|
6555
|
-
};
|
|
6556
|
-
script.onerror = function () {
|
|
6557
|
-
script.remove();
|
|
6558
|
-
reject(new Error('Failed to load Pusher script'));
|
|
6559
|
-
};
|
|
6560
|
-
document.head.appendChild(script);
|
|
6561
|
-
});
|
|
6562
|
-
};
|
|
6535
|
+
/* eslint-env browser */
|
|
6563
6536
|
|
|
6564
6537
|
// `context` is passed through to set the class property of `isListening` to true/false
|
|
6565
6538
|
// and provide the logAPIResponse analytics function
|
|
6566
|
-
// eslint-disable-next-line consistent-return
|
|
6539
|
+
// eslint-disable-next-line consistent-return, import/prefer-default-export
|
|
6567
6540
|
var subscribeToChargeEvents = function subscribeToChargeEvents(options, context, callback) {
|
|
6568
6541
|
var channel = options.channel,
|
|
6569
6542
|
paymentMethod = options.paymentMethod;
|
|
@@ -12136,17 +12109,6 @@ var TransactionAPI = {
|
|
|
12136
12109
|
}).then(function (response) {
|
|
12137
12110
|
return response.data;
|
|
12138
12111
|
});
|
|
12139
|
-
},
|
|
12140
|
-
initializeCustomerSubscriptionAuthorization: function initializeCustomerSubscriptionAuthorization(params, publicKey) {
|
|
12141
|
-
var url = new URL('/customer/authorization/initialize_subscription', configToUse.paystackApiUrl).toString();
|
|
12142
|
-
var headers = {
|
|
12143
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12144
|
-
};
|
|
12145
|
-
return axiosInstance.post(url, params, {
|
|
12146
|
-
headers: headers
|
|
12147
|
-
}).then(function (response) {
|
|
12148
|
-
return response.data;
|
|
12149
|
-
});
|
|
12150
12112
|
}
|
|
12151
12113
|
};
|
|
12152
12114
|
|
|
@@ -12164,34 +12126,6 @@ var PayWithTransferAPI = {
|
|
|
12164
12126
|
}).then(function (response) {
|
|
12165
12127
|
return ChargeResponses.parse(response.data);
|
|
12166
12128
|
});
|
|
12167
|
-
},
|
|
12168
|
-
incorrectAmountDecision: function incorrectAmountDecision(params, publicKey) {
|
|
12169
|
-
var language = getLanguage();
|
|
12170
|
-
var headers = _objectSpread2({
|
|
12171
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12172
|
-
}, language && {
|
|
12173
|
-
'Accept-Language': language
|
|
12174
|
-
});
|
|
12175
|
-
var url = new URL('pay-with-transfer/incorrect-amount/decision', configToUse.paystackApiUrl).toString();
|
|
12176
|
-
return axiosInstance.post(url, params, {
|
|
12177
|
-
headers: headers
|
|
12178
|
-
}).then(function (response) {
|
|
12179
|
-
return ChargeResponses.parse(response.data);
|
|
12180
|
-
});
|
|
12181
|
-
},
|
|
12182
|
-
authenticatePayer: function authenticatePayer(params, publicKey) {
|
|
12183
|
-
var language = getLanguage();
|
|
12184
|
-
var headers = _objectSpread2({
|
|
12185
|
-
Authorization: "Bearer ".concat(publicKey)
|
|
12186
|
-
}, language && {
|
|
12187
|
-
'Accept-Language': language
|
|
12188
|
-
});
|
|
12189
|
-
var url = new URL('pay-with-transfer/authenticate-payer', configToUse.paystackApiUrl).toString();
|
|
12190
|
-
return axiosInstance.post(url, params, {
|
|
12191
|
-
headers: headers
|
|
12192
|
-
}).then(function (response) {
|
|
12193
|
-
return ChargeResponses.parse(response.data);
|
|
12194
|
-
});
|
|
12195
12129
|
}
|
|
12196
12130
|
};
|
|
12197
12131
|
|
|
@@ -12220,25 +12154,6 @@ var PayWithTransferCharge = {
|
|
|
12220
12154
|
paymentMethod: 'bank_transfer'
|
|
12221
12155
|
};
|
|
12222
12156
|
return this.listenForCharge(listenerOptions, callback);
|
|
12223
|
-
},
|
|
12224
|
-
sendIncorrectAmountDecision: function sendIncorrectAmountDecision(decisionMade) {
|
|
12225
|
-
var params = {
|
|
12226
|
-
transaction_id: this.id,
|
|
12227
|
-
decision: decisionMade
|
|
12228
|
-
};
|
|
12229
|
-
return PayWithTransferAPI.incorrectAmountDecision(params, this.merchant.key);
|
|
12230
|
-
},
|
|
12231
|
-
sendAuthenticatePayer: function sendAuthenticatePayer(_ref2) {
|
|
12232
|
-
var amountPaid = _ref2.amountPaid,
|
|
12233
|
-
payerAccountNumber = _ref2.payerAccountNumber,
|
|
12234
|
-
payerBankSlug = _ref2.payerBankSlug;
|
|
12235
|
-
var params = {
|
|
12236
|
-
transaction_id: this.id,
|
|
12237
|
-
amount: amountPaid,
|
|
12238
|
-
payer_account_number: payerAccountNumber,
|
|
12239
|
-
payer_bank_slug: payerBankSlug
|
|
12240
|
-
};
|
|
12241
|
-
return PayWithTransferAPI.authenticatePayer(params, this.merchant.key);
|
|
12242
12157
|
}
|
|
12243
12158
|
};
|
|
12244
12159
|
|
|
@@ -21231,10 +21146,6 @@ var AnalyticsFunctions$1 = _objectSpread2(_objectSpread2({}, CapitecPayAnalytics
|
|
|
21231
21146
|
},
|
|
21232
21147
|
saveReferrer: function saveReferrer(referrer) {
|
|
21233
21148
|
return AnalyticsAPI.saveReferrer(this.id, this.merchant.key, referrer);
|
|
21234
|
-
},
|
|
21235
|
-
setAmountByChannel: function setAmountByChannel(channelName) {
|
|
21236
|
-
var _this$channelFeesConf;
|
|
21237
|
-
this.amount = ((_this$channelFeesConf = this.channelFeesConfig[channelName]) === null || _this$channelFeesConf === void 0 ? void 0 : _this$channelFeesConf.amount) || this.originalAmount;
|
|
21238
21149
|
}
|
|
21239
21150
|
});
|
|
21240
21151
|
|
|
@@ -21378,7 +21289,7 @@ var linkAPI = {
|
|
|
21378
21289
|
}, _callee4);
|
|
21379
21290
|
}))();
|
|
21380
21291
|
},
|
|
21381
|
-
|
|
21292
|
+
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21382
21293
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
21383
21294
|
var url, language, headers, payload, response;
|
|
21384
21295
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -21545,28 +21456,12 @@ var linkChargeFunctions = {
|
|
|
21545
21456
|
});
|
|
21546
21457
|
},
|
|
21547
21458
|
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21548
|
-
return
|
|
21549
|
-
},
|
|
21550
|
-
getDirectDebitManagedAccount: function getDirectDebitManagedAccount(params) {
|
|
21551
|
-
return linkAPI.generateDirectDebitManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21459
|
+
return linkAPI.generateLinkManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21552
21460
|
device: this.deviceFingerprint,
|
|
21553
21461
|
transactionId: this.id
|
|
21554
21462
|
}));
|
|
21555
21463
|
},
|
|
21556
|
-
getManagedAccount: function getManagedAccount(_ref5) {
|
|
21557
|
-
var fulfilLateNotification = _ref5.fulfilLateNotification,
|
|
21558
|
-
preferredProvider = _ref5.preferredProvider;
|
|
21559
|
-
var params = {
|
|
21560
|
-
transaction_id: this.id,
|
|
21561
|
-
fulfil_late_notification: fulfilLateNotification,
|
|
21562
|
-
preferred_provider: preferredProvider
|
|
21563
|
-
};
|
|
21564
|
-
return PayWithTransferAPI.generateManagedAccount(params, this.merchant.key);
|
|
21565
|
-
},
|
|
21566
21464
|
listenForLinkBankPayWithTransferCharge: function listenForLinkBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21567
|
-
return this.listenForBankPayWithTransferCharge(pusherChannel, callback);
|
|
21568
|
-
},
|
|
21569
|
-
listenForBankPayWithTransferCharge: function listenForBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21570
21465
|
var listenerOptions = {
|
|
21571
21466
|
channel: pusherChannel,
|
|
21572
21467
|
paymentMethod: 'bank_transfer'
|
|
@@ -21600,7 +21495,6 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21600
21495
|
this.status = data.transaction_status || data.status;
|
|
21601
21496
|
this.accessCode = data.access_code;
|
|
21602
21497
|
this.amount = data.amount;
|
|
21603
|
-
this.originalAmount = data.amount;
|
|
21604
21498
|
this.domain = data.domain;
|
|
21605
21499
|
this.isTest = data.domain === 'test';
|
|
21606
21500
|
this.currency = data.currency;
|
|
@@ -21644,15 +21538,6 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21644
21538
|
this.reference = data.reference;
|
|
21645
21539
|
this.linkConfig = data.link_config || {};
|
|
21646
21540
|
|
|
21647
|
-
/**
|
|
21648
|
-
* We initialize parameters we send to the API as empty strings
|
|
21649
|
-
* when we don't have them instead of null because the API expects
|
|
21650
|
-
* these parameters as URL params which means parameters are eventually converted to strings
|
|
21651
|
-
*/
|
|
21652
|
-
|
|
21653
|
-
// Load pusher
|
|
21654
|
-
loadPusher();
|
|
21655
|
-
|
|
21656
21541
|
// Analytics
|
|
21657
21542
|
this.log = null;
|
|
21658
21543
|
Object.assign(this, AnalyticsFunctions$1);
|
|
@@ -21715,13 +21600,6 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21715
21600
|
return response && response.data;
|
|
21716
21601
|
});
|
|
21717
21602
|
}
|
|
21718
|
-
}, {
|
|
21719
|
-
key: "initializeCustomerSubscriptionAuthorization",
|
|
21720
|
-
value: function initializeCustomerSubscriptionAuthorization(payload) {
|
|
21721
|
-
return TransactionAPI.initializeCustomerSubscriptionAuthorization(payload, this.merchant.key).then(function (response) {
|
|
21722
|
-
return response && response.data;
|
|
21723
|
-
});
|
|
21724
|
-
}
|
|
21725
21603
|
}]);
|
|
21726
21604
|
return TransactionInstance;
|
|
21727
21605
|
}();
|
|
@@ -21785,7 +21663,7 @@ var Transaction = {
|
|
|
21785
21663
|
}
|
|
21786
21664
|
throw new Error('This function should be used with transaction data from the API');
|
|
21787
21665
|
case 5:
|
|
21788
|
-
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {
|
|
21666
|
+
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {}, {
|
|
21789
21667
|
deviceFingerprint: deviceFingerprint
|
|
21790
21668
|
}))));
|
|
21791
21669
|
case 6:
|
|
@@ -21943,19 +21821,6 @@ var ToolkitAPI = {
|
|
|
21943
21821
|
resolvedCardBins[bin] = data;
|
|
21944
21822
|
return data;
|
|
21945
21823
|
});
|
|
21946
|
-
},
|
|
21947
|
-
resolveIPAddress: function resolveIPAddress(ipAddress) {
|
|
21948
|
-
var url = new URL("decision/resolve_ip/".concat(ipAddress), configToUse.paystackApiUrl).toString();
|
|
21949
|
-
var language = getLanguage();
|
|
21950
|
-
var headers = _objectSpread2({}, language && {
|
|
21951
|
-
'Accept-Language': language
|
|
21952
|
-
});
|
|
21953
|
-
return axiosInstance.get(url, {
|
|
21954
|
-
headers: headers
|
|
21955
|
-
}).then(function (_ref2) {
|
|
21956
|
-
var data = _ref2.data;
|
|
21957
|
-
return data;
|
|
21958
|
-
});
|
|
21959
21824
|
}
|
|
21960
21825
|
};
|
|
21961
21826
|
|
|
@@ -22013,11 +21878,6 @@ var Toolkit = /*#__PURE__*/function () {
|
|
|
22013
21878
|
value: function resolveCardBin(bin) {
|
|
22014
21879
|
return ToolkitAPI.resolveCardBin(bin);
|
|
22015
21880
|
}
|
|
22016
|
-
}, {
|
|
22017
|
-
key: "resolveIPAddress",
|
|
22018
|
-
value: function resolveIPAddress(ipAddress) {
|
|
22019
|
-
return ToolkitAPI.resolveIPAddress(ipAddress);
|
|
22020
|
-
}
|
|
22021
21881
|
}]);
|
|
22022
21882
|
return Toolkit;
|
|
22023
21883
|
}();
|
|
@@ -22305,7 +22165,6 @@ var AnalyticsFunctions = {
|
|
|
22305
22165
|
return this.saveLog();
|
|
22306
22166
|
},
|
|
22307
22167
|
logAPIResponse: function logAPIResponse(response, channel) {
|
|
22308
|
-
console.log('api response', response);
|
|
22309
22168
|
switch (response.status) {
|
|
22310
22169
|
case 'authorized':
|
|
22311
22170
|
return this.logAuthorized(channel);
|
|
@@ -22413,7 +22272,6 @@ var PreauthorizationInstance = /*#__PURE__*/function () {
|
|
|
22413
22272
|
key: data.merchant_key
|
|
22414
22273
|
};
|
|
22415
22274
|
this.card = {};
|
|
22416
|
-
loadPusher();
|
|
22417
22275
|
this.log = null;
|
|
22418
22276
|
Object.assign(this, AnalyticsFunctions);
|
|
22419
22277
|
this.initializeLog(data.log);
|
|
@@ -22479,4 +22337,3 @@ var Preauthorization = {
|
|
|
22479
22337
|
};
|
|
22480
22338
|
|
|
22481
22339
|
export { BankAccount, Card$1 as Card, Preauthorization, Toolkit, Transaction };
|
|
22482
|
-
//# sourceMappingURL=checkout.js.map
|