[BUG] [Adyen]: declared as overcapture-supported but the connector implements no overcapture request or response
Bug Description
Adyen is declared as supporting overcapture, but the Adyen connector has no overcapture code. It is unclear whether overcapture actually works on Adyen, or whether the declaration is wrong.
The declaration, crates/common_enums/src/connector_enums.rs#L499-L501:
pub fn is_overcapture_supported_by_connector(self) -> bool {
matches!(self, Self::Stripe | Self::Adyen)
}Stripe implements the request side: request_overcapture is sent as payment_method_options[card][request_overcapture] (crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs:375-376, and the paths that populate it around 1490, 1513, 1765, 1819).
crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs contains zero occurrences of overcapture, case-insensitive. Nothing in the Adyen authorize request opts into it, and nothing in the Adyen response parses a result back.
This matters because the declaration has two user-visible effects:
get_enable_overcapture_bool_if_connector_supports(crates/hyperswitch_domain_models/src/payments.rs:285-300) keeps the merchant'senable_overcaptureonly when the connector is declared to support it, so on Adyen the flag survives into the payment.is_overcapture_enabledon the response falls back to the effective request value when the connector reports no result (crates/router/src/core/payments/operations/payment_response.rs:2794-2804). With no Adyen response parsing, an Adyen payment can returnis_overcapture_enabled: truepurely because it was requested.
So a merchant on Adyen can see true and reasonably conclude the processor accepted overcapture, with nothing in the integration having asked for it.
Expected Behavior
One of:
- Adyen implements the overcapture request and response fields, like Stripe, or
- Adyen is removed from
is_overcapture_supported_by_connector, or - If Adyen overcapture is enabled account-side at Adyen and needs no request field, that is documented, and the response side still reports the real result rather than echoing the request.
Actual Behavior
Adyen is declared as supported, sends nothing, parses nothing, and can report is_overcapture_enabled: true from the fallback.
Steps To Reproduce
- Configure an Adyen connector and a profile with overcapture available.
- Create a payment with
capture_method: manualandenable_overcapture: true, routed to Adyen. - Authorize it and read the response:
is_overcapture_enabledcan betrue, sourced from the request fallback rather than from Adyen. - Compare the outgoing Adyen authorize request: it carries no overcapture field.
Context For The Bug
Found while documenting overcapture for the docs (juspay/hyperswitch-docs#272). The page's sample response was changed from Adyen to Stripe because the Adyen example could not be verified end to end. If Adyen overcapture works through a path not found here, say so on this issue and the docs will show an Adyen example again.
This is code inspection, not an executed test.
Environment
Code inspection at main (5fb7e5598eadd8ed5fa42822427107f271a1e112); also present at 184ffd4c015fd3fea2f3868549f1a86ffa5f40da.
Have you spent some time checking if this bug has been raised before?
- I checked and didn't find a similar issue
Source: juspay/hyperswitch