Feature flags
The three merchant switches on <payplug-session> — split payment, per-tranche cancel, and the final-screen layout — what each one changes, and when to enable it.
Three boolean attributes on <payplug-session> tune the journey to your shop. They are
presentation-level choices: they decide what the customer is offered, while the
orchestrator keeps enforcing the same rules underneath. All three are reactive —
toggle the attribute at runtime and the components re-render accordingly.
<payplug-session partial-payment individual-cancel hide-cart-on-final></payplug-session>| Attribute | Off (default) | On |
|---|---|---|
partial-payment |
Every tranche is the full remaining balance. | The customer may split: full amount or a partial one, then complete later. |
individual-cancel |
Authorized tranches only release via a global abandon. | Each authorized tranche has its own cancel action. |
hide-cart-on-final |
The cart panel stays on the final screens. | The cart steps aside on paid/abandoned/expired; the total moves into the final screen. |
partial-payment — the split flow
Section titled “partial-payment — the split flow”Off, method forms submit the remaining balance, full stop — the journey is a classic one-shot checkout with the orchestrator’s guarantees.
On, every method form opens with an amount chooser:
- “Pay the full amount: X” — recommended path, the order confirms immediately.
- “Pay part of the amount” — a locale-aware amount field (comma or dot decimals), validated against the tranche window live; the submit button always shows the exact amount it will charge.
After a partial tranche, the methods list returns with the progress meter and a banner: “X remaining to pay to confirm your order”. The customer repeats with any method — including the same one — until the total is covered. Wording adapts everywhere (“Pay the remaining: X” instead of “Payment”).
Enable it when your customers combine payment means — gift schemes like ANCV next to a card are the canonical case. It is the reason this product exists; leave it off only for flows where a single instrument is a business requirement.
individual-cancel — releasing one tranche
Section titled “individual-cancel — releasing one tranche”Off, a customer who changes their mind about one tranche has one exit: abandoning the whole payment.
On, every authorized tranche in <payplug-progress> carries a cancel action behind a
confirmation dialog that states the contract: the authorization is released immediately,
nothing was charged, and the amount returns to the remaining balance. The released
tranche stays visible in a “cancelled payments” list — history, not an error.
Enable it with partial-payment: it is the escape hatch of the split flow (“I’d rather
put less on the card and more on my vouchers”). Without splits it has nothing to act on —
a lone tranche is better handled by the global abandon.
hide-cart-on-final — the final screens, alone
Section titled “hide-cart-on-final — the final screens, alone”Off, your layout keeps its columns to the end: the cart panel stays next to the confirmation.
On, once the session reaches a terminal state (paid, abandoned, expired) the cart hides and the order total is repatriated into the final screen — so the number the customer just paid never disappears. Combine it with a CSS rule that collapses your now-empty side column, and the final screens become a single centered panel.
Enable it when your cart panel would read as noise after the fact — which is most checkouts; the demo pages ship the collapsing CSS you can lift.
Reading the flags from code
Section titled “Reading the flags from code”The session element exposes the resolved values, read-only:
const session = document.querySelector("payplug-session");session.partialPayment; // booleansession.individualCancel; // booleansession.hideCartOnFinal; // boolean