Skip to content
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

Merged
merged 13 commits into from
Apr 25, 2024

Conversation

Sakilmostak
Copy link
Contributor

@Sakilmostak Sakilmostak commented Apr 16, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Access token flow is added for payout create and payout fulfill flow.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

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

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@Sakilmostak Sakilmostak added A-core Area: Core flows C-feature Category: Feature request or enhancement labels Apr 16, 2024
@Sakilmostak Sakilmostak self-assigned this Apr 16, 2024
@Sakilmostak Sakilmostak requested review from a team as code owners April 16, 2024 18:36
@@ -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))
Copy link
Contributor

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

@@ -134,6 +134,22 @@ pub enum Connector {
}

impl Connector {
#[cfg(feature = "payouts")]
pub fn supports_create_payout_in_router(&self, payout_method: PayoutType) -> bool {
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

kashif-m
kashif-m previously approved these changes Apr 22, 2024
Comment on lines 36 to 43
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());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove .clone()

sahkal
sahkal previously approved these changes Apr 22, 2024
@Sakilmostak Sakilmostak dismissed stale reviews from sahkal and kashif-m via 28305d9 April 23, 2024 11:05
kashif-m
kashif-m previously approved these changes Apr 23, 2024
sahkal
sahkal previously approved these changes Apr 23, 2024
@Sakilmostak Sakilmostak dismissed stale reviews from sahkal and kashif-m via b131306 April 23, 2024 11:38
@likhinbopanna likhinbopanna added this pull request to the merge queue Apr 25, 2024
Merged via the queue into main with commit 7f0d04f Apr 25, 2024
13 of 15 checks passed
@likhinbopanna likhinbopanna deleted the payout_access_token_flow branch April 25, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants