Skip to content

Conversation

sahkal
Copy link
Contributor

@sahkal sahkal commented Mar 4, 2024

Type of Change

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

Description

added incoming header request logs

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

closes #4182 tps://github.com/juspay/hyperswitch-cloud/issues/4182

How did you test it?

Try Payments create and look for BEGIN REQUEST tag in logs, that log should have headers logged along with whitelisted keys as unmasked.

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_34WfMZpEPjMWHfBnwVMZIIu0hy7GhCR7vkfvZflWZ3tjww8pR6Yoloj4VeSQHwZZ' \
--data-raw '{
    "amount": 250,
    "currency": "USD",
    "confirm": true,
    "amount_to_capture": 250,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "StripeCustomer",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://google.com",
    "setup_future_usage": "on_session",
    "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"
    },
    "routing": {
        "type": "single",
        "data": "nmi"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4000000000002503",
            "card_exp_month": "08",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "999"
        }
    },
    "billing": {
        "address": { 
            "zip": "94122",
            "first_name": "sahkal",
            "last_name": "poddar"
        }
    }
}

'

Screenshot 2024-03-04 at 5 46 19 PM

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
  • I added a CHANGELOG entry if applicable

@sahkal sahkal added A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Mar 4, 2024
@sahkal sahkal self-assigned this Mar 4, 2024
@sahkal sahkal requested a review from a team as a code owner March 4, 2024 11:47
Narayanbhat166
Narayanbhat166 previously approved these changes Mar 4, 2024
@sahkal sahkal requested a review from Sakilmostak March 4, 2024 14:44
Sakilmostak
Sakilmostak previously approved these changes Mar 4, 2024
@sahkal sahkal dismissed stale reviews from Sakilmostak and Narayanbhat166 via 6e1a4d7 March 4, 2024 19:06
@sahkal sahkal requested a review from SanchithHegde March 4, 2024 19:28
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Mar 5, 2024
Merged via the queue into main with commit 050df50 Mar 5, 2024
@Gnanasundari24 Gnanasundari24 deleted the add-logs-incoming-request branch March 5, 2024 09:43
@pixincreate pixincreate removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants