get_transaction_details
Retrieve complete transaction information using the transaction ID to view payment details, status, and history from Authorize.net.
Instructions
Get full details for a specific transaction by its transaction ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transactionId | Yes | The transaction ID to retrieve details for. |
Implementation Reference
- src/index.ts:128-143 (handler)The main handler function for the 'get_transaction_details' tool. It constructs a GetTransactionDetailsRequest, authenticates with merchant credentials, executes the Authorize.Net API call via controller, handles errors, and returns the transaction details.async function getTransactionDetails(transactionId: string) { const request = new ApiContracts.GetTransactionDetailsRequest(); request.setMerchantAuthentication(getMerchantAuth()); request.setTransId(transactionId); const ctrl = new ApiControllers.GetTransactionDetailsController(request.getJSON()); const response = await executeController(ctrl); const apiResponse = new ApiContracts.GetTransactionDetailsResponse(response); if (apiResponse.getMessages().getResultCode() !== ApiContracts.MessageTypeEnum.OK) { const errors = apiResponse.getMessages().getMessage(); throw new Error(`API Error: ${errors[0].getCode()} - ${errors[0].getText()}`); } return apiResponse.getTransaction(); }
- src/index.ts:253-266 (registration)Registers the 'get_transaction_details' tool in the ListTools response, including its name, description, and input schema definition.{ name: "get_transaction_details", description: "Get full details for a specific transaction by its transaction ID.", inputSchema: { type: "object", properties: { transactionId: { type: "string", description: "The transaction ID to retrieve details for.", }, }, required: ["transactionId"], }, },
- src/index.ts:256-265 (schema)Defines the input schema for the 'get_transaction_details' tool, specifying the required 'transactionId' parameter.inputSchema: { type: "object", properties: { transactionId: { type: "string", description: "The transaction ID to retrieve details for.", }, }, required: ["transactionId"], },
- src/index.ts:320-322 (registration)Dispatches execution of the 'get_transaction_details' tool in the CallToolRequest handler by calling the handler function.case "get_transaction_details": result = await getTransactionDetails(args?.transactionId as string); break;
- src/index.ts:37-51 (helper)Shared utility function used by all tools, including 'get_transaction_details', to asynchronously execute Authorize.Net API controllers.function executeController(ctrl: any): Promise<any> { return new Promise((resolve, reject) => { if (ENVIRONMENT === "production") { ctrl.setEnvironment(SDKConstants.endpoint.production); } ctrl.execute(() => { const response = ctrl.getResponse(); if (response === null) { reject(new Error(ctrl.getErrorResponse() || "No response from API")); } else { resolve(response); } }); }); }