@longvansoftware/storefront-js-client 3.2.8 → 3.2.9
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/mutations.d.ts +2 -0
- package/dist/src/graphql/paymentV2/mutations.js +67 -1
- package/dist/src/graphql/paymentV2/queries.d.ts +1 -0
- package/dist/src/graphql/paymentV2/queries.js +21 -1
- package/dist/src/lib/paymentV2/index.d.ts +3 -0
- package/dist/src/lib/paymentV2/index.js +49 -0
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare const CANCEL_PAYMENT: import("graphql").DocumentNode;
|
|
2
2
|
export declare const CONFIRM_TO_GATEWAY: import("graphql").DocumentNode;
|
|
3
3
|
export declare const CONFIRM_PAYMENT_SUCCESS_MANUAL: import("graphql").DocumentNode;
|
|
4
|
+
export declare const HANDLE_UPDATE_GATEWAY_CONFIG: import("graphql").DocumentNode;
|
|
5
|
+
export declare const HANDLE_CREATE_GATEWAY_CONFIG: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CONFIRM_PAYMENT_SUCCESS_MANUAL = exports.CONFIRM_TO_GATEWAY = exports.CANCEL_PAYMENT = void 0;
|
|
3
|
+
exports.HANDLE_CREATE_GATEWAY_CONFIG = exports.HANDLE_UPDATE_GATEWAY_CONFIG = exports.CONFIRM_PAYMENT_SUCCESS_MANUAL = exports.CONFIRM_TO_GATEWAY = exports.CANCEL_PAYMENT = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.CANCEL_PAYMENT = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation CancelPayment($paymentId: String!, $reason: String!) {
|
|
@@ -52,3 +52,69 @@ exports.CONFIRM_PAYMENT_SUCCESS_MANUAL = (0, graphql_tag_1.gql) `
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
`;
|
|
55
|
+
exports.HANDLE_UPDATE_GATEWAY_CONFIG = (0, graphql_tag_1.gql) `
|
|
56
|
+
mutation HandleUpdateGatewayConfig(
|
|
57
|
+
$input: PaymentGatewayConfigInput!
|
|
58
|
+
$cassoApiKey: String
|
|
59
|
+
) {
|
|
60
|
+
handleUpdateGatewayConfig(input: $input, cassoApiKey: $cassoApiKey) {
|
|
61
|
+
id
|
|
62
|
+
methodCode
|
|
63
|
+
partnerCode
|
|
64
|
+
subMethodCode
|
|
65
|
+
gwPartnerCode
|
|
66
|
+
gwPartnerName
|
|
67
|
+
gwPaymentMethod
|
|
68
|
+
gwSubChannel
|
|
69
|
+
gwMethodVersion
|
|
70
|
+
hashAlgorithm
|
|
71
|
+
accessKey
|
|
72
|
+
secretKey
|
|
73
|
+
responseUrl
|
|
74
|
+
requestUrl
|
|
75
|
+
methodType
|
|
76
|
+
publicKey
|
|
77
|
+
redirectUrl
|
|
78
|
+
activated
|
|
79
|
+
paymentRecordingMethod
|
|
80
|
+
userId
|
|
81
|
+
storeIdMapping {
|
|
82
|
+
storeId
|
|
83
|
+
gwStoreId
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
88
|
+
exports.HANDLE_CREATE_GATEWAY_CONFIG = (0, graphql_tag_1.gql) `
|
|
89
|
+
mutation HandleCreateGatewayConfig(
|
|
90
|
+
$input: PaymentGatewayConfigInput!
|
|
91
|
+
$cassoApiKey: String
|
|
92
|
+
) {
|
|
93
|
+
handleCreateGatewayConfig(input: $input, cassoApiKey: $cassoApiKey) {
|
|
94
|
+
id
|
|
95
|
+
methodCode
|
|
96
|
+
partnerCode
|
|
97
|
+
subMethodCode
|
|
98
|
+
gwPartnerCode
|
|
99
|
+
gwPartnerName
|
|
100
|
+
gwPaymentMethod
|
|
101
|
+
gwSubChannel
|
|
102
|
+
gwMethodVersion
|
|
103
|
+
hashAlgorithm
|
|
104
|
+
accessKey
|
|
105
|
+
secretKey
|
|
106
|
+
responseUrl
|
|
107
|
+
requestUrl
|
|
108
|
+
methodType
|
|
109
|
+
publicKey
|
|
110
|
+
redirectUrl
|
|
111
|
+
activated
|
|
112
|
+
paymentRecordingMethod
|
|
113
|
+
userId
|
|
114
|
+
storeIdMapping {
|
|
115
|
+
storeId
|
|
116
|
+
gwStoreId
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
@@ -4,3 +4,4 @@ export declare const GET_PAYMENT_METHOD_TYPES: import("graphql").DocumentNode;
|
|
|
4
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
|
+
export declare const GET_PAYMENT_METHOD_TITLES: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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_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!]!) {
|
|
@@ -52,6 +52,14 @@ exports.PAYMENT_METHODS = (0, graphql_tag_1.gql) `
|
|
|
52
52
|
name
|
|
53
53
|
description
|
|
54
54
|
image
|
|
55
|
+
titles {
|
|
56
|
+
id
|
|
57
|
+
code
|
|
58
|
+
name
|
|
59
|
+
lang
|
|
60
|
+
showField
|
|
61
|
+
required
|
|
62
|
+
}
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
`;
|
|
@@ -184,3 +192,15 @@ exports.GW_CONFIG_DETAIL = (0, graphql_tag_1.gql) `
|
|
|
184
192
|
}
|
|
185
193
|
}
|
|
186
194
|
`;
|
|
195
|
+
exports.GET_PAYMENT_METHOD_TITLES = (0, graphql_tag_1.gql) `
|
|
196
|
+
query GetPaymentMethodTitles($methodCode: String!) {
|
|
197
|
+
getPaymentMethodTitles(methodCode: $methodCode) {
|
|
198
|
+
id
|
|
199
|
+
code
|
|
200
|
+
name
|
|
201
|
+
lang
|
|
202
|
+
showField
|
|
203
|
+
required
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
`;
|
|
@@ -10,4 +10,7 @@ export declare class PaymentServiceV2 extends Service {
|
|
|
10
10
|
paymentStatus(paymentId: string): Promise<any>;
|
|
11
11
|
gwConfigDetail(configId: string): Promise<any>;
|
|
12
12
|
confirmPaymentSuccessManual(paymentId: string, transactionNo: string, note: string, confirmBy: string): Promise<any>;
|
|
13
|
+
getPaymentMethodTitles(methodCode: string): Promise<any>;
|
|
14
|
+
handleCreateGatewayConfig(input: any, cassoApiKey: string): Promise<any>;
|
|
15
|
+
handleUpdateGatewayConfig(input: any, cassoApiKey: string): Promise<any>;
|
|
13
16
|
}
|
|
@@ -159,5 +159,54 @@ class PaymentServiceV2 extends serviceSDK_1.Service {
|
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
+
getPaymentMethodTitles(methodCode) {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
const query = queries_1.GET_PAYMENT_METHOD_TITLES;
|
|
165
|
+
const variables = {
|
|
166
|
+
methodCode,
|
|
167
|
+
};
|
|
168
|
+
try {
|
|
169
|
+
const response = yield this.graphqlQueryV3(query, variables);
|
|
170
|
+
return response.getPaymentMethodTitles;
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
handleCreateGatewayConfig(input, cassoApiKey) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const mutation = mutations_1.HANDLE_CREATE_GATEWAY_CONFIG;
|
|
180
|
+
const data = Object.assign(Object.assign({}, input), { partnerCode: this.orgId });
|
|
181
|
+
const variable = {
|
|
182
|
+
input: data,
|
|
183
|
+
cassoApiKey,
|
|
184
|
+
};
|
|
185
|
+
try {
|
|
186
|
+
const response = yield this.graphqlMutationV3(mutation, variable);
|
|
187
|
+
return response.handleCreateGatewayConfig;
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
throw error;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
handleUpdateGatewayConfig(input, cassoApiKey) {
|
|
195
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
const mutation = mutations_1.HANDLE_UPDATE_GATEWAY_CONFIG;
|
|
197
|
+
const data = Object.assign(Object.assign({}, input), { partnerCode: this.orgId });
|
|
198
|
+
const variable = {
|
|
199
|
+
input: data,
|
|
200
|
+
cassoApiKey,
|
|
201
|
+
};
|
|
202
|
+
try {
|
|
203
|
+
const response = yield this.graphqlMutationV3(mutation, variable);
|
|
204
|
+
return response.handleUpdateGatewayConfig;
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
162
211
|
}
|
|
163
212
|
exports.PaymentServiceV2 = PaymentServiceV2;
|