-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(core): add recurring customer support for nomupay payouts. #6687
base: main
Are you sure you want to change the base?
Conversation
b098698
to
13f9582
Compare
a6d2247
to
dba2017
Compare
crates/api_models/src/payouts.rs
Outdated
@@ -184,6 +184,8 @@ pub struct PayoutCreateRequest { | |||
/// Customer's phone country code. _Deprecated: Use customer object instead._ | |||
#[schema(deprecated, max_length = 255, example = "+1")] | |||
pub phone_country_code: Option<String>, | |||
|
|||
pub payment_method_id: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub payment_method_id: Option<String>, | |
pub payout_method_id: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
crates/api_models/src/payouts.rs
Outdated
@@ -568,6 +570,8 @@ pub struct PayoutCreateResponse { | |||
#[remove_in(PayoutCreateResponse)] | |||
#[schema(value_type = Option<String>, max_length = 1024, example = "Invalid card details")] | |||
pub unified_message: Option<UnifiedMessage>, | |||
|
|||
pub payment_method_id: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub payment_method_id: Option<String>, | |
pub payout_method_id: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
crates/diesel_models/src/enums.rs
Outdated
pub enum TransactionFlow { | ||
#[default] | ||
Payment, | ||
Payouts, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub enum TransactionFlow { | |
#[default] | |
Payment, | |
Payouts, | |
} | |
pub enum PaymentDirection { | |
#[default] | |
Payin, | |
Payout, | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
_merchant_account: &domain::MerchantAccount, | ||
_key_store: &domain::MerchantKeyStore, | ||
) -> RouterResult<()> { | ||
todo!() | ||
Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
use crate::{ | ||
core::{ | ||
errors::{self, RouterResult}, | ||
// payment_methods::cards::get_pm_list_context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
crates/router/src/core/payouts.rs
Outdated
connector_data.merchant_connector_id.clone(), | ||
) { | ||
let connector_mandate_details = HashMap::from([( | ||
merchant_connector_id, // which connector was called [MCA] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove these comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
crates/router/src/core/payouts.rs
Outdated
|
||
let payment_method_id: Option<String> = payout_data | ||
.payment_method | ||
.as_ref() // Safely access the `payment_method` as a reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
crates/router/src/core/payouts.rs
Outdated
#[cfg(all( | ||
any(feature = "v1", feature = "v2"), | ||
not(feature = "payment_methods_v2") | ||
))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this feature flag needed here? 🤔
crates/router/src/core/payouts.rs
Outdated
let payment_method = db | ||
.find_payment_method( | ||
&(state.into()), | ||
key_store, | ||
&payout_method_id, // need to get from api request | ||
merchant_account.storage_scheme, | ||
) | ||
.await | ||
.change_context(errors::ApiErrorResponse::PaymentMethodNotFound) | ||
.attach_printable("Unable to find payment method")?; | ||
|
||
payout_data.payment_method = Some(payment_method.clone()); | ||
payout_data.payouts.payout_method_id = | ||
Some(payment_method.payment_method_id.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
db.find_payment_method( | ||
&(state.into()), | ||
key_store, | ||
&pm_id, // need to get from api request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
403de74
to
9247d06
Compare
Type of Change
Description
recurring customer support for nomupay
Additional Changes
Motivation and Context
How did you test it?
Checklist
cargo +nightly fmt --all
cargo clippy