@longvansoftware/service-js-client 1.18.4 → 1.18.6

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.
@@ -5,10 +5,16 @@ const graphql_tag_1 = require("graphql-tag");
5
5
  exports.CANCEL_PAYMENT = (0, graphql_tag_1.gql) `
6
6
  mutation CancelPayment(
7
7
  $paymentId: String!
8
+ $safeMode: Boolean!
8
9
  $reason: String!
9
10
  $createBy: String
10
11
  ) {
11
- cancelPayment(paymentId: $paymentId, reason: $reason, createBy: $createBy)
12
+ cancelPayment(
13
+ paymentId: $paymentId
14
+ safeMode: $safeMode
15
+ reason: $reason
16
+ createBy: $createBy
17
+ )
12
18
  }
13
19
  `;
14
20
  exports.CONFIRM_PAID_MANUAL = (0, graphql_tag_1.gql) `
@@ -2,3 +2,4 @@ export declare const PAYMENTS_BY_ORDERS: import("graphql").DocumentNode;
2
2
  export declare const GET_TRANSFER_INFO: import("graphql").DocumentNode;
3
3
  export declare const GET_PAYMENT_METHOD_TYPES: import("graphql").DocumentNode;
4
4
  export declare const PAYMENT_METHODS: import("graphql").DocumentNode;
5
+ export declare const PAYMENT_STATUS: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PAYMENT_METHODS = exports.GET_PAYMENT_METHOD_TYPES = exports.GET_TRANSFER_INFO = exports.PAYMENTS_BY_ORDERS = void 0;
3
+ exports.PAYMENT_STATUS = exports.PAYMENT_METHODS = exports.GET_PAYMENT_METHOD_TYPES = exports.GET_TRANSFER_INFO = exports.PAYMENTS_BY_ORDERS = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.PAYMENTS_BY_ORDERS = (0, graphql_tag_1.gql) `
6
6
  query PaymentsByOrders($orderIds: [String!]!) {
@@ -88,3 +88,48 @@ exports.PAYMENT_METHODS = (0, graphql_tag_1.gql) `
88
88
  }
89
89
  }
90
90
  `;
91
+ exports.PAYMENT_STATUS = (0, graphql_tag_1.gql) `
92
+ query PaymentStatus($paymentId: String!) {
93
+ paymentStatus(paymentId: $paymentId) {
94
+ methodCode
95
+ methodTypeCode
96
+ gatewayConfigId
97
+ partnerCode
98
+ totalAmount
99
+ fee
100
+ discountAmount
101
+ payDate
102
+ payType
103
+ transactionDate
104
+ orderId
105
+ paymentId
106
+ invoiceId
107
+ orderInfo
108
+ orderType
109
+ locale
110
+ merchantIp
111
+ extraData
112
+ storeID
113
+ bankCode
114
+ appUser
115
+ phone
116
+ email
117
+ address
118
+ statusCode
119
+ statusDescription
120
+ transactionId
121
+ createBy
122
+ methodDescription
123
+ methodMapping
124
+ baseMethodCode
125
+ confirmPaidBy
126
+ confirmPaidDate
127
+ qrCode
128
+ payUrl
129
+ customerId
130
+ attributes
131
+ paymentNote
132
+ payExpireDate
133
+ }
134
+ }
135
+ `;
@@ -9,4 +9,5 @@ export declare class PaymentLVService extends Service {
9
9
  confirmPaidManual(paymentId: string, confirmBy: string): Promise<any>;
10
10
  getPaymentMethodTypes(store: string): Promise<any>;
11
11
  paymentMethods(): Promise<any>;
12
+ paymentStatus(paymentId: string): Promise<any>;
12
13
  }
@@ -65,6 +65,7 @@ class PaymentLVService extends serviceSDK_1.Service {
65
65
  const mutation = mutations_1.CANCEL_PAYMENT;
66
66
  const variables = {
67
67
  paymentId,
68
+ safeMode: true,
68
69
  reason,
69
70
  createBy,
70
71
  };
@@ -128,5 +129,21 @@ class PaymentLVService extends serviceSDK_1.Service {
128
129
  }
129
130
  });
130
131
  }
132
+ paymentStatus(paymentId) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ const query = queries_1.PAYMENT_STATUS;
135
+ const variables = {
136
+ paymentId,
137
+ };
138
+ try {
139
+ const response = yield this.graphqlQueryCustomHeader(query, variables);
140
+ return response.paymentStatus;
141
+ }
142
+ catch (error) {
143
+ console.log(`Error fetching get paymentStatus method: ${error}`);
144
+ throw error;
145
+ }
146
+ });
147
+ }
131
148
  }
132
149
  exports.PaymentLVService = PaymentLVService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.18.4",
3
+ "version": "1.18.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [