@litepos/payment 1.0.11 → 1.0.12
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/client.js +10 -10
- package/dist/interfaces.d.ts +3 -0
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -42,11 +42,11 @@ export class LitePosPayment {
|
|
|
42
42
|
throw new ValidationError(`Payment method not supported: ${request.method}`, request.method);
|
|
43
43
|
try {
|
|
44
44
|
const response = await handler(request);
|
|
45
|
-
logInfo(`${this.getGatewayName(request.method)}: Charge payment, Order ID ${request.orderId}, Transaction ID ${response.transactionId}, Status ${response.status}
|
|
45
|
+
logInfo(`${this.getGatewayName(request.method)}: Charge payment, Order ID ${request.orderId}, Transaction ID ${response.transactionId}, Status ${response.status}`, { request, response });
|
|
46
46
|
return response;
|
|
47
47
|
}
|
|
48
48
|
catch (error) {
|
|
49
|
-
logError(`${this.getGatewayName(request.method)}: Charge payment failed, Order ID ${request.orderId}`, error);
|
|
49
|
+
logError(`${this.getGatewayName(request.method)}: Charge payment failed, Order ID ${request.orderId}`, { request, error });
|
|
50
50
|
throw error;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -56,11 +56,11 @@ export class LitePosPayment {
|
|
|
56
56
|
throw new ValidationError(`Payment method not supported: ${method}`, method);
|
|
57
57
|
try {
|
|
58
58
|
const response = await handler(transactionId, config);
|
|
59
|
-
logInfo(`${this.getGatewayName(method)}: Query payment, Transaction ID ${transactionId}, Status ${response.status}
|
|
59
|
+
logInfo(`${this.getGatewayName(method)}: Query payment, Transaction ID ${transactionId}, Status ${response.status}`, { transactionId, response });
|
|
60
60
|
return response;
|
|
61
61
|
}
|
|
62
62
|
catch (error) {
|
|
63
|
-
logError(`${this.getGatewayName(method)}: Query payment failed, Transaction ID ${transactionId}`, error);
|
|
63
|
+
logError(`${this.getGatewayName(method)}: Query payment failed, Transaction ID ${transactionId}`, { transactionId, error });
|
|
64
64
|
throw error;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -70,11 +70,11 @@ export class LitePosPayment {
|
|
|
70
70
|
throw new ValidationError(`Payment method not supported: ${method}`, method);
|
|
71
71
|
try {
|
|
72
72
|
const response = await handler(transactionId, config);
|
|
73
|
-
logInfo(`${this.getGatewayName(method)}: Cancel payment, Transaction ID ${transactionId}, Status ${response.status}
|
|
73
|
+
logInfo(`${this.getGatewayName(method)}: Cancel payment, Transaction ID ${transactionId}, Status ${response.status}`, { transactionId, response });
|
|
74
74
|
return response;
|
|
75
75
|
}
|
|
76
76
|
catch (error) {
|
|
77
|
-
logError(`${this.getGatewayName(method)}: Cancel payment failed, Transaction ID ${transactionId}`, error);
|
|
77
|
+
logError(`${this.getGatewayName(method)}: Cancel payment failed, Transaction ID ${transactionId}`, { transactionId, error });
|
|
78
78
|
throw error;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -84,11 +84,11 @@ export class LitePosPayment {
|
|
|
84
84
|
throw new ValidationError(`Payment method not supported: ${method}`, method);
|
|
85
85
|
try {
|
|
86
86
|
const response = await handler(transactionId, config, amount);
|
|
87
|
-
logInfo(`${this.getGatewayName(method)}: Refund payment, Transaction ID ${transactionId}, Refund ID ${response.refundId}, Status ${response.status}
|
|
87
|
+
logInfo(`${this.getGatewayName(method)}: Refund payment, Transaction ID ${transactionId}, Refund ID ${response.refundId}, Status ${response.status}`, { transactionId, amount, response });
|
|
88
88
|
return response;
|
|
89
89
|
}
|
|
90
90
|
catch (error) {
|
|
91
|
-
logError(`${this.getGatewayName(method)}: Refund payment failed, Transaction ID ${transactionId}`, error);
|
|
91
|
+
logError(`${this.getGatewayName(method)}: Refund payment failed, Transaction ID ${transactionId}`, { transactionId, amount, error });
|
|
92
92
|
throw error;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -98,11 +98,11 @@ export class LitePosPayment {
|
|
|
98
98
|
throw new ValidationError(`Payment method not supported: ${method}`, method);
|
|
99
99
|
try {
|
|
100
100
|
const response = await handler(refundId, config);
|
|
101
|
-
logInfo(`${this.getGatewayName(method)}: Query refund, Refund ID ${refundId}, Status ${response.status}
|
|
101
|
+
logInfo(`${this.getGatewayName(method)}: Query refund, Refund ID ${refundId}, Status ${response.status}`, { refundId, response });
|
|
102
102
|
return response;
|
|
103
103
|
}
|
|
104
104
|
catch (error) {
|
|
105
|
-
logError(`${this.getGatewayName(method)}: Query refund failed, Refund ID ${refundId}`, error);
|
|
105
|
+
logError(`${this.getGatewayName(method)}: Query refund failed, Refund ID ${refundId}`, { refundId, error });
|
|
106
106
|
throw error;
|
|
107
107
|
}
|
|
108
108
|
}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -13,6 +13,9 @@ export interface PaymentResponse {
|
|
|
13
13
|
amount: number;
|
|
14
14
|
currency: string;
|
|
15
15
|
qrCodeData?: string;
|
|
16
|
+
payment_source_method?: string;
|
|
17
|
+
payment_source_last4?: string;
|
|
18
|
+
payment_source_charge_ref?: string;
|
|
16
19
|
metadata?: Record<string, unknown>;
|
|
17
20
|
raw?: unknown;
|
|
18
21
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litepos/payment",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.12",
|
|
5
5
|
"description": "LitePOS payment gateway SDK - Core package",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@litepos/payment-fiuu": "1.0.
|
|
28
|
+
"@litepos/payment-fiuu": "1.0.12"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.9.2",
|