@a2hmarket/a2hmarket 0.5.2 → 0.5.3
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/package.json +1 -1
- package/src/tools/order.ts +3 -1
- package/src/tools/payment.ts +6 -2
package/package.json
CHANGED
package/src/tools/order.ts
CHANGED
|
@@ -71,7 +71,9 @@ export function registerOrderTools(api: OpenClawPluginApi, client: A2HApiClient)
|
|
|
71
71
|
required: ["order_id"],
|
|
72
72
|
},
|
|
73
73
|
execute: async (params: Record<string, unknown>) => {
|
|
74
|
-
const
|
|
74
|
+
const orderId = (params.order_id ?? params.orderId) as string;
|
|
75
|
+
if (!orderId) throw new Error("order_id is required");
|
|
76
|
+
const apiPath = `/findu-trade/api/v1/orders/${orderId}/detail`;
|
|
75
77
|
const data = await client.getJSON<Record<string, unknown>>(apiPath);
|
|
76
78
|
return { result: JSON.stringify(data, null, 2) };
|
|
77
79
|
},
|
package/src/tools/payment.ts
CHANGED
|
@@ -67,8 +67,10 @@ export function registerPaymentTools(api: OpenClawPluginApi, client: A2HApiClien
|
|
|
67
67
|
required: ["order_id"],
|
|
68
68
|
},
|
|
69
69
|
execute: async (params: Record<string, unknown>) => {
|
|
70
|
+
const orderId = (params.order_id ?? params.orderId) as string;
|
|
71
|
+
if (!orderId) throw new Error("order_id is required");
|
|
70
72
|
const body: Record<string, unknown> = {
|
|
71
|
-
orderId
|
|
73
|
+
orderId,
|
|
72
74
|
};
|
|
73
75
|
if (params.currency) body.currency = params.currency;
|
|
74
76
|
|
|
@@ -90,7 +92,9 @@ export function registerPaymentTools(api: OpenClawPluginApi, client: A2HApiClien
|
|
|
90
92
|
required: ["order_id"],
|
|
91
93
|
},
|
|
92
94
|
execute: async (params: Record<string, unknown>) => {
|
|
93
|
-
const
|
|
95
|
+
const orderId = (params.order_id ?? params.orderId) as string;
|
|
96
|
+
if (!orderId) throw new Error("order_id is required");
|
|
97
|
+
const apiPath = `${PAYMENT_STATUS_API}/${orderId}`;
|
|
94
98
|
const data = await client.getJSON(apiPath, PAYMENT_STATUS_API);
|
|
95
99
|
return { result: JSON.stringify(data, null, 2) };
|
|
96
100
|
},
|