Checkout class, error classes, version constant, and TypeScript types used by the public API.
CheckoutConfig
environment selects the hosted Checkout application, not payment test/live mode. Test/live mode is determined by the API keys and Payment Intent. Use local only while developing Lynq’s hosted Checkout application locally.
new Checkout(config)
Creates an unmounted browser Checkout instance. It throws ConfigError when publicKey, clientSecret, or environment is invalid, or when constructed outside a browser.
At most one Checkout can be mounted on a page at a time.
Lifecycle methods
Subscription methods
Every
on... method returns this for chaining.
Event payloads
ReadyEvent
ValidationState
PaymentResult
PaymentResult is a discriminated union on status:
succeeded: includespaymentIntentIdand optionalpaymentMethodprocessing: includespaymentIntentIdand optionalpaymentMethodrequires_payment_method: includespaymentIntentId,error, and optionalpaymentMethod
PaymentError contains a machine-readable code and display-safe message.
Payment-method summaries
Card results may includebrand, last4, expMonth, expYear, and cardholderName. Idram results identify the Idram provider. These summaries do not contain the full card number or security code.
Error classes
LynqError: base error withcode,message, andretryableConfigError: invalid constructor configuration or non-browser constructionMountError: invalid mount container or Checkout lifecycle state
LynqErrorCode and recommended handling.
VERSION
VERSION is the SDK package version string. It is useful in diagnostics when reporting an integration problem.