confirm_order
Verify and confirm the status of an order after a payment attempt using the Satim Payment Gateway Integration. Processes order ID and language preferences to ensure accurate transaction tracking and response.
Instructions
Confirm order status after payment attempt
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | Language for response messages | |
| orderId | Yes | Order ID returned from registration |
Implementation Reference
- satim-mcp-server.ts:407-424 (handler)MCP CallTool handler for 'confirm_order': validates credentials, calls SatimPaymentGateway.confirmOrder, and returns JSON stringified response.
case "confirm_order": if (!satimGateway) { throw new McpError(ErrorCode.InvalidRequest, "Credentials not configured. Use configure_credentials first."); } const confirmationResponse = await satimGateway.confirmOrder({ orderId: args.orderId as string, language: args.language as 'AR' | 'FR' | 'EN' }); return { content: [ { type: "text", text: JSON.stringify(confirmationResponse, null, 2) } ] }; - satim-mcp-server.ts:283-300 (schema)Input schema and registration of the 'confirm_order' tool in listTools response.
name: "confirm_order", description: "Confirm order status after payment attempt", inputSchema: { type: "object", properties: { orderId: { type: "string", description: "Order ID returned from registration" }, language: { type: "string", enum: ["AR", "FR", "EN"], description: "Language for response messages" } }, required: ["orderId"] } }, - satim-mcp-server.ts:123-137 (helper)Core helper method SatimPaymentGateway.confirmOrder that performs HTTP GET to SATIM API endpoint /confirmOrder.do with credentials and orderId.
async confirmOrder(params: OrderConfirmationParams): Promise<OrderConfirmationResponse> { try { const queryParams = new URLSearchParams({ userName: this.credentials.userName, password: this.credentials.password, orderId: params.orderId, ...(params.language && { language: params.language }) }); const response = await axios.get(`${this.baseUrl}/confirmOrder.do?${queryParams}`); return response.data; } catch (error) { throw new Error(`Order confirmation failed: ${error}`); } } - satim-mcp-server.ts:44-47 (schema)TypeScript interface defining input parameters for confirmOrder, matching the tool inputSchema.
interface OrderConfirmationParams { orderId: string; language?: 'AR' | 'FR' | 'EN'; } - satim-mcp-server.ts:49-73 (schema)TypeScript interface defining the expected response structure from SATIM confirmOrder API.
interface OrderConfirmationResponse { orderNumber?: string; actionCode?: number; actionCodeDescription?: string; amount?: number; errorCode?: string; errorMessage?: string; orderStatus?: number; approvalCode?: string; authCode?: number; cardholderName?: string; depositAmount?: number; currency?: string; pan?: string; ip?: string; params?: { respCode?: string; respCode_desc?: string; udf1?: string; udf2?: string; udf3?: string; udf4?: string; udf5?: string; }; }