diff --git a/README.md b/README.md index 2150867..8f9f70d 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,11 @@ export function Checkout() { item: { name: "Pro Plan", description: "Monthly", unitPrice: 19, currency: "USD", durationMonths: 1 }, }), }); - if (!res.ok) checkout.handleError(new Error(await res.text())); + if (!res.ok) { + checkout.handleError(new Error(await res.text())); + return; + } + checkout.handleSuccess(); } return ( @@ -76,10 +80,7 @@ export function Checkout() { environment="production" language="he-IL" onTokenizationStart={checkout.handleStart} - onToken={(token) => { - checkout.handleToken(token); - return handleToken(token); - }} + onToken={handleToken} onError={checkout.handleError} >