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

fix(router): validate each field for migration request body #6525

Merged
merged 15 commits into from
Dec 6, 2024

Conversation

prasunna09
Copy link
Contributor

Type of Change

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

Description

#6300 has inconsistent response due to no validations for each field in migration api request body.

Additional Changes

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

Motivation and Context

How did you test it?

test case - test migration api with empty fields.
req -

curl --location 'http://localhost:8080/payment_methods/migrate' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data '{
    "merchant_id": "merchant_id",
    "card": {
        "card_number": "card_number",
        "card_exp_month": "12",
        "card_exp_year": "21",
        "card_holder_name": "joseph Doe"
    },
    "customer_id": "customer_id",
    "network_transaction_id": "",
    "payment_method": "card",
    "connector_mandate_details": {},
    "network_token": {
        "network_token_data": {
            "network_token_number": "  ",
            "network_token_exp_month": "12",
            "network_token_exp_year": "21"
        },
        "network_token_requestor_ref_id": ""
    }
}'
Screenshot 2024-11-11 at 11 43 58 AM

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

@prasunna09 prasunna09 added the C-bug Category: Bug label Nov 11, 2024
@prasunna09 prasunna09 self-assigned this Nov 11, 2024
@prasunna09 prasunna09 requested review from a team as code owners November 11, 2024 10:06
Copy link

semanticdiff-com bot commented Nov 11, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  crates/router/src/core/payment_methods/cards.rs  54% smaller

@prasunna09 prasunna09 linked an issue Nov 11, 2024 that may be closed by this pull request
@prasunna09 prasunna09 changed the base branch from main to add-support-for-nt-migration November 12, 2024 10:03
@prasunna09 prasunna09 changed the base branch from add-support-for-nt-migration to main November 12, 2024 10:04
jagan-jaya
jagan-jaya previously approved these changes Dec 3, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Dec 5, 2024
@likhinbopanna likhinbopanna removed this pull request from the merge queue due to a manual request Dec 5, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Dec 6, 2024
Merged via the queue into main with commit b5d3d49 Dec 6, 2024
16 of 18 checks passed
@likhinbopanna likhinbopanna deleted the validate-each-record-for-migration-api branch December 6, 2024 11:44
kashif-m pushed a commit that referenced this pull request Dec 12, 2024
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FIX] fix response for migration api
5 participants