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): add platform_account creation API #7213

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

maverox
Copy link
Contributor

@maverox maverox commented Feb 7, 2025

Type of Change

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

Description

Precursor PR

#6882 (This PR has the context of platform merchant account and initial code changes).

Enabling the platform account.

  • New API has been created to enable platform account.
  • API requires JWTAuth with OrganizationAccountWrite permissions.
  • Once enabled, there is no way of disabling platform account as of now.

changed list api for org and merchant to include platform context.

Additional Changes

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

Motivation and Context

#7210

How did you test it?

  1. Create a merchant account(m1).
  2. Use below api to convert it into platform account.
curl --location '<BASE_URL>/user/platform' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <TOKEN>' \
--data '{
    "merchant_id": "merchant_xxxxxxxxx"
}'
  1. Create another merchant account in the same organisation(m2).
  2. Do a payment using platform's(m1) API key for connected merchant account(m2) by passing header x-connected-merchant-id with value as connected merchant account's merchant id.
  3. Check if payment is created for connected merchant account.
  4. Check if platform_merchant_id is populated with platform's merchant id.

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

@maverox maverox added A-core Area: Core flows C-feature Category: Feature request or enhancement labels Feb 7, 2025
@maverox maverox self-assigned this Feb 7, 2025
@maverox maverox requested review from a team as code owners February 7, 2025 10:36
Copy link

semanticdiff-com bot commented Feb 7, 2025

@hyperswitch-bot hyperswitch-bot bot added the M-database-changes Metadata: This PR involves database schema changes label Feb 7, 2025
@maverox maverox marked this pull request as draft February 7, 2025 11:49
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 M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant