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: add an api for retrieving the extended card info from redis #4484

Merged
merged 1 commit into from
May 1, 2024

Conversation

Chethan-rao
Copy link
Contributor

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

Type of Change

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

Description

This PR adds a new endpoint to retrieve the extended card info (encrypted) stored in redis under a given merchant and payment.

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?

This PR cannot be tested until #4482 goes in.
For local testing I manually set redis entry and tried to hit this newly added endpoint.

  1. Create merchant account and api key
  2. Create a payment
  3. Got the payment id and merchant id and set the redis entry
set merchant_1713971568_pay_1nrIoi2hRnzsy1V2cEv6_extended_card_info "eyJlbmMiOiJBMjU2R0NNIiwidHlwIjoiSldUIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.sTmCdgRVEz4hZKZ5VxQxq4Dt_V6v9O_96dIXy5F6lzdePOVQ2CwYJQeMhrsFjfk8kZrdOsfeOfFV1FVmxhWjREUvVBZKld5p47HDi4GAEDCX10HH9hIE3SD-IfU4D9riyE2MpIiWoB6xMVNxOvZSWAh2r_-UBgMzAoTAvz7ecmFJopRa8691up8H-Bc7DsVUxfAnEPef9bUIXd2Ej8vWR_XNyx9giPPwhYqYwtcsyyBnpnkyJW26Cc0J-zgbkT-6SPzTfpt_ALUons8nj3uQkmurpaQGdbBj9Zb_BOjK7ytngohnr68Z6ftb0-K41XYMrl11v1Rb-S_enQBstMsyVA.kh4VJ86tKDm5mwh9.WzF74jEuhZMQrYvNgl3e8Ll8YVMXwOizKdgbdBF0i6VWywXKPCIlwD150gtKo15u1_Xvo-151jTAp56E1w3vT2vOUyXWf96MTFytZR3VE4ClLB27AIu_4oUPJ5iG9IVLcMsUxEp4-OM0kNtrpbUY-Fyb3COwZ5AtZ2Fhx_CSiUp1ZdyvoP7XEfkwWgSGU2qW1s9P5VxsaKyFtva7nPo2trJw8-805P3Qtdm-27XvFYNKcTRYUJ9XBDn-cinbo-qrqe2XFQ5lh7fClhHK2H_hiJdk_WBq4iZKBK-XJpeDjCCNtiAVDGw.e2duyijt4Py7nmU-1PygSg"
  1. Hit the endpoint to retrieve the payload
curl --location 'http://localhost:8080/payments/pay_1nrIoi2hRnzsy1V2cEv6/extended_card_info' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_KM55eCA115eJaTBYK6Z8DYLwI6EghXzZDUb9M1RzE6Ji1jMEhs71C8c43ndOubXw' \
--data ''

image

  1. If another merchant tries to retrieve the same payload by passing same payment_id, throw 404
    image

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-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Apr 29, 2024
@Chethan-rao Chethan-rao added this to the April 2024 milestone Apr 29, 2024
@Chethan-rao Chethan-rao self-assigned this Apr 29, 2024
@Chethan-rao Chethan-rao requested review from a team as code owners April 29, 2024 09:54
@Chethan-rao Chethan-rao linked an issue Apr 29, 2024 that may be closed by this pull request
@Chethan-rao Chethan-rao force-pushed the retrieve-encrypted-card-info branch 2 times, most recently from 4b2119a to c7b597c Compare April 29, 2024 15:41
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue May 1, 2024
Merged via the queue into main with commit dfa4b50 May 1, 2024
10 of 12 checks passed
@Gnanasundari24 Gnanasundari24 deleted the retrieve-encrypted-card-info branch May 1, 2024 10:51
@Chethan-rao Chethan-rao added the M-api-contract-changes Metadata: This PR involves API contract changes label May 1, 2024
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extended_card_info API to retrieve encrypted card PAN
6 participants