Skip to content

Conversation

@prasunna09
Copy link
Contributor

@prasunna09 prasunna09 commented Dec 10, 2025

Type of Change

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

Description

Add volatile payment method id support in proxy to fetch payment method object from Redis(volatile storage) and process the request.

this volatile payment method id is generate during guest checkout tokenization in payment method service.

changes made-

  • converted domain model to diesel model of payment method when storing in redis.
  • used, encrypt service to encrypt and decrypt the data stored
  • while converting to storage model, the temp customer id is generated since customer id is mandatory in diesel model

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?

Screenshot 2025-12-28 at 9 17 58 PM payment method create - ``` curl --location 'http://localhost:8080/v2/payment-methods' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-Profile-Id: pro_pKQdFzRh288nIJx2Wlsr' \ --header 'Authorization: api-key=dev_1SRojWWY0S26DlYl0ddumReGAqRKPS6GOFM6HGdyYed2kwomdm0K4FkqwgGgWer1' \ --header 'api-key: dev_1SRojWWY0S26DlYl0ddumReGAqRKPS6GOFM6HGdyYed2kwomdm0K4FkqwgGgWer1' \ --data '{
"payment_method_type": "card",
"payment_method_subtype": "credit",
"payment_method_data": {
    "card": {
        "card_number": "5555 3412 4444 1115",
        "card_exp_month": "07",
        "card_exp_year": "2030",
        "card_holder_name": "joseph Doe"
    }
},
"storage_type": "volatile"

}'

proxy api - 

curl --location 'http://localhost:8080/v2/proxy'
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header 'X-Profile-Id: pro_pKQdFzRh288nIJx2Wlsr'
--header 'Authorization: api-key=api key'
--data '{
"request_body": {
"source": {
"type": "card",
"number": "{{$card_number}}",
"expiry_month": "{{$card_exp_month}}",
"expiry_year": "{{$card_exp_year}}",
"billing_address": {
"address_line1": "123 High St.",
"address_line2": "Flat 456",
"city": "London",
"state": "GB",
"zip": "SW1A 1AA",
"country": "GB"
}
},
"processing_channel_id": "processing_channel_id",
"amount": 6540,
"currency": "USD",
"payment_type": "Regular",
"reference": "ORD-5023-4E89",
"description": "Set of 3 masks",
"capture": true,
"capture_on": "2019-09-10T10:11:12Z",
"billing_descriptor": {
"name": "Withdrawal",
"city": "London"
},
"shipping": {
"address": {
"address_line1": "Checkout.com",
"address_line2": "Flat 456",
"city": "London",
"state": "GB",
"zip": "SW1A 1AA",
"country": "GB"
},
"phone": {
"country_code": "+1",
"number": "415 555 2671"
}
}
},
"destination_url": "https://api.sandbox.checkout.com/payments",
"headers": {
"Content-Type": "application/json",
"Authorization": "api key"
},
"token": "12345_pm_019b659a23f77531af02232f9c4098b9",
"token_type": "volatile_payment_method_id",
"method": "POST"

}'

data stored in redis has been fetched and decrypted in proxy flow
<img width="1728" height="100" alt="image" src="https://github.com/user-attachments/assets/c12ae8a3-3a90-4f8a-ac3b-27299ae67418" />

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [ ] 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 and others added 30 commits November 18, 2025 14:31
…perswitch into add-guest-checkout-api-changes
…perswitch into add-guest-checkout-api-changes
…perswitch into add-guest-checkout-api-changes
…perswitch into add-guest-checkout-api-changes
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 0% with 97 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@d9226b2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
crates/router/src/core/proxy/utils.rs 0.00% 93 Missing ⚠️
...es/router/src/core/payment_methods/transformers.rs 0.00% 2 Missing ⚠️
crates/router/src/core/proxy.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10597   +/-   ##
=======================================
  Coverage        ?    6.38%           
=======================================
  Files           ?     1268           
  Lines           ?   318754           
  Branches        ?        0           
=======================================
  Hits            ?    20358           
  Misses          ?   298396           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ShankarSinghC
ShankarSinghC previously approved these changes Dec 15, 2025
Sakilmostak
Sakilmostak previously approved these changes Dec 16, 2025
Base automatically changed from guest-checkout-core-changes to main December 17, 2025 15:47
@likhinbopanna likhinbopanna dismissed stale reviews from Sakilmostak and ShankarSinghC December 17, 2025 15:47

The base branch was changed.

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Dec 18, 2025
ShankarSinghC
ShankarSinghC previously approved these changes Dec 22, 2025
Sakilmostak
Sakilmostak previously approved these changes Dec 22, 2025
@prasunna09 prasunna09 dismissed stale reviews from Sakilmostak and ShankarSinghC via b7ae83f December 23, 2025 09:00
@prasunna09 prasunna09 changed the title feat(payment-methods): Add volatile payment method id support in proxy feat(payment-methods): Add volatile payment method id support in proxy v2 Dec 28, 2025
@prasunna09 prasunna09 self-assigned this Dec 28, 2025
@prasunna09 prasunna09 requested a review from a team as a code owner December 28, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M-api-contract-changes Metadata: This PR involves API contract changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants