mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-04 05:59:48 +08:00
fix(connector): [SQUARE] Throw Error for Partial Capture of Payments (#2133)
This commit is contained in:
@ -567,6 +567,12 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme
|
||||
req: &types::PaymentsCaptureRouterData,
|
||||
connectors: &settings::Connectors,
|
||||
) -> CustomResult<Option<services::Request>, errors::ConnectorError> {
|
||||
if req.request.amount_to_capture != req.request.payment_amount {
|
||||
Err(errors::ConnectorError::NotSupported {
|
||||
message: "Partial Capture".to_string(),
|
||||
connector: "Square",
|
||||
})?
|
||||
}
|
||||
Ok(Some(
|
||||
services::RequestBuilder::new()
|
||||
.method(services::Method::Post)
|
||||
|
||||
Reference in New Issue
Block a user