quickpos 1.0.9 → 1.0.901

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.
Files changed (2) hide show
  1. package/lib/papara.js +10 -10
  2. package/package.json +1 -1
package/lib/papara.js CHANGED
@@ -21,9 +21,9 @@ class PaparaClient {
21
21
  return response;
22
22
  }, error => {
23
23
  if (error.response) {
24
- throw new Error(`Papara API error: ${error.response}`);
24
+ throw new Error(`Papara API error: ${error.response.data.message}`);
25
25
  }
26
- throw new Error(`Papara API error: ${error}`);
26
+ throw new Error(`Papara API error: ${error.message}`);
27
27
  });
28
28
  }
29
29
 
@@ -92,11 +92,11 @@ class PaparaClient {
92
92
 
93
93
  return {
94
94
  status: 'success',
95
- orderId: verification.data.referenceId,
96
- uuid: verification.data.id,
97
- amount: parseFloat(verification.data.amount),
98
- currency: verification.data.currency,
99
- paymentMethod: verification.data.paymentMethod
95
+ orderId: verification.data.ReferenceId,
96
+ uuid: verification.data.Id,
97
+ amount: parseFloat(verification.data.Amount),
98
+ currency: verification.data.Currency,
99
+ paymentMethod: verification.data.PaymentMethod
100
100
  };
101
101
  } catch (error) {
102
102
  throw new Error(`Error in Papara callback handling: ${error.message}`);
@@ -105,17 +105,17 @@ class PaparaClient {
105
105
 
106
106
  async verifyPaymentCallback(data) {
107
107
  try {
108
- if (data.status !== 1) {
108
+ if (data.Status !== 1) {
109
109
  return {
110
110
  status: false,
111
111
  error: {
112
112
  code: data?.errorCode,
113
- message: data?.errorMessage || 'Payment failed'
113
+ message: data?.ErrorMessage || 'Payment failed'
114
114
  }
115
115
  };
116
116
  }
117
117
 
118
- if (data.merchantSecretKey !== this.merchantSecretKey) {
118
+ if (data.MerchantSecretKey !== this.merchantSecretKey) {
119
119
  return {
120
120
  status: false,
121
121
  error: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quickpos",
3
- "version": "1.0.9",
3
+ "version": "1.0.901",
4
4
  "main": "app.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"