Sarraf API
    Preparing search index...

    Class KashierProvider

    Implements

    • PaymentProvider<"kashier">
    Index
    • Parameters

      • options: {
            amountFormat?: "fixed" | "trimmed";
            apiKey: string;
            currencies?: string[];
            merchantId: string;
            mode?: "test" | "live";
            secretKey?: string;
            urls?: { api?: string; checkout?: string; fep?: string };
        }
        • OptionalamountFormat?: "fixed" | "trimmed"

          How the major-unit amount string is written in the hash and URL. Both always use the same string. "fixed" → "250.00", "trimmed" → "250" (Kashier's demo style).

        • apiKey: string

          Payment API key: signs the hosted-page hash and verifies redirect / webhook signatures.

        • Optionalcurrencies?: string[]
        • merchantId: string

          Merchant id, e.g. MID-123-456.

        • Optionalmode?: "test" | "live"
        • OptionalsecretKey?: string

          Secret key: server API calls (refunds, order lookup, sessions).

        • Optionalurls?: { api?: string; checkout?: string; fep?: string }

      Returns KashierProvider

    capabilities: Capabilities
    id: "kashier" = ...
    • Voids the order's successful pay transaction (same day only; use a refund after that). Confirmed in the sandbox (fixtures/kashier/sandbox-void-succeeded.json). Needs reference to find the pay transaction, and returns the order as Kashier reports it after the void.

      Parameters

      • lookup: PaymentLookup
      • ctx: Ctx

      Returns Promise<Payment>

    • Parameters

      • input: CreateCheckoutInput<"kashier">
      • ctx: Ctx

      Returns Promise<Checkout>

    • Looks the order up by reference (your merchantOrderId). Kashier's order search does not accept its own order id, so a providerPaymentId-only lookup is rejected.

      Parameters

      • lookup: PaymentLookup
      • ctx: Ctx

      Returns Promise<Payment>

    • Parameters

      • req: RawWebhookRequest

      Returns Promise<WebhookInspection>

    • Parameters

      • verified: VerifiedWebhook
      • ctx: Ctx

      Returns Promise<SarrafEvent>

    • providerPaymentId is the Kashier order id. For a full refund omit amount and pass reference: Kashier answers HTTP 500 to a refund without an amount (sandbox, 2026-10-21), so the remaining amount is read from the order lookup, which only searches by reference.

      Parameters

      • input: RefundInput
      • ctx: Ctx

      Returns Promise<Refund>

    • Pass the query in the order received (an object from Express keeps insertion order).

      Parameters

      • query: Record<string, string>

      Returns Promise<RedirectResult>

    • Throws WEBHOOK_SIGNATURE_INVALID when the signature does not match.

      Parameters

      • req: RawWebhookRequest

      Returns Promise<VerifiedWebhook>