Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/router/src/core/payment_methods/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ pub enum StoreLockerReq<'a> {
LockerGeneric(StoreGenericReq<'a>),
}

impl StoreLockerReq<'_> {
pub fn update_requestor_card_reference(&mut self, card_reference: Option<String>) {
match self {
Self::LockerCard(c) => c.requestor_card_reference = card_reference,
Self::LockerGeneric(_) => (),
}
}
}

#[derive(Debug, Deserialize, Serialize)]
pub struct StoreCardReq<'a> {
pub merchant_id: &'a str,
Expand Down
11 changes: 7 additions & 4 deletions crates/router/src/core/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,13 @@ pub async fn fulfill_payout(

match router_data_resp.response {
Ok(payout_response_data) => {
if payout_data.payouts.recurring && payout_data.payouts.payout_method_id.is_none() {
let status = payout_response_data
.status
.unwrap_or(payout_attempt.status.to_owned());
if payout_data.payouts.recurring
&& payout_data.payouts.payout_method_id.is_none()
&& !helpers::is_payout_err_state(status)
{
helpers::save_payout_data_to_locker(
state,
payout_attempt,
Expand All @@ -1258,9 +1264,6 @@ pub async fn fulfill_payout(
)
.await?;
}
let status = payout_response_data
.status
.unwrap_or(payout_attempt.status.to_owned());
let updated_payouts = storage::payout_attempt::PayoutAttemptUpdate::StatusUpdate {
connector_payout_id: payout_attempt.connector_payout_id.to_owned(),
status,
Expand Down
Loading