Better Payment 0.11.1 API
    Preparing search index...

    Class PayTR

    PayTR payment provider

    • initThreeDSPayment(): iFrame API. The payment result is delivered to the notification (Bildirim) URL configured in the PayTR panel; pass that POST body to completeThreeDSPayment() and respond with plain text "OK".
    • createPayment(): Direct API, non-3D, synchronous (requires the "Non-3D" permission on the PayTR account).

    Hierarchy (View Summary)

    Index
    • Charges (all or part of) a pre-authorized amount

      Parameters

      • _request: CaptureRequest

      Returns Promise<PaymentResponse>

    • Verifies and maps the notification (Bildirim URL) POST.

      After processing, the endpoint MUST respond with plain text "OK"; otherwise PayTR keeps re-sending the notification. The built-in handler does this. PayTR may send the same notification more than once: make order updates idempotent.

      Parameters

      Returns Promise<PaymentResponse>

    • Payment with a stored card (utoken + ctoken)

      Returns an auto-submitting HTML form that posts to the PayTR Direct API from the customer's browser (3D Secure). The result is delivered to the notification URL like any other payment.

      Parameters

      Returns Promise<ThreeDSInitResponse>

    • Deletes a saved card (/odeme/capi/delete)

      Parameters

      • request: DeleteCardRequest

      Returns Promise<DeleteCardResponse>

    • iFrame payment (3D Secure handled by PayTR)

      callbackUrl is where the customer's browser is redirected (merchant_ok_url / merchant_fail_url). It does NOT carry the payment result: the result is sent server-to-server to the notification URL configured in the PayTR panel.

      installment: undefined = customer can choose any installment, 1 = single payment only, n > 1 = up to n installments.

      Parameters

      Returns Promise<ThreeDSInitResponse>

    • A customer's saved cards (Kart Saklama, /odeme/capi/list)

      Parameters

      • request: { customerToken: string }

      Returns Promise<ListCardsResponse>

    • PayTR saves cards only during a Direct API payment: pass saveCard to createPayment(), then read the utoken from the result or the notification.

      Parameters

      • _request: SaveCardRequest

      Returns Promise<SaveCardResponse>

    • Releases a pre-authorization; nothing is charged

      Parameters

      • _request: VoidAuthorizationRequest

      Returns Promise<CancelResponse>