@paystack/checkout-js 1.45.1-dev.1 → 1.46.0-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 +115 -6
- package/dist/checkout.js.map +1 -0
- package/es/checkout.js +115 -6
- package/es/checkout.js.map +1 -0
- package/lib/checkout.js +115 -6
- package/lib/checkout.js.map +1 -0
- package/package.json +1 -1
package/es/checkout.js
CHANGED
|
@@ -6336,19 +6336,22 @@ 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'
|
|
6339
|
+
pusherKey: '1c7b262ee18455815893',
|
|
6340
|
+
pusherUrl: 'https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js'
|
|
6340
6341
|
});
|
|
6341
6342
|
var stagingConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
6342
6343
|
checkoutUrl: 'https://checkout-studio.paystack.com/',
|
|
6343
6344
|
paymentBaseUrl: 'https://legacy-staging.paystack.co/',
|
|
6344
6345
|
paystackApiUrl: 'https://studio-api.paystack.co/',
|
|
6345
|
-
pusherKey: '1c7b262ee18455815893'
|
|
6346
|
+
pusherKey: '1c7b262ee18455815893',
|
|
6347
|
+
pusherUrl: 'https://s3-eu-west-1.amazonaws.com/pstk-public-files/js/pusher.min.js'
|
|
6346
6348
|
});
|
|
6347
6349
|
var productionConfig = _objectSpread2(_objectSpread2({}, config), {}, {
|
|
6348
6350
|
checkoutUrl: 'https://checkout.paystack.com/',
|
|
6349
6351
|
paymentBaseUrl: 'https://standard.paystack.co/',
|
|
6350
6352
|
paystackApiUrl: 'https://api.paystack.co/',
|
|
6351
|
-
pusherKey: '8e4b9b7ca3418bd5cdc8'
|
|
6353
|
+
pusherKey: '8e4b9b7ca3418bd5cdc8',
|
|
6354
|
+
pusherUrl: 'https://checkout.paystack.com/static/vendor/pusher.min.js'
|
|
6352
6355
|
});
|
|
6353
6356
|
var configToEnvironmentMapping = {
|
|
6354
6357
|
dev: devConfig,
|
|
@@ -12109,6 +12112,17 @@ var TransactionAPI = {
|
|
|
12109
12112
|
}).then(function (response) {
|
|
12110
12113
|
return response.data;
|
|
12111
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
|
+
});
|
|
12112
12126
|
}
|
|
12113
12127
|
};
|
|
12114
12128
|
|
|
@@ -12126,6 +12140,34 @@ var PayWithTransferAPI = {
|
|
|
12126
12140
|
}).then(function (response) {
|
|
12127
12141
|
return ChargeResponses.parse(response.data);
|
|
12128
12142
|
});
|
|
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
|
+
});
|
|
12129
12171
|
}
|
|
12130
12172
|
};
|
|
12131
12173
|
|
|
@@ -12154,6 +12196,25 @@ var PayWithTransferCharge = {
|
|
|
12154
12196
|
paymentMethod: 'bank_transfer'
|
|
12155
12197
|
};
|
|
12156
12198
|
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);
|
|
12157
12218
|
}
|
|
12158
12219
|
};
|
|
12159
12220
|
|
|
@@ -21146,6 +21207,10 @@ var AnalyticsFunctions$1 = _objectSpread2(_objectSpread2({}, CapitecPayAnalytics
|
|
|
21146
21207
|
},
|
|
21147
21208
|
saveReferrer: function saveReferrer(referrer) {
|
|
21148
21209
|
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;
|
|
21149
21214
|
}
|
|
21150
21215
|
});
|
|
21151
21216
|
|
|
@@ -21289,7 +21354,7 @@ var linkAPI = {
|
|
|
21289
21354
|
}, _callee4);
|
|
21290
21355
|
}))();
|
|
21291
21356
|
},
|
|
21292
|
-
|
|
21357
|
+
generateDirectDebitManagedAccount: function generateDirectDebitManagedAccount(params) {
|
|
21293
21358
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
21294
21359
|
var url, language, headers, payload, response;
|
|
21295
21360
|
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -21456,12 +21521,28 @@ var linkChargeFunctions = {
|
|
|
21456
21521
|
});
|
|
21457
21522
|
},
|
|
21458
21523
|
generateLinkManagedAccount: function generateLinkManagedAccount(params) {
|
|
21459
|
-
return
|
|
21524
|
+
return this.getDirectDebitManagedAccount(params);
|
|
21525
|
+
},
|
|
21526
|
+
getDirectDebitManagedAccount: function getDirectDebitManagedAccount(params) {
|
|
21527
|
+
return linkAPI.generateDirectDebitManagedAccount(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
21460
21528
|
device: this.deviceFingerprint,
|
|
21461
21529
|
transactionId: this.id
|
|
21462
21530
|
}));
|
|
21463
21531
|
},
|
|
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
|
+
},
|
|
21464
21542
|
listenForLinkBankPayWithTransferCharge: function listenForLinkBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21543
|
+
return this.listenForBankPayWithTransferCharge(pusherChannel, callback);
|
|
21544
|
+
},
|
|
21545
|
+
listenForBankPayWithTransferCharge: function listenForBankPayWithTransferCharge(pusherChannel, callback) {
|
|
21465
21546
|
var listenerOptions = {
|
|
21466
21547
|
channel: pusherChannel,
|
|
21467
21548
|
paymentMethod: 'bank_transfer'
|
|
@@ -21495,6 +21576,7 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21495
21576
|
this.status = data.transaction_status || data.status;
|
|
21496
21577
|
this.accessCode = data.access_code;
|
|
21497
21578
|
this.amount = data.amount;
|
|
21579
|
+
this.originalAmount = data.amount;
|
|
21498
21580
|
this.domain = data.domain;
|
|
21499
21581
|
this.isTest = data.domain === 'test';
|
|
21500
21582
|
this.currency = data.currency;
|
|
@@ -21600,6 +21682,13 @@ var TransactionInstance = /*#__PURE__*/function () {
|
|
|
21600
21682
|
return response && response.data;
|
|
21601
21683
|
});
|
|
21602
21684
|
}
|
|
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
|
+
}
|
|
21603
21692
|
}]);
|
|
21604
21693
|
return TransactionInstance;
|
|
21605
21694
|
}();
|
|
@@ -21663,7 +21752,7 @@ var Transaction = {
|
|
|
21663
21752
|
}
|
|
21664
21753
|
throw new Error('This function should be used with transaction data from the API');
|
|
21665
21754
|
case 5:
|
|
21666
|
-
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {
|
|
21755
|
+
return _context2.abrupt("return", Object.seal(new TransactionInstance(_objectSpread2(_objectSpread2({}, transactionData), {
|
|
21667
21756
|
deviceFingerprint: deviceFingerprint
|
|
21668
21757
|
}))));
|
|
21669
21758
|
case 6:
|
|
@@ -21821,6 +21910,19 @@ var ToolkitAPI = {
|
|
|
21821
21910
|
resolvedCardBins[bin] = data;
|
|
21822
21911
|
return data;
|
|
21823
21912
|
});
|
|
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
|
+
});
|
|
21824
21926
|
}
|
|
21825
21927
|
};
|
|
21826
21928
|
|
|
@@ -21878,6 +21980,11 @@ var Toolkit = /*#__PURE__*/function () {
|
|
|
21878
21980
|
value: function resolveCardBin(bin) {
|
|
21879
21981
|
return ToolkitAPI.resolveCardBin(bin);
|
|
21880
21982
|
}
|
|
21983
|
+
}, {
|
|
21984
|
+
key: "resolveIPAddress",
|
|
21985
|
+
value: function resolveIPAddress(ipAddress) {
|
|
21986
|
+
return ToolkitAPI.resolveIPAddress(ipAddress);
|
|
21987
|
+
}
|
|
21881
21988
|
}]);
|
|
21882
21989
|
return Toolkit;
|
|
21883
21990
|
}();
|
|
@@ -22165,6 +22272,7 @@ var AnalyticsFunctions = {
|
|
|
22165
22272
|
return this.saveLog();
|
|
22166
22273
|
},
|
|
22167
22274
|
logAPIResponse: function logAPIResponse(response, channel) {
|
|
22275
|
+
console.log('api response', response);
|
|
22168
22276
|
switch (response.status) {
|
|
22169
22277
|
case 'authorized':
|
|
22170
22278
|
return this.logAuthorized(channel);
|
|
@@ -22337,3 +22445,4 @@ var Preauthorization = {
|
|
|
22337
22445
|
};
|
|
22338
22446
|
|
|
22339
22447
|
export { BankAccount, Card$1 as Card, Preauthorization, Toolkit, Transaction };
|
|
22448
|
+
//# sourceMappingURL=checkout.js.map
|