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: Customer email and browser Information #7034

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

AmeyWale
Copy link
Contributor

@AmeyWale AmeyWale commented Jan 13, 2025

Type of Change

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

Description

Refactored customer email and browser information in router data

Motivation and Context

This refactoring provides data to the connector integrations, so that it can be used in connector calls.

How did you test it?

  • Confirm Intent API Call for trustpay connector.
curl --location 'http://localhost:8080/v2/payments/12345_pay_01945e865f697553bbf0eb847611cfcd/confirm-intent' \
--header 'x-client-secret: 1secret-client-secret' \
--header 'x-profile-id: pro_id' \
--header 'Content-Type: application/json' \
--header 'api-key: api-key' \
--data '{
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "01",
            "card_exp_year": "25",
            "card_holder_name": "John Doe",
            "card_cvc": "100"
        }
    },
    "payment_method_type": "card",
    "payment_method_subtype": "credit",
    "browser_info": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "127.0.0.1"
    }
}'
  • Response from above call
{
    "id": "12345_pay_01945f254dc27802a54be556c0acab7a",
    "status": "failed",
    "amount": {
        "order_amount": 100,
        "currency": "USD",
        "shipping_cost": null,
        "order_tax_amount": null,
        "external_tax_calculation": "skip",
        "surcharge_calculation": "skip",
        "surcharge_amount": null,
        "tax_on_surcharge": null,
        "net_amount": 100,
        "amount_to_capture": null,
        "amount_capturable": 0,
        "amount_captured": null
    },
    "customer_id": "12345_cus_01945f252cb37e20a6fb6105be0c976f",
    "connector": "trustpay",
    "client_secret": "12345_pay_01945f254dc27802a54be556c0acab7a_secret_01945f254ddd7cb385275b8d620bbb24",
    "created": "2025-01-13T10:11:07.869Z",
    "payment_method_data": {
        "billing": null
    },
    "payment_method_type": "card",
    "payment_method_subtype": "credit",
    "next_action": null,
    "connector_transaction_id": null,
    "connector_reference_id": null,
    "merchant_connector_id": "mca_lZ6moeYo6Ce2vdD01f7s",
    "browser_info": null,
    "error": {
        "code": "4",
        "message": "The field Reference must be a string with a maximum length of 35.",
        "unified_code": null,
        "unified_message": null
    }
}
  • This refactoring fixes availability of email and browser information fields for trustpay.

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

@AmeyWale AmeyWale requested review from a team as code owners January 13, 2025 10:01
Copy link

semanticdiff-com bot commented Jan 13, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_domain_models/src/router_request_types.rs  0% smaller
  crates/router/src/core/payments/transformers.rs  0% smaller

@AmeyWale AmeyWale linked an issue Jan 13, 2025 that may be closed by this pull request
@AmeyWale AmeyWale self-assigned this Jan 13, 2025
@likhinbopanna likhinbopanna added this pull request to the merge queue Jan 21, 2025
Merged via the queue into main with commit d35a922 Jan 21, 2025
40 of 43 checks passed
@likhinbopanna likhinbopanna deleted the refactor-email-and-browser-info branch January 21, 2025 08:49
pixincreate added a commit that referenced this pull request Jan 24, 2025
…d-memory-cache

* 'main' of github.com:juspay/hyperswitch: (38 commits)
  fix(cypress): uncaught exceptions thrown by `hyperswitch.io` (#7092)
  ci(workflows): Add code coverage reporting for v2 (#6884)
  chore(version): 2025.01.23.0
  refactor: [CYBERSOURCE, BANKOFAMERICA, WELLSFARGO] Move code to crate hyperswitch_connectors (#6908)
  Documentation edits made through Mintlify web editor
  chore: enable 128-column-tables feature for diesel crate (#6857)
  feat(connector): [ADYEN ] Consume transaction id for PaymentsPreProcessing error (#7061)
  chore(version): 2025.01.22.0
  feat(routing): Integrate global success rates (#6950)
  feat(email): Add mailhog by default in docker-compose for local smtp server (#6869)
  refactor: check allowed payment method types in enabled options (#7019)
  feat(router): add payment method-specific features to connector feature list (#6963)
  Refactor: Customer email and browser Information (#7034)
  feat(connectors): fiuu,novalnet,worldpay - extend NTI flows (#6946)
  fix(cypress): address cybersource redirection inconsistency (#7057)
  chore(version): 2025.01.21.0
  refactor(payment-link): use shouldRemoveBeforeUnloadEvents flag for handling removal of beforeunload events through SDK (#7072)
  refactor(router): refactor ctp flow to fetch mca_id and get the connector creds instead of connector_name (#6859)
  chore(version): 2025.01.20.0
  fix(relay): populate connector metadata in the refunds flow (#7045)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor(RouterData): Add customer email and brower Information
4 participants