@nimee/api-clients 1.1.60 → 1.1.61
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/eventOrder.d.ts +7 -1
- package/dist/src/eventOrder.js +11 -2
- package/dist/src/eventOrder.js.map +1 -1
- package/package.json +1 -1
- package/src/eventOrder.ts +28 -6
package/dist/src/eventOrder.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEventOrderModel } from "@nimee/shared-types";
|
|
1
|
+
import { IEventOrderModel, IStatusPaymentEnum } from "@nimee/shared-types";
|
|
2
2
|
export declare class EventOrderClient {
|
|
3
3
|
updateWithId(params: {
|
|
4
4
|
token: string;
|
|
@@ -14,6 +14,7 @@ export declare class EventOrderClient {
|
|
|
14
14
|
eventId: string;
|
|
15
15
|
eventOrderId: string;
|
|
16
16
|
jwt: string;
|
|
17
|
+
shouldPopulateUserEvents?: boolean;
|
|
17
18
|
}): Promise<any>;
|
|
18
19
|
getAllEventOrders(jwt: string): Promise<any>;
|
|
19
20
|
updateEventOrder(jwt: string): Promise<any>;
|
|
@@ -23,4 +24,9 @@ export declare class EventOrderClient {
|
|
|
23
24
|
accountId: string;
|
|
24
25
|
eventId: string;
|
|
25
26
|
}): Promise<any>;
|
|
27
|
+
updateEventOrderStatus(params: {
|
|
28
|
+
eventOrderId: string;
|
|
29
|
+
status: IStatusPaymentEnum;
|
|
30
|
+
jwt: string;
|
|
31
|
+
}): Promise<any>;
|
|
26
32
|
}
|
package/dist/src/eventOrder.js
CHANGED
|
@@ -41,8 +41,8 @@ class EventOrderClient {
|
|
|
41
41
|
}
|
|
42
42
|
getEventOrderById(params) {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const { accountId, eventOrderId, eventId, jwt } = params;
|
|
45
|
-
const response = yield axios_1.default.get(`${userEventOrderUrl}/getEventOrderById/${accountId}/${eventId}/${eventOrderId}`, {
|
|
44
|
+
const { accountId, eventOrderId, eventId, jwt, shouldPopulateUserEvents } = params;
|
|
45
|
+
const response = yield axios_1.default.get(`${userEventOrderUrl}/getEventOrderById/${accountId}/${eventId}/${eventOrderId}?shouldPopulateUserEvents=${shouldPopulateUserEvents ? "true" : "false"}`, {
|
|
46
46
|
headers: { jwt: `${jwt}` },
|
|
47
47
|
});
|
|
48
48
|
return response === null || response === void 0 ? void 0 : response.data;
|
|
@@ -73,6 +73,15 @@ class EventOrderClient {
|
|
|
73
73
|
return response === null || response === void 0 ? void 0 : response.data;
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
+
updateEventOrderStatus(params) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
const { eventOrderId, status, jwt } = params;
|
|
79
|
+
const response = yield axios_1.default.put(`${userEventOrderUrl}/updateStatus/${eventOrderId}`, { status }, {
|
|
80
|
+
headers: { jwt: `${jwt}` },
|
|
81
|
+
});
|
|
82
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
76
85
|
}
|
|
77
86
|
exports.EventOrderClient = EventOrderClient;
|
|
78
87
|
// POST request to 'https://.co/payment/payme/webhook' ({"payme_status":"success","status_error_code":0,"status_code":0,"seller_payme_id":"MPL16720-72349IAE-FRITPXY5-TFLDUEWF","seller_created":"2022-12-26 18:32:29","seller_first_name":"Ron","seller_last_name":"Dahan","seller_social_id":"205569163","seller_birthdate":"1994-07-01","seller_date_of_birth":"1994-07-01","seller_gender":0,"seller_email":"roncho1794@gmail.com","seller_contact_email":"roncho1794@gmail.com","seller_phone":"+972542323517","seller_contact_phone":"+972542323517","seller_address_city":"Tel Aviv","seller_address_street":"Tel Aviv","seller_address_street_number":"12","seller_address_country":"IL","seller_inc":0,"seller_inc_code":"12345","seller_merchant_name":"Ronen","seller_site_url":"www.no.co.il","seller_custom_details":"No existing Isracard MID","seller_active":true,"seller_approved":false,"seller_market_fee":0,"seller_currencies":,"fee_default_processing_fee":"1.50","fee_default_processing_charge":"0.100000000000000000","fee_default_discount_fee":"0.50","fee_foreign_processing_fee":"2.95","fee_foreign_processing_charge":"0.100000000000000000","fee_forcurr_processing_charge":"0.100000000000000000","seller_public_key":{"uuid":"b40a5251-9907-4db1-8f26-c015dd9466df","description":"PayMe-Public-Key","is_active":true},"notify_type":"seller-create"}) with headers () T:6801.5247 M:38.50MB
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventOrder.js","sourceRoot":"","sources":["../../src/eventOrder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC;AACpG,MAAM,iBAAiB,GAAG,GAAG,QAAQ,yBAAyB,CAAC;AAE/D,MAAa,gBAAgB;IACrB,YAAY,CAAC,MAA6E;;YAC9F,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;YACnD,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,GAAG,iBAAiB,eAAe,EACnC;gBACE,UAAU;gBACV,YAAY;aACb,EACD;gBACE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE;aAC7B,CACF,CAAC;YACF,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC;QACxB,CAAC;KAAA;IACK,kBAAkB,CAAC,MAAsD;;YAC7E,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;YAC9C,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,GAAG,iBAAiB,WAAW,EAC/B,EAAE,gBAAgB,EAAE,EACpB;gBACE,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eAAK,CAAC,GAAG,CAC9B,GAAG,iBAAiB,+BAA+B,SAAS,IAAI,OAAO,IAAI,qBAAqB,EAAE,EAClG;gBACE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE;aAC3B,CACF,CAAC;YACF,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC;QACxB,CAAC;KAAA;IACK,sBAAsB,CAAC,MAAyE;;YACpG,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;YAC7C,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,GAAG,iBAAiB,iBAAiB,YAAY,EAAE,EACnD,EAAE,MAAM,EAAE,EACV;gBACE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE;aAC3B,CACF,CAAC;YACF,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC;QACxB,CAAC;KAAA;CACF;AAlFD,4CAkFC;AACD,g2CAAg2C"}
|
package/package.json
CHANGED
package/src/eventOrder.ts
CHANGED
|
@@ -2,7 +2,7 @@ import axios from "axios";
|
|
|
2
2
|
const port = process.env.USER_EVENT_PORT;
|
|
3
3
|
const basePath = process.env.IS_LOCAL === "true" ? `http://127.0.0.1:${port}` : "http://user-event";
|
|
4
4
|
const userEventOrderUrl = `${basePath}/user-event/event-order`;
|
|
5
|
-
import { IChargeModel, IEventOrderModel } from "@nimee/shared-types";
|
|
5
|
+
import { IChargeModel, IEventOrderModel, IStatusPaymentEnum } from "@nimee/shared-types";
|
|
6
6
|
export class EventOrderClient {
|
|
7
7
|
async updateWithId(params: { token: string; eventOrder: IEventOrderModel; eventOrderId: string }) {
|
|
8
8
|
const { token, eventOrder, eventOrderId } = params;
|
|
@@ -29,11 +29,22 @@ export class EventOrderClient {
|
|
|
29
29
|
);
|
|
30
30
|
return response?.data;
|
|
31
31
|
}
|
|
32
|
-
async getEventOrderById(params: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
async getEventOrderById(params: {
|
|
33
|
+
accountId: string;
|
|
34
|
+
eventId: string;
|
|
35
|
+
eventOrderId: string;
|
|
36
|
+
jwt: string;
|
|
37
|
+
shouldPopulateUserEvents?: boolean;
|
|
38
|
+
}) {
|
|
39
|
+
const { accountId, eventOrderId, eventId, jwt, shouldPopulateUserEvents } = params;
|
|
40
|
+
const response = await axios.get(
|
|
41
|
+
`${userEventOrderUrl}/getEventOrderById/${accountId}/${eventId}/${eventOrderId}?shouldPopulateUserEvents=${
|
|
42
|
+
shouldPopulateUserEvents ? "true" : "false"
|
|
43
|
+
}`,
|
|
44
|
+
{
|
|
45
|
+
headers: { jwt: `${jwt}` },
|
|
46
|
+
}
|
|
47
|
+
);
|
|
37
48
|
return response?.data;
|
|
38
49
|
}
|
|
39
50
|
async getAllEventOrders(jwt: string) {
|
|
@@ -63,5 +74,16 @@ export class EventOrderClient {
|
|
|
63
74
|
);
|
|
64
75
|
return response?.data;
|
|
65
76
|
}
|
|
77
|
+
async updateEventOrderStatus(params: { eventOrderId: string; status: IStatusPaymentEnum; jwt: string }) {
|
|
78
|
+
const { eventOrderId, status, jwt } = params;
|
|
79
|
+
const response = await axios.put(
|
|
80
|
+
`${userEventOrderUrl}/updateStatus/${eventOrderId}`,
|
|
81
|
+
{ status },
|
|
82
|
+
{
|
|
83
|
+
headers: { jwt: `${jwt}` },
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
return response?.data;
|
|
87
|
+
}
|
|
66
88
|
}
|
|
67
89
|
// POST request to 'https://.co/payment/payme/webhook' ({"payme_status":"success","status_error_code":0,"status_code":0,"seller_payme_id":"MPL16720-72349IAE-FRITPXY5-TFLDUEWF","seller_created":"2022-12-26 18:32:29","seller_first_name":"Ron","seller_last_name":"Dahan","seller_social_id":"205569163","seller_birthdate":"1994-07-01","seller_date_of_birth":"1994-07-01","seller_gender":0,"seller_email":"roncho1794@gmail.com","seller_contact_email":"roncho1794@gmail.com","seller_phone":"+972542323517","seller_contact_phone":"+972542323517","seller_address_city":"Tel Aviv","seller_address_street":"Tel Aviv","seller_address_street_number":"12","seller_address_country":"IL","seller_inc":0,"seller_inc_code":"12345","seller_merchant_name":"Ronen","seller_site_url":"www.no.co.il","seller_custom_details":"No existing Isracard MID","seller_active":true,"seller_approved":false,"seller_market_fee":0,"seller_currencies":,"fee_default_processing_fee":"1.50","fee_default_processing_charge":"0.100000000000000000","fee_default_discount_fee":"0.50","fee_foreign_processing_fee":"2.95","fee_foreign_processing_charge":"0.100000000000000000","fee_forcurr_processing_charge":"0.100000000000000000","seller_public_key":{"uuid":"b40a5251-9907-4db1-8f26-c015dd9466df","description":"PayMe-Public-Key","is_active":true},"notify_type":"seller-create"}) with headers () T:6801.5247 M:38.50MB
|