fix(customers): resolve unimplemented payment method deletion in v2#11192
Open
GauravRawat369 wants to merge 8 commits intomainfrom
Open
fix(customers): resolve unimplemented payment method deletion in v2#11192GauravRawat369 wants to merge 8 commits intomainfrom
GauravRawat369 wants to merge 8 commits intomainfrom
Conversation
Changed Files
|
ShankarSinghC
previously approved these changes
Feb 13, 2026
…nd profile parameters
crates/router/src/core/customers.rs
Outdated
Comment on lines
763
to
769
| Box::pin(delete_payment_method( | ||
| state.clone(), | ||
| pm_id, | ||
| platform.clone(), | ||
| profile.clone(), | ||
| )) | ||
| .await |
Contributor
There was a problem hiding this comment.
Instead of calling the entire delete_payment_method, for now we can extract the required logic from delete_payment_method_core into a common function and invoke it from both here and delete_payment_method_core.
This way, we can avoid the unnecessary payment method and customer-related database calls made by redact_customer_details_and_generate_response and delete_payment_method_core.
ShankarSinghC
approved these changes
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 updates the customer deletion flow to support a new v2 API, refactoring how customer payment methods are deleted and improving type safety and modularity. The main changes involve switching from a provider-based to a platform-based approach, updating trait definitions, and ensuring all associated payment methods are deleted using the new v2 payment method deletion logic.
Refactoring and API improvements:
delete_customerfunction signature and its usages to acceptplatformandprofileinstead ofprovider, aligning with the v2 API structure. [1] [2]CustomerDeleteBridgetrait, splitting it into v1 and v2 versions, with the v2 version acceptingplatformandprofilefor more flexible and accurate context handling. [1] [2]Payment method deletion enhancements:
delete_payment_methodfunction for each payment method, ensuring all payment methods are properly deleted during customer deletion in v2.PaymentMethodIdanddelete_payment_methodto support the new payment method deletion flow. [1] [2]Code organization:
v2feature flag, ensuring backward compatibility with the v1 API. [1] [2]The function calls
delete_card_by_locker_id()which just has todo!(), causing a panic.Additional Changes
Motivation and Context
How did you test it?
Customer Create Request & Response
res
Pm create with new created customer_id
res
Customer delete
res
Created 2 pm for a customer


vault entry
After customer deletion(removed from vault as well)
Checklist
cargo +nightly fmt --allcargo clippy