Skip to content

Commit

Permalink
chore: cargo clippy_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Narayanbhat166 committed Nov 27, 2024
1 parent e53d062 commit 654abc7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/router/src/core/payments/operations/payment_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentStatusData<F>, PaymentsRetrieveReques
let should_sync_with_connector =
request.force_sync && payment_intent.status.should_force_sync_with_connector();

// We need the address here to send it in the response
let payment_address = hyperswitch_domain_models::payment_address::PaymentAddress::new(
payment_intent
.shipping_address
Expand Down
20 changes: 20 additions & 0 deletions crates/router/src/core/webhooks/incoming_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,32 @@ where
}
api_models::payments::PaymentIdType::PreprocessingId(ref _id) => todo!(),
};

// We need the address here to send it in the response
// In case we need to send an outgoing webhook, we might have to send the billing address and shipping address
let payment_address = hyperswitch_domain_models::payment_address::PaymentAddress::new(
payment_intent
.shipping_address
.clone()
.map(|address| address.into_inner()),
payment_intent
.billing_address
.clone()
.map(|address| address.into_inner()),
payment_attempt
.payment_method_billing_address
.clone()
.map(|address| address.into_inner()),
Some(true),
);

Ok(payments::operations::GetTrackerResponse {
payment_data: PaymentStatusData {
flow: PhantomData,
payment_intent,
payment_attempt: Some(payment_attempt),
should_sync_with_connector: true,
payment_address,
},
})
}
Expand Down

0 comments on commit 654abc7

Please sign in to comment.