-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(core): [Payouts] Add access_token flow for Payout Create and Fulfill flow #4375
Conversation
crates/api_models/src/enums.rs
Outdated
@@ -134,6 +134,22 @@ pub enum Connector { | |||
} | |||
|
|||
impl Connector { | |||
#[cfg(feature = "payouts")] | |||
pub fn supports_create_payout_in_router(&self, payout_method: PayoutType) -> bool { | |||
matches!((self, payout_method), (Self::Paypal, PayoutType::Wallet)) |
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.
PayoutType::Card should also be considered here
crates/api_models/src/enums.rs
Outdated
@@ -134,6 +134,22 @@ pub enum Connector { | |||
} | |||
|
|||
impl Connector { | |||
#[cfg(feature = "payouts")] | |||
pub fn supports_create_payout_in_router(&self, payout_method: PayoutType) -> bool { |
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 name this supports_instant_payout
?
@@ -62,6 +62,7 @@ pub async fn add_access_token< | |||
.connector_name | |||
.supports_access_token(router_data.payment_method) | |||
{ | |||
// requires_later |
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
match connector_access_token.access_token_result.as_ref() { | ||
Ok(access_token) => { | ||
router_data.access_token = access_token.clone(); | ||
} | ||
Err(connector_error) => { | ||
router_data.response = Err(connector_error.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.
can we remove .clone()
Type of Change
Description
Access token flow is added for payout create and payout fulfill flow.
Additional Changes
Motivation and Context
How did you test it?
This cannot be tested because the connector for which this change has been made for is yet not merged.
Note: Should not break current sanity
Only adds access token flow for Paypal Payouts(for now)
Checklist
cargo +nightly fmt --all
cargo clippy