feat(payment_methods): enhance customer payment methods retrieval with modular service support #11125
+170
−55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This pull request introduces support for routing customer payment method listing requests through a modular service, based on organizational eligibility. The changes add new request and response types, update query parameter handling, and implement conditional logic to determine whether to use the modular service or the legacy flow. Additionally, a new helper function is provided to facilitate modular service calls with appropriate headers.
Modular service integration for customer payment method listing:
ListCustomerPaymentMethodsV1Request) and response (ListCustomerPaymentMethodsV1Response) types to support modular service calls, including fields for service prefix and guest customer status.Conditional routing based on organizational eligibility:
get_organization_eligibility_config_for_pm_modular_serviceto determine if requests should be routed to the modular service, and updated the main listing logic to branch accordingly. [1] [2] [3]Helper function for modular service calls:
list_customer_pml_modular_service_callto build requests, set headers, and invoke the modular service client for payment method listing.Imports and code organization:
Additional Changes
Motivation and Context
How did you test it?
Request
Response
Checklist
cargo +nightly fmt --allcargo clippy