@flopay/js 1.9.14 → 1.9.16
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 +47 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -329,6 +329,40 @@ try {
|
|
|
329
329
|
}
|
|
330
330
|
```
|
|
331
331
|
|
|
332
|
+
### Server-side card gateways (Worldpay)
|
|
333
|
+
|
|
334
|
+
The billing API can process hosted-vault cards through an approved Worldpay
|
|
335
|
+
Corporate Gateway entirely server-side (TeamFloPay/backend#1563). Whether a
|
|
336
|
+
session can use it is the billing API's decision, made from the merchant's
|
|
337
|
+
active gateways and their Operations-approved capability record
|
|
338
|
+
(TeamFloPay/backend#1641). `PaymentAPI` sends no capability token, gateway
|
|
339
|
+
hint, or provider selection on any create, so the same request works for every
|
|
340
|
+
SDK version and integration style. Everything stays provider-neutral, so
|
|
341
|
+
existing integrations change nothing:
|
|
342
|
+
|
|
343
|
+
- Cards still go through the hosted vault widget, from the embedded `vault`
|
|
344
|
+
block or `getVaultCapture()`. There is no Worldpay browser SDK, key, or
|
|
345
|
+
credential: `gateways.worldpayCorporateGateway` carries
|
|
346
|
+
`publishableKey: null` and no enabled methods, and it never appears in the
|
|
347
|
+
normalized `providers` list.
|
|
348
|
+
- Outcomes arrive as the same `complete` / `decline` / `error` widget events.
|
|
349
|
+
Declines carry Flo's decline taxonomy, never a raw refusal code. An ambiguous
|
|
350
|
+
submission stays pending until the billing API reconciles it; the hosted form
|
|
351
|
+
reports that as an `error`, never a success, and a later session read returns
|
|
352
|
+
the reconciled status.
|
|
353
|
+
- In the merged billing API version, Worldpay takes one-time item carts only
|
|
354
|
+
and offers no 3DS authentication, stored credentials, or card setup; the
|
|
355
|
+
billing API keeps subscription carts on another card gateway. No
|
|
356
|
+
client-visible authentication continuation exists for Worldpay.
|
|
357
|
+
|
|
358
|
+
Auto, Confirm, and pre-tokenized sessions charge a stored payment method, which
|
|
359
|
+
the Worldpay route does not accept; the billing API keeps those on the released
|
|
360
|
+
Stripe and PayPal routing by itself. Do not add gateway selection, capability
|
|
361
|
+
headers, or provider-specific branches to a create request, whether through
|
|
362
|
+
this SDK or a request you build yourself: the billing API owns that decision,
|
|
363
|
+
and a client-side copy of it would become a second routing authority that
|
|
364
|
+
drifts from the merchant's real gateway state.
|
|
365
|
+
|
|
332
366
|
## API Reference
|
|
333
367
|
|
|
334
368
|
## Privacy-safe operational telemetry
|
|
@@ -437,7 +471,8 @@ payment-success outcomes.
|
|
|
437
471
|
```ts
|
|
438
472
|
// 1. Obtain the vault capture block — use an embedded block when supplied, or
|
|
439
473
|
// fetch it through the explicit recovery route for a session whose Stripe
|
|
440
|
-
// enabledPaymentMethods explicitly includes `card
|
|
474
|
+
// enabledPaymentMethods explicitly includes `card`, or that advertises a
|
|
475
|
+
// server-side card gateway (`gateways.worldpayCorporateGateway`). The first
|
|
441
476
|
// argument is the checkout session id (`getVaultCapture(checkoutSessionId, nonce?)`):
|
|
442
477
|
const vault = session.vault ??
|
|
443
478
|
await new PaymentAPI(billingApiUrl).getVaultCapture(checkoutSessionId, nonce);
|
|
@@ -468,6 +503,14 @@ capture.on('error', (e) => onError(e.message));
|
|
|
468
503
|
await capture.mount(container, { html, messageToken, expectedOrigin });
|
|
469
504
|
```
|
|
470
505
|
|
|
506
|
+
`e.intentId` is the processing gateway's own reference for the attempt. It is a
|
|
507
|
+
Stripe PaymentIntent (or SetupIntent) id only when Stripe took the card; when
|
|
508
|
+
the session advertises a server-side card gateway such as
|
|
509
|
+
`gateways.worldpayCorporateGateway`, it may be an opaque processor order
|
|
510
|
+
reference instead. Reconcile by `paymentId` and the session rather than
|
|
511
|
+
treating it as a Stripe object. `FloPayCheckout` and `SplitCardForm` omit
|
|
512
|
+
`paymentIntentId` from `onComplete` for those sessions.
|
|
513
|
+
|
|
471
514
|
`capture.applyTheme(theme)` re-skins the mounted widget without remounting it.
|
|
472
515
|
Pass the `VaultCardThemeColors` the React components compute: the flat keys
|
|
473
516
|
every hosted asset understands plus the optional `submitButton` snapshot
|
|
@@ -522,7 +565,9 @@ supplied), or that arrive from a non-matching `expectedOrigin` (when set).
|
|
|
522
565
|
|
|
523
566
|
> Backend contract: TeamFloPay/backend#823. Starting with SDK 1.4.9, an explicit
|
|
524
567
|
> `card` entry in `gateways.stripe.enabledPaymentMethods` advertises that hosted
|
|
525
|
-
> capture can be recovered without an embedded `vault` block.
|
|
568
|
+
> capture can be recovered without an embedded `vault` block. A
|
|
569
|
+
> `gateways.worldpayCorporateGateway` entry on an open session advertises the
|
|
570
|
+
> same (TeamFloPay/backend#1563).
|
|
526
571
|
> `PaymentAPI.getVaultCapture()` coalesces concurrent callers, aborts a stalled
|
|
527
572
|
> attempt after ten seconds, and keeps bounded transient-network retry on the
|
|
528
573
|
> idempotent `POST /v1/checkouts/sessions/{id}/vault/capture` route.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flopay/js",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@stripe/stripe-js": "^9.8.0",
|
|
35
|
-
"@flopay/shared": "1.9.
|
|
35
|
+
"@flopay/shared": "1.9.16"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"jsdom": "^29.1.1",
|