Skip to main content
Glama
baskcart

W3Ship MCP Server

by baskcart

confirm_payment

Verify on-chain payments by submitting transaction hashes to update order status to paid. Confirm crypto transfers to seller wallets for order completion.

Instructions

Submit an on-chain payment transaction for verification. After paying the seller (send crypto to their wallet address), provide the transaction hash here to verify payment and update the order status to "paid".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderIdYesThe order ID to confirm payment for
txHashYesThe on-chain transaction hash (0x...)
chainIdNoChain ID where payment was sent. Default: 8453 (Base)

Implementation Reference

  • Handler implementation for the confirm_payment tool. It forwards the request to the centralized W3Ship API.
    case 'confirm_payment': {
        const { orderId: payOrderId, txHash, chainId: payChainId } = args as any;
        try {
            const payRes = await fetch(`${W3SHIP_API}/api/order/pay`, {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({
                    orderId: payOrderId,
                    txHash,
                    chainId: payChainId || 8453,
                }),
            });
            const payData = await payRes.json() as any;
    
            if (!payRes.ok) {
                return {
                    content: [{ type: 'text', text: `Payment verification failed: ${payData.error || 'Unknown error'}` }],
                    isError: true,
                };
            }
    
            return {
                content: [{
                    type: 'text',
                    text: JSON.stringify({
                        verified: payData.verified,
                        orderId: payOrderId,
                        txHash,
                        status: payData.order?.paymentStatus || 'paid',
                        message: payData.verified
                            ? `Payment verified! Order ${payOrderId} is confirmed. The seller will be notified to ship your item.`
                            : `Payment could not be verified. Please check the transaction hash.`,
                    }, null, 2)
                }]
            };
        } catch (e: any) {
            return { content: [{ type: 'text', text: `Error verifying payment: ${e.message}` }], isError: true };
        }
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/baskcart/w3ship-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server