Skip to main content

Signature

async function checkout(page: PageLike, options: CheckoutOptions): Promise<CheckoutResult>

Parameters

NameTypeDescription
pagePageLikeAny object with evaluate() — Playwright Page, Puppeteer Page, etc.
options.intentIdstringAn approved intent ID
options.timeoutnumberTimeout in ms (default: 30000)

Returns

{
  success: boolean;
  transactionId: string | null;
  profile: string;        // "Stripe Elements", "Adyen Drop-in", etc.
  fieldsFound: string[];  // ["pan", "expiry", "cvc"]
  fieldsMissed: string[];
  durationMs: number;
  error?: string;
}

Example

const result = await OvraPay.checkout(page, { intentId: "in_xxx" });

if (result.success) {
  console.log(`Paid via ${result.profile} in ${result.durationMs}ms`);
} else {
  console.log(`Failed: ${result.error}, missed: ${result.fieldsMissed}`);
}