@longvansoftware/storefront-js-client 3.3.2 → 3.3.4
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/src/graphql/paymentV2/queries.d.ts +1 -0
- package/dist/src/graphql/paymentV2/queries.js +23 -1
- package/dist/src/lib/order/index.d.ts +2 -0
- package/dist/src/lib/order/index.js +27 -1
- package/dist/src/lib/paymentV2/index.d.ts +1 -0
- package/dist/src/lib/paymentV2/index.js +18 -0
- package/package.json +1 -1
|
@@ -6,3 +6,4 @@ 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
8
|
export declare const GET_PAYEMNT_GATEWAYS_BY_METHOD_CODE: import("graphql").DocumentNode;
|
|
9
|
+
export declare const GET_PAYMENT_METHOD_TYPES_V2: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
3
|
+
exports.GET_PAYMENT_METHOD_TYPES_V2 = 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!]!) {
|
|
@@ -208,10 +208,12 @@ exports.GET_PAYEMNT_GATEWAYS_BY_METHOD_CODE = (0, graphql_tag_1.gql) `
|
|
|
208
208
|
query GetPaymentGatewaysByMethodCode(
|
|
209
209
|
$partnerId: String!
|
|
210
210
|
$methodCode: String!
|
|
211
|
+
$storeId: String
|
|
211
212
|
) {
|
|
212
213
|
getPaymentGatewaysByMethodCode(
|
|
213
214
|
partnerId: $partnerId
|
|
214
215
|
methodCode: $methodCode
|
|
216
|
+
storeId: $storeId
|
|
215
217
|
) {
|
|
216
218
|
id
|
|
217
219
|
name
|
|
@@ -228,6 +230,26 @@ exports.GET_PAYEMNT_GATEWAYS_BY_METHOD_CODE = (0, graphql_tag_1.gql) `
|
|
|
228
230
|
requestUrl
|
|
229
231
|
description
|
|
230
232
|
activated
|
|
233
|
+
storeActive
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
`;
|
|
237
|
+
exports.GET_PAYMENT_METHOD_TYPES_V2 = (0, graphql_tag_1.gql) `
|
|
238
|
+
query GetPaymentMethodTypes(
|
|
239
|
+
$partnerId: String!
|
|
240
|
+
$storeId: String!
|
|
241
|
+
$storeActive: StoreActive
|
|
242
|
+
) {
|
|
243
|
+
getPaymentMethodTypes(
|
|
244
|
+
partnerId: $partnerId
|
|
245
|
+
storeId: $storeId
|
|
246
|
+
storeActive: $storeActive
|
|
247
|
+
) {
|
|
248
|
+
code
|
|
249
|
+
name
|
|
250
|
+
description
|
|
251
|
+
image
|
|
252
|
+
storeActive
|
|
231
253
|
}
|
|
232
254
|
}
|
|
233
255
|
`;
|
|
@@ -530,4 +530,6 @@ export declare class OrderService extends Service {
|
|
|
530
530
|
updateCustomerInfoFront(orderId: string, customerInfo: CustomerInfo): Promise<any>;
|
|
531
531
|
removeGiftQuantity(orderId: string, orderItemId: string): Promise<any>;
|
|
532
532
|
removeGiftInOrder(orderId: string, orderItemId: string): Promise<any>;
|
|
533
|
+
tooglePaymentMethod(methodCode: string, status: boolean): Promise<any>;
|
|
534
|
+
choosePaymentGatewayForPaymentMethod(methodCode: string, gatewayId: string): Promise<any>;
|
|
533
535
|
}
|
|
@@ -1607,7 +1607,33 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
1607
1607
|
removeGiftInOrder(orderId, orderItemId) {
|
|
1608
1608
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1609
1609
|
const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/${orderItemId}/deleteOrderLineItem`;
|
|
1610
|
-
const method =
|
|
1610
|
+
const method = "DELETE";
|
|
1611
|
+
try {
|
|
1612
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1613
|
+
return response;
|
|
1614
|
+
}
|
|
1615
|
+
catch (error) {
|
|
1616
|
+
throw error;
|
|
1617
|
+
}
|
|
1618
|
+
});
|
|
1619
|
+
}
|
|
1620
|
+
tooglePaymentMethod(methodCode, status) {
|
|
1621
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1622
|
+
const endpoint = `/store-channels/${this.orgId}/${this.storeId}/payment-methods/${methodCode}/enable/${status}`;
|
|
1623
|
+
const method = "PUT";
|
|
1624
|
+
try {
|
|
1625
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1626
|
+
return response;
|
|
1627
|
+
}
|
|
1628
|
+
catch (error) {
|
|
1629
|
+
throw error;
|
|
1630
|
+
}
|
|
1631
|
+
});
|
|
1632
|
+
}
|
|
1633
|
+
choosePaymentGatewayForPaymentMethod(methodCode, gatewayId) {
|
|
1634
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1635
|
+
const endpoint = `/store-channels/${this.orgId}/${this.storeId}/payment-methods/${methodCode}/payment-gateways/${gatewayId}`;
|
|
1636
|
+
const method = "PUT";
|
|
1611
1637
|
try {
|
|
1612
1638
|
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1613
1639
|
return response;
|
|
@@ -14,4 +14,5 @@ export declare class PaymentServiceV2 extends Service {
|
|
|
14
14
|
handleCreateGatewayConfig(input: any, cassoApiKey: string): Promise<any>;
|
|
15
15
|
handleUpdateGatewayConfig(input: any, cassoApiKey: string): Promise<any>;
|
|
16
16
|
getPaymentGatewaysByMethodCode(methodCode: string): Promise<any>;
|
|
17
|
+
getPaymentMethodTypesV2(storeActive: any): Promise<any>;
|
|
17
18
|
}
|
|
@@ -214,6 +214,7 @@ class PaymentServiceV2 extends serviceSDK_1.Service {
|
|
|
214
214
|
const variables = {
|
|
215
215
|
partnerId: this.orgId,
|
|
216
216
|
methodCode,
|
|
217
|
+
storeId: this.storeId
|
|
217
218
|
};
|
|
218
219
|
try {
|
|
219
220
|
const response = yield this.graphqlQueryV3(query, variables);
|
|
@@ -224,5 +225,22 @@ class PaymentServiceV2 extends serviceSDK_1.Service {
|
|
|
224
225
|
}
|
|
225
226
|
});
|
|
226
227
|
}
|
|
228
|
+
getPaymentMethodTypesV2(storeActive) {
|
|
229
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
+
const queries = queries_1.GET_PAYMENT_METHOD_TYPES_V2;
|
|
231
|
+
const variables = {
|
|
232
|
+
partnerId: this.orgId,
|
|
233
|
+
storeId: this.storeId,
|
|
234
|
+
storeActive: storeActive
|
|
235
|
+
};
|
|
236
|
+
try {
|
|
237
|
+
const response = yield this.graphqlQueryV3(queries, variables);
|
|
238
|
+
return response.getPaymentMethodTypes;
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
227
245
|
}
|
|
228
246
|
exports.PaymentServiceV2 = PaymentServiceV2;
|