@duvdu-v1/duvdu 1.1.350 → 1.1.351
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.
|
@@ -374,6 +374,7 @@ class PaymobPaymentProcessor {
|
|
|
374
374
|
*/
|
|
375
375
|
createPaymentIntention(amount_1, billingData_1, items_1) {
|
|
376
376
|
return __awaiter(this, arguments, void 0, function* (amount, billingData, items, currency = 'EGP', extras) {
|
|
377
|
+
var _a, _b, _c, _d, _e, _f;
|
|
377
378
|
try {
|
|
378
379
|
const intentionData = this.buildIntentionRequest(amount, billingData, items, currency, extras);
|
|
379
380
|
const headers = yield this.auth.getAuthHeaders();
|
|
@@ -383,7 +384,13 @@ class PaymobPaymentProcessor {
|
|
|
383
384
|
catch (error) {
|
|
384
385
|
const axiosError = error;
|
|
385
386
|
console.log('=======================');
|
|
386
|
-
console.log('
|
|
387
|
+
console.log('Paymob API Error Details:');
|
|
388
|
+
console.log('Status:', (_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.status);
|
|
389
|
+
console.log('Status Text:', (_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.statusText);
|
|
390
|
+
console.log('Response Data:', JSON.stringify((_c = axiosError.response) === null || _c === void 0 ? void 0 : _c.data, null, 2));
|
|
391
|
+
console.log('Request Data:', JSON.stringify((_d = axiosError.config) === null || _d === void 0 ? void 0 : _d.data, null, 2));
|
|
392
|
+
console.log('Request URL:', (_e = axiosError.config) === null || _e === void 0 ? void 0 : _e.url);
|
|
393
|
+
console.log('Request Method:', (_f = axiosError.config) === null || _f === void 0 ? void 0 : _f.method);
|
|
387
394
|
console.log('=======================');
|
|
388
395
|
throw new Error(`Failed to create Paymob payment intention: ${axiosError.message}`);
|
|
389
396
|
}
|
|
@@ -400,6 +407,7 @@ class PaymobPaymentProcessor {
|
|
|
400
407
|
*/
|
|
401
408
|
createPaymentUrlWithUserData(amount, userId, contractId, userData, serviceType) {
|
|
402
409
|
return __awaiter(this, void 0, void 0, function* () {
|
|
410
|
+
var _a, _b, _c, _d, _e, _f;
|
|
403
411
|
const customData = this.buildCustomMetadata(contractId, userId, serviceType);
|
|
404
412
|
const billingData = this.buildBillingDataFromUser(userData);
|
|
405
413
|
const items = this.buildOrderItems(userId, contractId, serviceType, amount);
|
|
@@ -416,7 +424,13 @@ class PaymobPaymentProcessor {
|
|
|
416
424
|
catch (error) {
|
|
417
425
|
const axiosError = error;
|
|
418
426
|
console.log('=======================');
|
|
419
|
-
console.log('
|
|
427
|
+
console.log('Paymob API Error Details:');
|
|
428
|
+
console.log('Status:', (_a = axiosError.response) === null || _a === void 0 ? void 0 : _a.status);
|
|
429
|
+
console.log('Status Text:', (_b = axiosError.response) === null || _b === void 0 ? void 0 : _b.statusText);
|
|
430
|
+
console.log('Response Data:', JSON.stringify((_c = axiosError.response) === null || _c === void 0 ? void 0 : _c.data, null, 2));
|
|
431
|
+
console.log('Request Data:', JSON.stringify((_d = axiosError.config) === null || _d === void 0 ? void 0 : _d.data, null, 2));
|
|
432
|
+
console.log('Request URL:', (_e = axiosError.config) === null || _e === void 0 ? void 0 : _e.url);
|
|
433
|
+
console.log('Request Method:', (_f = axiosError.config) === null || _f === void 0 ? void 0 : _f.method);
|
|
420
434
|
console.log('=======================');
|
|
421
435
|
throw new Error(`Failed to create Paymob payment intention: ${axiosError.message}`);
|
|
422
436
|
}
|