Skip to content

Conversation

Chethan-rao
Copy link
Contributor

@Chethan-rao Chethan-rao commented Jan 7, 2025

Type of Change

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

Description

#3953
We were not considering the status of payment method in above filtering logic

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?

  1. Create merchant_account, api_key, mca (with any wallet)
  2. Create a payment with wallet as payment method with authentication_type as three_ds. Retain the status of payment as processing
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_qVglrYUpCaoLCvnixZd3hX0ls7du5ZmaVMhZJNGt8ezEN4Axn8oU22i2gRz0OTqx' \
--data '{
    "amount": 6540,
    "confirm": true,
    "currency": "USD",
    "customer_acceptance": {
        "acceptance_type": "online"
    },
    "customer_id": "cus_kWEMsP0NufHyhHsBB1Ol",
    "profile_id": "pro_mjcaEelE0mjdp8ODpfkc",
    "authentication_type": "three_ds",
    "payment_method": "wallet",
    "payment_method_type": "apple_pay",
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "payment_data": "token",
                "payment_method": {
                    "display_name": "Visa 0326",
                    "network": "Mastercard",
                    "type": "debit"
                },
                "transaction_identifier": "55CC32D7BF7890B9064433F15B9F23F849CF84AFD01E4E65DD8ADE306300E9D8"
            }
        }
    }
}'
  1. Create another payment with confirm:false
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_qVglrYUpCaoLCvnixZd3hX0ls7du5ZmaVMhZJNGt8ezEN4Axn8oU22i2gRz0OTqx' \
--data '{
    "amount": 6540,
    "confirm": false,
    "currency": "USD",
    "customer_acceptance": {
        "acceptance_type": "online"
    },
    "customer_id": "cus_kWEMsP0NufHyhHsBB1Ol",
    "profile_id": "pro_mjcaEelE0mjdp8ODpfkc",
    "authentication_type": "three_ds"
}'
  1. list merchant pml. When the status of payment_method is inactive in db, the wallet should appear in the list
curl --location 'http://localhost:8080/account/payment_methods?client_secret=pay_Fvjj9zQjd2BA47M6qFJO_secret_gV3eKHcXxHT9PdA7fBbk' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_c079bd1ada67401fb98568ea6f6043bf' \
--data '' "

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

@Chethan-rao Chethan-rao added C-bug Category: Bug A-payment-methods Area: Payment Methods labels Jan 7, 2025
@Chethan-rao Chethan-rao self-assigned this Jan 7, 2025
@Chethan-rao Chethan-rao requested a review from a team as a code owner January 7, 2025 13:44
Copy link

semanticdiff-com bot commented Jan 7, 2025

Review changes with  SemanticDiff

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

@SanchithHegde SanchithHegde merged commit d2212cb into main Jan 7, 2025
24 of 27 checks passed
@SanchithHegde SanchithHegde deleted the fix_pm_wallet_list branch January 7, 2025 17:07
pixincreate added a commit to Ankesh2004/hyperswitch that referenced this pull request Jan 9, 2025
…r-verifyurl-in-redirection-handler

* 'main' of github.com:juspay/hyperswitch: (30 commits)
  test(cypress): add test for In Memory Cache (juspay#6961)
  chore(version): 2025.01.09.1
  fix(dummyconnector): add tenant id in dummyconnector requests (juspay#7008)
  chore(version): 2025.01.09.0
  fix(cypress): backup and restore sessions when using user apis (juspay#6978)
  feat(users): handle edge features for users in tenancy (juspay#6990)
  chore(dynamic-fields): [Worldpay] update dynamic fields for payments (juspay#7002)
  chore(version): 2025.01.08.0
  fix: consider status of payment method before filtering wallets in list pm (juspay#7004)
  feat(core): add columns unified error code and error message in refund table (juspay#6933)
  feat(connector): [Fiuu] Consume transaction id for error cases for Fiuu (juspay#6998)
  docs(cypress): update cypress documentation (juspay#6956)
  chore(version): 2025.01.07.0
  chore(keymanager): add tenant-id to keymanager requests (juspay#6968)
  ci(cypress): Add Session Token Testcases (juspay#6683)
  Ci(Cypress): Add PML test and Dynamic Fields Test for Novalnet (juspay#6544)
  chore(version): 2025.01.06.0
  ci(cypress): fix adyen sofort in cypress (juspay#6984)
  chore: add migrations for Currency type in DB (juspay#6980)
  chore(version): 2025.01.03.0
  ...
pixincreate added a commit that referenced this pull request Jan 9, 2025
…d-memory-cache

* 'main' of github.com:juspay/hyperswitch:
  test(cypress): add test for In Memory Cache (#6961)
  chore(version): 2025.01.09.1
  fix(dummyconnector): add tenant id in dummyconnector requests (#7008)
  chore(version): 2025.01.09.0
  fix(cypress): backup and restore sessions when using user apis (#6978)
  feat(users): handle edge features for users in tenancy (#6990)
  chore(dynamic-fields): [Worldpay] update dynamic fields for payments (#7002)
  chore(version): 2025.01.08.0
  fix: consider status of payment method before filtering wallets in list pm (#7004)
  feat(core): add columns unified error code and error message in refund table (#6933)
  feat(connector): [Fiuu] Consume transaction id for error cases for Fiuu (#6998)
  docs(cypress): update cypress documentation (#6956)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-payment-methods Area: Payment Methods C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FIX] consider status of payment method before filtering wallets in list pm
5 participants