feat(router): Added amount conversion function in core for connector module (#4710)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com>
Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
This commit is contained in:
Sahkal Poddar
2024-05-30 19:21:33 +05:30
committed by GitHub
parent f7e99e1eda
commit 08eefdba4a
30 changed files with 577 additions and 150 deletions

View File

@ -46,7 +46,7 @@ impl From<StripeCreateRefundRequest> for refunds::RefundRequest {
fn from(req: StripeCreateRefundRequest) -> Self {
Self {
refund_id: req.refund_id,
amount: req.amount,
amount: req.amount.map(common_utils::types::MinorUnit::new),
payment_id: req.payment_intent,
reason: req.reason,
refund_type: Some(refunds::RefundType::Instant),
@ -82,7 +82,7 @@ impl From<refunds::RefundResponse> for StripeRefundResponse {
fn from(res: refunds::RefundResponse) -> Self {
Self {
id: res.refund_id,
amount: res.amount,
amount: res.amount.get_amount_as_i64(),
currency: res.currency.to_ascii_lowercase(),
payment_intent: res.payment_id,
status: res.status.into(),