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(router): add accept-language from request headers into browser-info #7074

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sai-harsha-vardhan
Copy link
Contributor

@sai-harsha-vardhan sai-harsha-vardhan commented Jan 20, 2025

Type of Change

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

Description

  • add accept-language from request headers into browser-info
  • propagate the value to netcetera

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?

Tested Manually
Perform a sanity external authentication payment through Netcetera
CURL

curl --location '{{baseURL}}/payments/{{PAYMENT_ID}}/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{API_KEY}}' \
--data '{
    "client_secret": "pay_ushmApvG7K7IGxZ0qCmy_secret_8xIk7n11c5p5JSQSG0Vp",
    "device_channel": "BRW",
    "threeds_method_comp_ind": "Y"
}'

Raw connector Request
image

Browser Info in Database
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

@sai-harsha-vardhan sai-harsha-vardhan added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Jan 20, 2025
@sai-harsha-vardhan sai-harsha-vardhan self-assigned this Jan 20, 2025
@sai-harsha-vardhan sai-harsha-vardhan requested review from a team as code owners January 20, 2025 10:22
Copy link

semanticdiff-com bot commented Jan 20, 2025

srujanchikke
srujanchikke previously approved these changes Jan 20, 2025
Narayanbhat166
Narayanbhat166 previously approved these changes Jan 21, 2025
@@ -1022,6 +1022,7 @@ impl Default for BrowserInfoType {
device_model: Some("Apple IPHONE 7".to_string()),
os_type: Some("IOS or ANDROID".to_string()),
os_version: Some("IOS 14.5".to_string()),
accept_language: None,
Copy link
Contributor

@ShankarSinghC ShankarSinghC Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@@ -52,6 +52,7 @@ fn get_default_browser_info() -> BrowserInformation {
os_type: None,
os_version: None,
device_model: None,
accept_language: None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Since we are considering "en" as the default language. You can add the same here.

srujanchikke
srujanchikke previously approved these changes Jan 21, 2025
ShankarSinghC
ShankarSinghC previously approved these changes Jan 21, 2025
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration 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.

4 participants