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(router): Validate payment_method_type in payments request against given payment method data for non-card flows #1236

Merged
merged 77 commits into from
Jul 27, 2023

Conversation

kritikmodi
Copy link
Contributor

@kritikmodi kritikmodi commented May 23, 2023

Type of Change

  • Bugfix
  • New feature

Description

Added the following checks for non-card flows :

  1. Check if payment_method_type is specified.
  2. Check if the specified payment_method_type corresponds to the parent payment_method.
  3. Check if the specified payment_method_data corresponds to the parent payment_method.

Motivation and Context

This PR resolves this issue.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed submitted code

pixincreate and others added 30 commits April 19, 2023 22:05
@sai-harsha-vardhan
Copy link
Contributor

@kritikmodi Please add the tests done locally

@kritikmodi
Copy link
Contributor Author

@kritikmodi Please add the tests done locally

Here are the local tests using Postman :

  • Scenario 1 : payment_method_type not passed :
Screen Shot 2023-07-26 at 7 22 30 PM
  • Scenario 2 : payment_method_data not passed :
Screen Shot 2023-07-26 at 7 22 40 PM
  • Scenario 3 : payment_method_type doesn't correspond with the given payment_method :
Screen Shot 2023-07-26 at 7 34 10 PM
  • Scenario 4 : payment_method_data doesn't correspond with the given payment_method :
Screen Shot 2023-07-26 at 7 23 04 PM
  • Scenario 5 : Both payment_method_type and payment_method_data are not passed :
Screen Shot 2023-07-26 at 7 34 20 PM

@SanchithHegde SanchithHegde added this pull request to the merge queue Jul 27, 2023
Merged via the queue into main with commit 7607b6b Jul 27, 2023
@SanchithHegde SanchithHegde deleted the issue1102-Kritik_Modi branch July 27, 2023 05:35
@SanchithHegde SanchithHegde removed P-high Priority: High low-risk label to track PRs which might have less impact on hyperswitch after merge ageing >2weeks Created > 2 weeks labels Jul 27, 2023
@kritikmodi kritikmodi changed the title feat(router): Validate payment method type in payments request against given payment method data for non-card flows feat(router): Validate payment_method_type in payments request against given payment method data for non-card flows Sep 5, 2023
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-bug Category: Bug M-api-contract-changes Metadata: This PR involves API contract changes
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

[BUG] Validate payment method type in payments request against given payment method data for non-card flows
9 participants