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

refactor(payment_methods): store card_network in locker #4425

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

Chethan-rao
Copy link
Contributor

@Chethan-rao Chethan-rao commented Apr 22, 2024

Type of Change

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

Description

We have card_brand field in locker which is None currently for all cards. When a card_network is sent in the request, we map it to card_brand and store it in locker.

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. Store a payment method in locker with card_network field in request.
curl --location 'http://localhost:8080/payment_methods' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: abc' \
--data '{
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_issuer": "Visa",
    "card": {
        "card_number": "4111111111111111",
        "card_exp_month": "04",
        "card_exp_year": "25",
        "card_holder_name": "John",
        "card_network": "Visa"
    },
    "customer_id": "cus_spLo0JPwK16PTtBuIk1b",
    "metadata": {
        "city": "NY",
        "unit": "245"
    }
}'
  1. Retrieve stored card with list_customer_payment_methods and verify whether card_network is populated.

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
  • I added a CHANGELOG entry if applicable

@Chethan-rao Chethan-rao added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed A-payment-methods Area: Payment Methods C-refactor Category: Refactor labels Apr 22, 2024
@Chethan-rao Chethan-rao added this to the April 2024 milestone Apr 22, 2024
@Chethan-rao Chethan-rao self-assigned this Apr 22, 2024
@Chethan-rao Chethan-rao requested a review from a team as a code owner April 22, 2024 11:57
@Chethan-rao Chethan-rao linked an issue Apr 22, 2024 that may be closed by this pull request
@Chethan-rao Chethan-rao changed the title refactor(payment_methods): store card_network in locker refactor(payment_methods): store card_network in locker Apr 22, 2024
@pixincreate pixincreate removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Apr 25, 2024
@pixincreate pixincreate added this pull request to the merge queue Apr 25, 2024
Merged via the queue into main with commit 5b54d55 Apr 25, 2024
19 of 21 checks passed
@pixincreate pixincreate deleted the card-brand-updation branch April 25, 2024 10:36
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-refactor Category: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] store card_network in locker
4 participants