-
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
feat(core): implemented platform merchant account #6882
base: main
Are you sure you want to change the base?
Conversation
@@ -77,6 +77,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentData<F>, api::PaymentsRequest> | |||
key_store: &domain::MerchantKeyStore, | |||
auth_flow: services::AuthFlow, | |||
header_payload: &hyperswitch_domain_models::payments::HeaderPayload, | |||
_platform_merchant_account: Option<&domain::MerchantAccount>, |
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.
we should validate that this belongs to the same merchant_id that was passed in create right?
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.
yess, will add validations in eventual PRs.
@@ -548,8 +573,31 @@ where | |||
.await | |||
.to_not_found_response(errors::ApiErrorResponse::Unauthorized)?; | |||
|
|||
// Get connected merchant account if API call is done by Platform merchant account on behalf of connected merchant account | |||
let (merchant, platform_merchant_account) = if state.conf().platform.enabled { | |||
get_platform_merchant_account(state, request_headers, merchant).await? |
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.
we can pass key store from this function itself
a1c7434
to
7102076
Compare
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.
configs and ci, look good to me
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.
The HeaderAuth
side of things look good
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 you make the same changes in the other config files as well: config/development.toml
and config/docker_compose.toml
?
@@ -724,12 +775,14 @@ where | |||
} | |||
|
|||
#[cfg(all(feature = "partial-auth", feature = "v1"))] | |||
#[allow(unused)] |
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.
Do we still need this annotation?
@@ -1412,15 +1537,20 @@ pub struct MerchantIdAuth(pub id_type::MerchantId); | |||
|
|||
#[cfg(feature = "v1")] | |||
#[async_trait] | |||
#[allow(unused)] |
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.
Same here.
724cf37
Type of Change
Description
About the feature
Enabling the platform account.
How it works
x-connected-merchant-id
.is_platform
true and the merchant account on behalf of which operation is performed belongs to the same organisation as platform then the operation is allowed.Payment Intent
x-connected-merchant-id
header.platform_merchant_id
column for the payment intent will be populated with platforms merchant id.Other operations
platform_merchant_id
in other operations as well.Additional Changes
Motivation and Context
#6883
How did you test it?
x-connected-merchant-id
with value as connected merchant account's merchant id.platform_merchant_id
is populated with platform's merchant id.Checklist
cargo +nightly fmt --all
cargo clippy