Repository navigation
Deferred Capture
Authorize the payment at checkout, capture it later — typically when you ship. Until it is
captured, the customer's funds are held, not debited, and the Sylius payment is authorized (the
order's payment state reads authorized, not paid).
Deferred capture is available on the Payplug (card) gateway only.
On the Payplug payment method, tick Enable deferred capture.
Two flows exist, depending on the card display mode:
| Display mode | Who triggers the capture | What can be captured |
|---|---|---|
| Hosted Fields | You, from the order screen (or your own code) | Full, partial, several times; cancellation too |
| Redirected / Integrated | Your code, or the scheduled command | The whole authorized amount at once |
An authorization does not last: capture it before it lapses. For Redirected and Integrated it is valid for 7 days. For Hosted Fields the order screen shows the capture deadline.
On the order screen (Sales → Orders → an order), a PayPlug — Deferred capture block is shown under Payments for each such payment.
| Field | Meaning |
|---|---|
| Authorized amount | What the customer's bank agreed to hold |
| Already captured | Sum of the captures performed so far |
| Cancelled | Sum of the cancellations performed so far (shown once there is one) |
| Remaining capturable | What can still be captured or cancelled |
| Capture deadline | The date after which the authorization lapses and the funds are released. A warning is shown 48 hours before it; after it, no action is offered any more |
Leave the amount blank to capture everything that remains, or type an amount (12.50 or 12,50)
for a partial capture. Captures can be chained as long as their total stays within the authorized
amount.
| After the capture | Sylius payment state |
|---|---|
| Something is still capturable | stays authorized
|
| Nothing is left |
completed (the order becomes paid) |
Sylius's own Complete button is hidden for these payments.
Cancellation is only offered before any capture. Leave the amount blank to cancel everything, or type an amount for a partial cancellation — which must be enabled on your Payplug contract; otherwise Payplug refuses it and the admin explains why.
| After the cancellation | Sylius payment state |
|---|---|
| Something is still authorized | stays authorized (the rest can still be captured) |
| Nothing is left | cancelled |
Once part of the authorization is captured, use a refund to give money back.
Nothing is recorded and the payment state is unchanged; the admin shows an explicit message — for example the authorization has expired, the amount exceeds what remains, partial cancellation is not enabled on the contract, the customer's bank refused, or another operation is already in progress on this payment.
A form submitted twice (double click, back and resubmit) is refused as stale.
If Payplug accepted the operation but Sylius failed to save it, the admin says the operation may have been performed and asks you to check the payment in the Payplug portal before retrying. Retrying blindly would capture twice.
Sylius has no notion of a partial capture. The payment amount stays at the authorized amount, and Sylius's payment state and the refundable total are left untouched; what was really captured is tracked separately and is what refunds are computed from. After a partial cancellation followed by a capture of the rest, the order reads as paid for the authorized amount while the captured amount is the smaller one shown in the block.
Do captures and cancellations from the Sylius order screen. Operations performed outside Sylius (Payplug portal, Payplug support, another integration on the same account) are not reflected in Sylius.
Nothing captures automatically: something must complete the payment.
bin/console payplug:capture-authorized-payments --days=6Captures every authorized payment older than 6 days — one day before the 7-day authorization lapses. Safe to run from a cron job.
The plugin hooks the payment's complete transition, so completing an authorized payment captures
it. Add your own trigger on the event that should release the money — for example order shipping.
The repository's authorized payment guide
has ready-to-use examples for Symfony Workflow (the Sylius 2 default) and Winzou.
The same complete transition also drives the Hosted Fields flow: applied by the command or your
own listener, it captures the whole remaining amount first, and if that capture is refused the
transition is aborted and the payment stays authorized.
Official Payplug payment plugin for Sylius
Get started
Guides
Operate