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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AmeyWale
Copy link

@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
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
1 participant