WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@apoorvdixit88
Copy link
Contributor

@apoorvdixit88 apoorvdixit88 commented Nov 28, 2025

Type of Change

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

Description

This PR adds the basic Platform-aware wiring for the payment create → get tracker flow. It is not the complete Platform payments feature — the goal is only to make the existing path work correctly when a Platform triggers a payment for a connected merchant as well as for a standard merchant.

To clarify the current behaviour with the Platform model introduced in this PR:

  • Payment Intent → Processor level
  • Payment Attempt → Processor level
  • Business Profile → Processor level
  • Merchant Connector Account (MCA) → Processor level
  • Mandates → kept at Processor level for now (not part of this PR’s scope)
  • Payment Link → kept at Processor level for now
  • Payment-related Addresses → Processor level

Key changes:

  • Replaces the earlier single-merchant assumption with Platform concept in get tracker for payments create
  • Passes the correct Provider and Processor context to the modules involved in get_tracker
  • Introduces the Platform wrapper (Provider + Processor)
  • No API or DB schema changes — only internal plumbing

This sets the foundation for the full Platform behaviour to be completed in later PRs.

Additional Changes

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

Motivation and Context

Closes #10488

How did you test it?

  • CI checks passing, no compilation issue
  • Existing behaviour remained intact, no flows failing for standard merchants with these changes.
  • Cypress Test Passing.

This can be tested for platform feature once the whole payment_create flow is done.

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

@apoorvdixit88 apoorvdixit88 self-assigned this Nov 28, 2025
@apoorvdixit88 apoorvdixit88 requested review from a team as code owners November 28, 2025 08:46
@semanticdiff-com
Copy link

semanticdiff-com bot commented Nov 28, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/refunds.rs  88% smaller
  crates/router/src/core/payments/operations/payment_status.rs  85% smaller
  crates/router/src/core/payouts.rs  77% smaller
  crates/router/src/core/utils.rs  45% smaller
  crates/router/src/core/payments/operations/payment_create.rs  38% smaller
  crates/router/src/core/payments/helpers.rs  20% smaller
  crates/router/src/core/payment_link.rs  5% smaller
  crates/api_models/src/payments.rs  1% smaller
  crates/router/src/core/payments.rs  1% smaller
  api-reference/v1/openapi_spec_v1.json  0% smaller
  crates/router/src/core/admin.rs  0% smaller
  crates/router/src/core/fraud_check/flows/fulfillment_flow.rs  0% smaller
  crates/router/src/core/payment_methods/cards.rs  0% smaller
  crates/router/src/core/payments/operations/payment_approve.rs  0% smaller
  crates/router/src/core/payments/operations/payment_cancel.rs  0% smaller
  crates/router/src/core/payments/operations/payment_cancel_post_capture.rs  0% smaller
  crates/router/src/core/payments/operations/payment_capture.rs  0% smaller
  crates/router/src/core/payments/operations/payment_complete_authorize.rs  0% smaller
  crates/router/src/core/payments/operations/payment_confirm.rs  0% smaller
  crates/router/src/core/payments/operations/payment_post_session_tokens.rs  0% smaller
  crates/router/src/core/payments/operations/payment_reject.rs  0% smaller
  crates/router/src/core/payments/operations/payment_session.rs  0% smaller
  crates/router/src/core/payments/operations/payment_start.rs  0% smaller
  crates/router/src/core/payments/operations/payment_update.rs  0% smaller
  crates/router/src/core/payments/operations/payment_update_metadata.rs  0% smaller
  crates/router/src/core/payments/operations/payments_extend_authorization.rs  0% smaller
  crates/router/src/core/payments/operations/payments_incremental_authorization.rs  0% smaller
  crates/router/src/core/payments/operations/tax_calculation.rs  0% smaller
  crates/router/src/core/payments/transformers.rs  0% smaller
  crates/router/src/core/payouts/helpers.rs  0% smaller
  crates/router/src/core/payouts/validator.rs  0% smaller
  crates/router/src/core/routing.rs  0% smaller
  crates/router/src/core/unified_authentication_service.rs  0% smaller
  crates/router/src/db/events.rs  0% smaller
  crates/router/src/utils/user/sample_data.rs  0% smaller
  crates/router/tests/payments2.rs  0% smaller
  crates/storage_impl/src/lib.rs  0% smaller
  crates/storage_impl/src/platform_wrapper.rs  0% smaller
  crates/storage_impl/src/platform_wrapper/business_profile.rs  0% smaller
  crates/storage_impl/src/platform_wrapper/payment_attempt.rs  0% smaller
  crates/storage_impl/src/platform_wrapper/payment_intent.rs  0% smaller

@apoorvdixit88 apoorvdixit88 marked this pull request as draft November 28, 2025 08:46
@tsdk02 tsdk02 added A-core Area: Core flows T-Core For Work done by the core team platform labels Nov 28, 2025
@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 5.63380% with 67 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@0582129). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...orage_impl/src/platform_wrapper/payment_attempt.rs 0.00% 16 Missing ⚠️
...torage_impl/src/platform_wrapper/payment_intent.rs 0.00% 16 Missing ⚠️
...rage_impl/src/platform_wrapper/business_profile.rs 0.00% 12 Missing ⚠️
crates/router/src/core/routing.rs 0.00% 10 Missing ⚠️
crates/router/src/core/payment_link.rs 0.00% 7 Missing ⚠️
crates/router/src/core/payouts.rs 0.00% 4 Missing ⚠️
crates/router/src/core/utils.rs 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10465   +/-   ##
=======================================
  Coverage        ?    6.46%           
=======================================
  Files           ?     1254           
  Lines           ?   311989           
  Branches        ?        0           
=======================================
  Hits            ?    20161           
  Misses          ?   291828           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@apoorvdixit88 apoorvdixit88 added C-feature Category: Feature request or enhancement C-refactor Category: Refactor labels Dec 1, 2025
@apoorvdixit88 apoorvdixit88 marked this pull request as ready for review December 1, 2025 00:19
) -> errors::CustomResult<Profile, errors::StorageError> {
db.find_business_profile_by_profile_id(processor.get_key_store(), profile_id)
.await
}
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 have an interface instead of dangling function

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Dec 4, 2025
Copy link
Contributor

@ShankarSinghC ShankarSinghC left a comment

Choose a reason for hiding this comment

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

LGTM

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 C-refactor Category: Refactor M-api-contract-changes Metadata: This PR involves API contract changes platform T-Core For Work done by the core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Make payment create get tracker work with Provider/Processor (Platform context)

5 participants