mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix(mandates): handle the connector_mandate creation once and only if the payment is charged (#6327)
This commit is contained in:
@ -180,6 +180,7 @@ impl PaymentAttemptInterface for MockDb {
|
||||
customer_acceptance: payment_attempt.customer_acceptance,
|
||||
organization_id: payment_attempt.organization_id,
|
||||
profile_id: payment_attempt.profile_id,
|
||||
connector_mandate_detail: payment_attempt.connector_mandate_detail,
|
||||
};
|
||||
payment_attempts.push(payment_attempt.clone());
|
||||
Ok(payment_attempt)
|
||||
|
||||
@ -531,6 +531,7 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
|
||||
customer_acceptance: payment_attempt.customer_acceptance.clone(),
|
||||
organization_id: payment_attempt.organization_id.clone(),
|
||||
profile_id: payment_attempt.profile_id.clone(),
|
||||
connector_mandate_detail: payment_attempt.connector_mandate_detail.clone(),
|
||||
};
|
||||
|
||||
let field = format!("pa_{}", created_attempt.attempt_id);
|
||||
@ -1453,6 +1454,7 @@ impl DataModelExt for PaymentAttempt {
|
||||
connector_transaction_data,
|
||||
shipping_cost: self.net_amount.get_shipping_cost(),
|
||||
order_tax_amount: self.net_amount.get_order_tax_amount(),
|
||||
connector_mandate_detail: self.connector_mandate_detail,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1528,6 +1530,7 @@ impl DataModelExt for PaymentAttempt {
|
||||
customer_acceptance: storage_model.customer_acceptance,
|
||||
organization_id: storage_model.organization_id,
|
||||
profile_id: storage_model.profile_id,
|
||||
connector_mandate_detail: storage_model.connector_mandate_detail,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1610,6 +1613,7 @@ impl DataModelExt for PaymentAttemptNew {
|
||||
profile_id: self.profile_id,
|
||||
shipping_cost: self.net_amount.get_shipping_cost(),
|
||||
order_tax_amount: self.net_amount.get_order_tax_amount(),
|
||||
connector_mandate_detail: self.connector_mandate_detail,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1681,6 +1685,7 @@ impl DataModelExt for PaymentAttemptNew {
|
||||
customer_acceptance: storage_model.customer_acceptance,
|
||||
organization_id: storage_model.organization_id,
|
||||
profile_id: storage_model.profile_id,
|
||||
connector_mandate_detail: storage_model.connector_mandate_detail,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user