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(grpc): send x-tenant-id and x-request-id in grpc headers #6904

Merged
merged 5 commits into from
Dec 22, 2024

Conversation

Chethan-rao
Copy link
Contributor

@Chethan-rao Chethan-rao commented Dec 19, 2024

Type of Change

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

Description

This PR adds support for sending the x-tenant-id and x-request-id in the grpc headers

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 and mca (any connector)
  2. Toggle dynamic routing
curl --location --request POST 'http://localhost:8080/account/merchant_1734609410/business_profile/pro_gPTjn9jLm0CxI8ZD1omL/dynamic_routing/success_based/toggle?enable=metrics' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_K70Wr6zqJLbPECg8eEXrnZ43TW41JNUuXYHzRB50geiG0lViLExjxNUld6sgdNd0' \
--data ''
  1. Create a payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_K70Wr6zqJLbPECg8eEXrnZ43TW41JNUuXYHzRB50geiG0lViLExjxNUld6sgdNd0' \
--data '{
    "amount": 6540,
    "authentication_type": "no_three_ds",
    "confirm": true,
    "currency": "USD",
    "customer_acceptance": {
        "acceptance_type": "online"
    },
    "customer_id": "cus_uYakn3OQTUtAgetLDOE1",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_cvc": "123",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_number": "4242424242424242"
        }
    }
}'

Check the grafana dashboard with app = dynamo label in loki. Logs should have x-tenant-id and x-request-id in the headers.

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 S-waiting-on-review Status: This PR has been implemented and needs to be reviewed C-refactor Category: Refactor labels Dec 19, 2024
@Chethan-rao Chethan-rao self-assigned this Dec 19, 2024
@Chethan-rao Chethan-rao requested review from a team as code owners December 19, 2024 16:09
Copy link

semanticdiff-com bot commented Dec 19, 2024

@Chethan-rao Chethan-rao linked an issue Dec 19, 2024 that may be closed by this pull request
@Chethan-rao Chethan-rao changed the title refactor(grpc): send tenant-id and request-id in grpc headers refactor(grpc): send x-tenant-id and x-request-id in grpc headers Dec 19, 2024
SanchithHegde
SanchithHegde previously approved these changes Dec 20, 2024
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Dec 22, 2024
Merged via the queue into main with commit dc0a92d Dec 22, 2024
17 of 19 checks passed
@Gnanasundari24 Gnanasundari24 deleted the add-grpc-headers branch December 22, 2024 18:11
pixincreate added a commit that referenced this pull request Dec 23, 2024
…ete-pm

* 'main' of github.com:juspay/hyperswitch:
  chore(version): 2024.12.23.0
  feat(connector): [JPMORGAN] add Payment flows for cards (#6668)
  refactor(grpc): send `x-tenant-id` and `x-request-id` in grpc headers (#6904)
  feat(payment_methods_v2): Added Ephemeral auth for v2 (#6813)
  chore(cypress): payout - fix test cases for adyenplatform bank (#6887)
  refactor(connector): [Airwallex] add device_data in payment request (#6881)
  feat(router): add db interface for `/relay` (#6879)
  feat(payments_v2): implement payments capture v2 (#6722)
  feat(router): add /relay endpoint (#6870)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-refactor Category: Refactor S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] send tenant-id and request-id in grpc headers
4 participants