mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
fix(connector): [Payme] Fix for partial capture validation (#1939)
This commit is contained in:
@ -551,6 +551,12 @@ pub struct PaymentCaptureRequest {
|
|||||||
impl TryFrom<&types::PaymentsCaptureRouterData> for PaymentCaptureRequest {
|
impl TryFrom<&types::PaymentsCaptureRouterData> for PaymentCaptureRequest {
|
||||||
type Error = error_stack::Report<errors::ConnectorError>;
|
type Error = error_stack::Report<errors::ConnectorError>;
|
||||||
fn try_from(item: &types::PaymentsCaptureRouterData) -> Result<Self, Self::Error> {
|
fn try_from(item: &types::PaymentsCaptureRouterData) -> Result<Self, Self::Error> {
|
||||||
|
if item.request.amount_to_capture != item.request.payment_amount {
|
||||||
|
Err(errors::ConnectorError::NotSupported {
|
||||||
|
message: "Partial Capture".to_string(),
|
||||||
|
connector: "Payme",
|
||||||
|
})?
|
||||||
|
}
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
payme_sale_id: item.request.connector_transaction_id.clone(),
|
payme_sale_id: item.request.connector_transaction_id.clone(),
|
||||||
sale_price: item.request.amount_to_capture,
|
sale_price: item.request.amount_to_capture,
|
||||||
|
|||||||
Reference in New Issue
Block a user