@flopay/react 1.4.19 → 1.4.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -356,6 +356,41 @@ Skip the backend API route — create the session directly in the component:
356
356
 
357
357
  The component POSTs to the billing API, gets the full session back, and renders the form — zero backend code needed.
358
358
 
359
+ #### Authorisation-only checkout
360
+
361
+ Set `captureMethod: 'manual'` in the same `createSession` draft for an eligible
362
+ item-only card checkout:
363
+
364
+ ```tsx
365
+ <FloPayCheckout
366
+ createSession={{
367
+ clientId: 'your-client-id',
368
+ captureMethod: 'manual',
369
+ currency: 'EUR',
370
+ items: [{ code: 'order_123', totalAmount: 29.99 }],
371
+ account: { userId: 'user_1', email: 'user@example.com' },
372
+ successUrl: '/success',
373
+ cancelUrl: '/cancel',
374
+ }}
375
+ onComplete={(result) => {
376
+ if (result.status === 'authorized') {
377
+ saveAuthorisation({
378
+ paymentId: result.paymentId,
379
+ sessionId: result.sessionId,
380
+ expiresAt: result.authorizationExpiresAt,
381
+ });
382
+ }
383
+ }}
384
+ onSessionCompleted={(successUrl) => router.push(successUrl)}
385
+ />
386
+ ```
387
+
388
+ The component still releases the buyer to the success experience, but its
389
+ overlay says `PAYMENT AUTHORISED`. `authorized` means funds are held, not paid.
390
+ Capture remains a merchant-authenticated REST operation and is never available
391
+ to browser code. Manual capture is rejected for subscription carts. See the
392
+ repository's [pre-authorisation guide](../../docs/PREAUTHORIZATION.md).
393
+
359
394
  That create POST sends a stable `Idempotency-Key` header automatically whenever a
360
395
  secure RNG is available. `FloPayCheckout` resolves the key once per logical
361
396
  checkout, stores it with the inline-session cache in `sessionStorage`, and reuses