Skip to content

Commit 64687cb

Browse files
Sayak BhattacharyaSayak Bhattacharya
authored andcommitted
fix: resolved PR comments
1 parent 4096060 commit 64687cb

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,12 +1971,6 @@ impl TryFrom<(&PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntentRequest
19711971
(None, None) => None,
19721972
};
19731973

1974-
let customer_id = item.connector_customer.clone().ok_or_else(|| {
1975-
ConnectorError::MissingRequiredField {
1976-
field_name: "connector_customer",
1977-
}
1978-
})?;
1979-
19801974
Ok(Self {
19811975
amount, //hopefully we don't loose some cents here
19821976
currency: item.request.currency.to_string(), //we need to copy the value and not transfer ownership
@@ -1996,7 +1990,7 @@ impl TryFrom<(&PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntentRequest
19961990
payment_data,
19971991
payment_method_options,
19981992
payment_method: pm,
1999-
customer: Some(Secret::new(customer_id)),
1993+
customer: item.connector_customer.clone().map(Secret::new),
20001994
setup_mandate_details,
20011995
off_session: item.request.off_session,
20021996
setup_future_usage: match (

crates/router/src/core/revenue_recovery/transformers.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ use crate::{
88
impl ForeignFrom<AttemptStatus> for RevenueRecoveryPaymentsAttemptStatus {
99
fn foreign_from(s: AttemptStatus) -> Self {
1010
match s {
11-
AttemptStatus::Authorized
12-
| AttemptStatus::Charged
13-
| AttemptStatus::AutoRefunded
14-
| AttemptStatus::IntegrityFailure => Self::Succeeded,
11+
AttemptStatus::Authorized | AttemptStatus::Charged | AttemptStatus::AutoRefunded => {
12+
Self::Succeeded
13+
}
1514

1615
AttemptStatus::Started
1716
| AttemptStatus::AuthenticationSuccessful
@@ -35,7 +34,8 @@ impl ForeignFrom<AttemptStatus> for RevenueRecoveryPaymentsAttemptStatus {
3534
| AttemptStatus::PaymentMethodAwaited
3635
| AttemptStatus::AuthenticationPending
3736
| AttemptStatus::DeviceDataCollectionPending
38-
| AttemptStatus::Unresolved => Self::InvalidStatus(s.to_string()),
37+
| AttemptStatus::Unresolved
38+
| AttemptStatus::IntegrityFailure => Self::InvalidStatus(s.to_string()),
3939
}
4040
}
4141
}

0 commit comments

Comments
 (0)