Preview: SendMock has no stable release yet. These docs follow develop.

MCP reference

Payment gateways tools

sendmock_payment_gateway_create

Add a custom gateway.

Toolset payments.

    InputTypeDescription
    namerequiredstring
    The new gateway's name.Example: Upay
    keyrequiredstring
    Its key in the API and in /providers/<key>/... paths; lowercase, fixed after creation.Example: upay
    start_fromstring
    A gateway to copy (methods, redirect and notification), or null for blank.Example: bkash

    Example call

    {
      "name": "sendmock_payment_gateway_create",
      "arguments": {
        "name": "Upay",
        "key": "upay",
        "start_from": "bkash"
      }
    }

    Result: PaymentGatewayDefinition

    API
    POST/api/v1/payments/gateways
    CLI
    sendmock payments gateways create
    In the app
    Payments > Gateways > Add gateway

    sendmock_payment_gateway_delete

    Delete a custom gateway; 409 while payments use it.

    Toolset payments.

    • Destructive
    • Idempotent
    InputTypeDescription
    gateway_keyrequiredstring
    The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe

    Example call

    {
      "name": "sendmock_payment_gateway_delete",
      "arguments": {
        "gateway_key": "stripe"
      }
    }

    Result: nothing

    API
    DELETE/api/v1/payments/gateways/{gatewayKey}
    CLI
    sendmock payments gateways delete <gatewayKey>
    In the app
    Payments > Gateways > gateway > Delete

    sendmock_payment_gateway_get

    One gateway definition; secret credentials masked.

    Toolset payments.

    • Read only
    InputTypeDescription
    gateway_keyrequiredstring
    The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe

    Example call

    {
      "name": "sendmock_payment_gateway_get",
      "arguments": {
        "gateway_key": "stripe"
      }
    }

    Result: PaymentGatewayDefinition

    API
    GET/api/v1/payments/gateways/{gatewayKey}
    CLI
    sendmock payments gateways show <gatewayKey>
    In the app
    Payments > Gateways > Edit

    sendmock_payment_gateway_list

    Gateways with their checkout, redirect and notification setup.

    Toolset payments.

    • Read only

    No inputs.

    Example call

    {
      "name": "sendmock_payment_gateway_list",
      "arguments": {}
    }

    Result: PaymentGatewayDefinition[]

    API
    GET/api/v1/payments/gateways
    CLI
    sendmock payments gateways list
    In the app
    Payments > Gateways

    sendmock_payment_gateway_preview

    Render a gateway's redirect and notification for a payment.

    Toolset payments.

    • Read only
    InputTypeDescription
    gateway_keyrequiredstring
    The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe
    gatewayrequiredPaymentGatewayInput
    The gateway settings to render, saved or not.
    payment_idstring
    The payment to render against; the newest one when left out.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
    event_typerequiredstring
    The native event to render the notification for.One of: payment.created, payment.authorized, payment.succeeded, payment.failed, payment.canceled, payment.refunded, payment.partially_refunded, payment.dispute_opened, payment.dispute_updated, payment.dispute_closed, checkout.completed, checkout.expiredExample: payment.succeeded
    redirect_outcomerequiredstring
    The redirect to render: success, fail or cancel.One of: success, fail, cancelExample: success

    Example call

    {
      "name": "sendmock_payment_gateway_preview",
      "arguments": {
        "gateway_key": "stripe",
        "gateway": {
          "key": "upay",
          "name": "Upay",
          "accent": "#e2136e",
          "is_enabled": true,
          "method_keys": [
            "upay_wallet",
            "card"
          ],
          "credentials": [
            {
              "name": "webhook_secret",
              "value": "whsec_test_123",
              "is_secret": true
            }
          ],
          "notification_endpoint_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
          "redirect_method": "POST",
          "redirect_fields": [
            {
              "name": "session_id",
              "template": "{{ payment.reference }}",
              "send_on": "always"
            }
          ],
          "notification_content_type": "json",
          "event_names": {
            "payment.succeeded": "PAYMENT_SUCCESS",
            "payment.failed": "PAYMENT_FAILED",
            "payment.refunded": "",
            "checkout.completed": "",
            "checkout.expired": ""
          },
          "notification_body": "{\"status\": \"{{ event.name }}\", \"txn_id\": \"{{ payment.reference }}\"}",
          "notification_headers": [
            {
              "name": "stripe-signature",
              "template": "{{ stripe_signature(merchant.webhook_secret) }}"
            }
          ]
        },
        "event_type": "payment.succeeded",
        "redirect_outcome": "success"
      }
    }

    Result: PaymentGatewayPreview

    API
    POST/api/v1/payments/gateways/{gatewayKey}/preview
    CLI
    sendmock payments gateways preview <gatewayKey>
    In the app
    Payments > Gateways > gateway > Redirect, Notification preview

    sendmock_payment_gateway_reset

    Put a built-in gateway back as shipped.

    Toolset payments.

      InputTypeDescription
      gateway_keyrequiredstring
      The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe

      Example call

      {
        "name": "sendmock_payment_gateway_reset",
        "arguments": {
          "gateway_key": "stripe"
        }
      }

      Result: PaymentGatewayDefinition

      API
      POST/api/v1/payments/gateways/{gatewayKey}/reset
      CLI
      sendmock payments gateways reset <gatewayKey>
      In the app
      Payments > Gateways > gateway > Reset to default

      sendmock_payment_gateway_update

      Change a gateway; secret credentials stay masked.

      Toolset payments.

      • Idempotent
      InputTypeDescription
      gateway_keyrequiredstring
      The payment gateway's key, e.g. stripe or sslcommerz.Example: stripe
      keyrequiredstring
      The provider value in the API and in /providers/<key>/... paths.Example: upay
      namerequiredstring
      The gateway's name, shown on checkout pages.Example: Upay
      accentrequiredstring
      #rrggbb, used on its checkout pages.Example: #e2136e
      is_enabledrequiredboolean
      Off gateways reject new checkouts.Example: true
      method_keysrequiredstring[]
      The methods its checkout offers, in order.Example: ["upay_wallet","card"]
      credentialsrequiredGatewayCredential[]
      The merchant credentials your app is configured with.Example: [{"name":"webhook_secret","value":"whsec_test_123","is_secret":true}]
      notification_endpoint_idstring
      The webhook endpoint its IPN or webhook deliveries go to.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      redirect_methodrequiredstring
      How the browser returns to your app: GET (query string) or POST (form).One of: GET, POSTExample: POST
      redirect_fieldsrequiredGatewayRedirectField[]
      The parameters sent to your app on redirect.Example: [{"name":"session_id","template":"{{ payment.reference }}","send_on":"always"}]
      notification_content_typerequiredstring
      How the IPN or webhook body is sent: json or form.One of: json, formExample: json
      event_namesrequiredobject
      The gateway's name for each native event; blank sends nothing.
      notification_bodyrequiredstring
      The notification body, a template over the payment and the event.Example: {"status": "{{ event.name }}", "txn_id": "{{ payment.reference }}"}
      notification_headersrequiredGatewayHeaderTemplate[]
      Headers sent with each notification.Example: [{"name":"stripe-signature","template":"{{ stripe_signature(merchant.webhook_secret) }}"}]

      Example call

      {
        "name": "sendmock_payment_gateway_update",
        "arguments": {
          "gateway_key": "stripe",
          "key": "upay",
          "name": "Upay",
          "accent": "#e2136e",
          "is_enabled": true,
          "method_keys": [
            "upay_wallet",
            "card"
          ],
          "credentials": [
            {
              "name": "webhook_secret",
              "value": "whsec_test_123",
              "is_secret": true
            }
          ],
          "redirect_method": "POST",
          "redirect_fields": [
            {
              "name": "session_id",
              "template": "{{ payment.reference }}",
              "send_on": "always"
            }
          ],
          "notification_content_type": "json",
          "event_names": {
            "payment.succeeded": "PAYMENT_SUCCESS",
            "payment.failed": "PAYMENT_FAILED",
            "payment.refunded": "",
            "checkout.completed": "",
            "checkout.expired": ""
          },
          "notification_body": "{\"status\": \"{{ event.name }}\", \"txn_id\": \"{{ payment.reference }}\"}",
          "notification_headers": [
            {
              "name": "stripe-signature",
              "template": "{{ stripe_signature(merchant.webhook_secret) }}"
            }
          ]
        }
      }

      Result: PaymentGatewayDefinition

      API
      PATCH/api/v1/payments/gateways/{gatewayKey}
      CLI
      sendmock payments gateways update <gatewayKey>
      In the app
      Payments > Gateways > gateway > Save gateway