@longvansoftware/storefront-js-client 3.2.9 → 3.3.0

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,3 +5,4 @@ export declare const PAYMENT_INFO: import("graphql").DocumentNode;
5
5
  export declare const PAYMENT_STATUS: import("graphql").DocumentNode;
6
6
  export declare const GW_CONFIG_DETAIL: import("graphql").DocumentNode;
7
7
  export declare const GET_PAYMENT_METHOD_TITLES: import("graphql").DocumentNode;
8
+ export declare const GET_PAYEMNT_GATEWAYS_BY_METHOD_CODE: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_PAYMENT_METHOD_TITLES = exports.GW_CONFIG_DETAIL = exports.PAYMENT_STATUS = exports.PAYMENT_INFO = exports.GET_PAYMENT_METHOD_TYPES = exports.PAYMENT_METHODS = exports.PAYMENTS_BY_ORDERS = void 0;
3
+ exports.GET_PAYEMNT_GATEWAYS_BY_METHOD_CODE = exports.GET_PAYMENT_METHOD_TITLES = exports.GW_CONFIG_DETAIL = exports.PAYMENT_STATUS = exports.PAYMENT_INFO = exports.GET_PAYMENT_METHOD_TYPES = exports.PAYMENT_METHODS = 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!]!) {
@@ -194,13 +194,40 @@ exports.GW_CONFIG_DETAIL = (0, graphql_tag_1.gql) `
194
194
  `;
195
195
  exports.GET_PAYMENT_METHOD_TITLES = (0, graphql_tag_1.gql) `
196
196
  query GetPaymentMethodTitles($methodCode: String!) {
197
- getPaymentMethodTitles(methodCode: $methodCode) {
198
- id
199
- code
200
- name
201
- lang
202
- showField
203
- required
204
- }
197
+ getPaymentMethodTitles(methodCode: $methodCode) {
198
+ id
199
+ code
200
+ name
201
+ lang
202
+ showField
203
+ required
204
+ }
205
+ }
206
+ `;
207
+ exports.GET_PAYEMNT_GATEWAYS_BY_METHOD_CODE = (0, graphql_tag_1.gql) `
208
+ query GetPaymentGatewaysByMethodCode(
209
+ $partnerId: String!
210
+ $methodCode: String!
211
+ ) {
212
+ getPaymentGatewaysByMethodCode(
213
+ partnerId: $partnerId
214
+ methodCode: $methodCode
215
+ ) {
216
+ id
217
+ name
218
+ methodCode
219
+ partnerCode
220
+ subMethodCode
221
+ gwPartnerCode
222
+ gwPartnerName
223
+ gwSubChannel
224
+ gwMethodVersion
225
+ hashAlgorithm
226
+ accessKey
227
+ secretKey
228
+ requestUrl
229
+ description
230
+ activated
231
+ }
205
232
  }
206
233
  `;
@@ -13,4 +13,5 @@ export declare class PaymentServiceV2 extends Service {
13
13
  getPaymentMethodTitles(methodCode: string): Promise<any>;
14
14
  handleCreateGatewayConfig(input: any, cassoApiKey: string): Promise<any>;
15
15
  handleUpdateGatewayConfig(input: any, cassoApiKey: string): Promise<any>;
16
+ getPaymentGatewaysByMethodCode(methodCode: string): Promise<any>;
16
17
  }
@@ -208,5 +208,21 @@ class PaymentServiceV2 extends serviceSDK_1.Service {
208
208
  }
209
209
  });
210
210
  }
211
+ getPaymentGatewaysByMethodCode(methodCode) {
212
+ return __awaiter(this, void 0, void 0, function* () {
213
+ const query = queries_1.GET_PAYEMNT_GATEWAYS_BY_METHOD_CODE;
214
+ const variables = {
215
+ partnerId: this.orgId,
216
+ methodCode,
217
+ };
218
+ try {
219
+ const response = yield this.graphqlQueryV3(query, variables);
220
+ return response.getPaymentGatewaysByMethodCode;
221
+ }
222
+ catch (error) {
223
+ throw error;
224
+ }
225
+ });
226
+ }
211
227
  }
212
228
  exports.PaymentServiceV2 = PaymentServiceV2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "3.2.9",
3
+ "version": "3.3.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [