fix(connector): [SQUARE] Throw Error for Partial Capture of Payments (#2133)

This commit is contained in:
DEEPANSHU BANSAL
2023-09-12 22:12:01 +05:30
committed by GitHub
parent eff280f2fb
commit cc8847cce0
2 changed files with 7 additions and 0 deletions

View File

@ -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)