@longvansoftware/storefront-js-client 1.2.9 → 1.3.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.
@@ -1 +1,2 @@
1
1
  export declare const GET_PAYMENT_METHOD: import("graphql").DocumentNode;
2
+ export declare const GEN_QR_PAYMENT: import("graphql").DocumentNode;
@@ -1,12 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_PAYMENT_METHOD = void 0;
3
+ exports.GEN_QR_PAYMENT = exports.GET_PAYMENT_METHOD = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_PAYMENT_METHOD = (0, graphql_tag_1.gql) `
6
6
  query GetPaymentMethod($orgId: String!, $storeChannelId: String) {
7
7
  getPaymentMethod(orgId: $orgId, storeChannelId: $storeChannelId) {
8
+ id
8
9
  code
9
10
  name
10
11
  }
11
12
  }
12
13
  `;
14
+ exports.GEN_QR_PAYMENT = (0, graphql_tag_1.gql) `
15
+ query GenQRPayment($orgId: String!, $orderId: String!, $storeId: String!, $totalAmount: BigDecimal){
16
+ genQRPayment(
17
+ orgId: $orgId
18
+ orderId: $orderId
19
+ storeId: $storeId
20
+ totalAmount: $totalAmount
21
+ )
22
+ }
23
+ `;
@@ -3,4 +3,5 @@ export declare class PaymentService extends Service {
3
3
  constructor(endpoint: string, orgId: string, storeId: string);
4
4
  getPaymentMethod(): Promise<any>;
5
5
  createPaymentOrder(paymentOrderData: any): Promise<any>;
6
+ genQRPayment(orderId: any, totalAmount: any): Promise<any>;
6
7
  }
@@ -46,5 +46,24 @@ class PaymentService extends service_1.Service {
46
46
  }
47
47
  });
48
48
  }
49
+ genQRPayment(orderId, totalAmount) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ const query = queries_1.GEN_QR_PAYMENT;
52
+ const variables = {
53
+ orgId: this.orgId,
54
+ orderId,
55
+ storeId: this.storeId,
56
+ totalAmount,
57
+ };
58
+ try {
59
+ const response = yield this.graphqlQuery(query, variables);
60
+ return response.genQRPayment;
61
+ }
62
+ catch (error) {
63
+ console.log(`Error fetching get genQRPayment method: ${error}`);
64
+ throw error;
65
+ }
66
+ });
67
+ }
49
68
  }
50
69
  exports.PaymentService = PaymentService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "1.2.9",
3
+ "version": "1.3.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [