Signature
Parameters
| Name | Type | Description |
|---|---|---|
page | PageLike | Any object with evaluate() — Playwright Page, Puppeteer Page, etc. |
options.intentId | string | An approved intent ID |
options.timeout | number | Timeout in ms (default: 30000) |
Fill a payment form securely.
async function checkout(page: PageLike, options: CheckoutOptions): Promise<CheckoutResult>
| Name | Type | Description |
|---|---|---|
page | PageLike | Any object with evaluate() — Playwright Page, Puppeteer Page, etc. |
options.intentId | string | An approved intent ID |
options.timeout | number | Timeout in ms (default: 30000) |
{
success: boolean;
transactionId: string | null;
profile: string; // "Stripe Elements", "Adyen Drop-in", etc.
fieldsFound: string[]; // ["pan", "expiry", "cvc"]
fieldsMissed: string[];
durationMs: number;
error?: string;
}
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}`);
}