Sarraf API
    Preparing search index...

    Class PaymobProvider

    Implements

    • PaymentProvider<"paymob">
    Index
    • Parameters

      • options: {
            apiKey?: string;
            baseUrl?: string;
            hmacSecret: string;
            integrationIds: Partial<
                Record<
                    | "card"
                    | "wallet"
                    | "cash_outlet"
                    | "installments"
                    | "bnpl"
                    | "bank_transfer"
                    | "other"
                    | "card_auth"
                    | "card_moto"
                    | "apple_pay",
                    number,
                >,
            >;
            publicKey: string;
            region?: "egypt"
            | "ksa"
            | "uae"
            | "oman";
            secretKey: string;
        }
        • OptionalapiKey?: string

          Legacy API key: needed for transaction inquiry (getPayment / reconcile).

        • OptionalbaseUrl?: string

          Override the region base URL (testing / proxies).

        • hmacSecret: string

          HMAC secret from the dashboard: verifies transaction callbacks.

        • integrationIds: Partial<
              Record<
                  | "card"
                  | "wallet"
                  | "cash_outlet"
                  | "installments"
                  | "bnpl"
                  | "bank_transfer"
                  | "other"
                  | "card_auth"
                  | "card_moto"
                  | "apple_pay",
                  number,
              >,
          >

          Integration ids, one per payment method (card, wallet, cash_outlet for kiosk, bnpl, installments, …) plus card_auth, card_moto and apple_pay. Test/live mode must match the keys.

        • publicKey: string

          Public key (pk_…): builds the Unified Checkout URL. Safe for browsers.

        • Optionalregion?: "egypt" | "ksa" | "uae" | "oman"
        • secretKey: string

          Secret key (sk_test_… / sk_live_…): creates intentions, refunds, voids.

      Returns PaymobProvider

    capabilities: Capabilities
    config: PaymobConfig
    id: "paymob" = ...
    • get extras(): PaymobExtras

      Paymob features beyond the shared API: saved cards, subscriptions, payment links and intention updates. Available once the adapter is passed to new Sarraf(...).

      Returns PaymobExtras

    • get publicKey(): string

      The public key, for client-side Paymob Pixel. Safe to send to browsers.

      Returns string

    • Called once by Sarraf with its context, for adapters that expose extra APIs.

      Parameters

      • ctx: Ctx

      Returns void

    • Void a same-day card payment (no amount). Looks the transaction up by reference when needed.

      Parameters

      • lookup: PaymentLookup
      • ctx: Ctx

      Returns Promise<Payment>

    • Capture an authorization made with providerOptions.capture: "manual".

      Parameters

      • input: CaptureInput
      • ctx: Ctx

      Returns Promise<Payment>

    • Hosted Unified Checkout, or a kiosk bill reference when methods is ["cash_outlet"].

      payment.providerPaymentId is empty until Paymob creates the transaction: the id arrives with the webhook or payments.reconcile. Refunds, voids and captures need that transaction id.

      Parameters

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

      Returns Promise<Checkout>

    • Parameters

      • lookup: PaymentLookup
      • ctx: Ctx

      Returns Promise<Payment>

    • Parameters

      • req: RawWebhookRequest

      Returns Promise<WebhookInspection>

    • Configured id for key, or CAPABILITY_NOT_SUPPORTED.

      Parameters

      • key:
            | "card"
            | "wallet"
            | "cash_outlet"
            | "installments"
            | "bnpl"
            | "bank_transfer"
            | "other"
            | "card_auth"
            | "card_moto"
            | "apple_pay"

      Returns number

    • Parameters

      • verified: VerifiedWebhook
      • ctx: Ctx

      Returns Promise<SarrafEvent>

    • Parameters

      • input: RefundInput
      • ctx: Ctx

      Returns Promise<Refund>

    • Parameters

      • query: Record<string, string>

      Returns Promise<RedirectResult>

    • Throws WEBHOOK_SIGNATURE_INVALID when the signature does not match.

      Parameters

      • req: RawWebhookRequest

      Returns Promise<VerifiedWebhook>