Skip to content

Conversation

harsh-sharma-juspay
Copy link
Contributor

@harsh-sharma-juspay harsh-sharma-juspay commented Jan 10, 2024

Type of Change

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

Description

adding GET api for query to fetch outgoing webhook events log by specified filters
Filter:
payment_id: String
event_id: Option<String>
refund_id: Option<String>
dispute_id: Option<String>
mandate_id: Option<String>
payment_method_id: Option<String>
attempt_id: Option<String>

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?

Api Endpoint: http://localhost:8080/analytics/v1/outgoing_webhook_event_logs
curl attached below with sample response tested on local machine

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

@harsh-sharma-juspay harsh-sharma-juspay requested a review from a team as a code owner January 10, 2024 11:16
@harsh-sharma-juspay harsh-sharma-juspay self-assigned this Jan 10, 2024
@harsh-sharma-juspay harsh-sharma-juspay linked an issue Jan 10, 2024 that may be closed by this pull request
@harsh-sharma-juspay
Copy link
Contributor Author

harsh-sharma-juspay commented Jan 10, 2024

Curl:

curl --location 'http://localhost:8080/analytics/v1/outgoing_webhook_event_logs?payment_id=pay_7Ipa9i5nyphFOqA5BGA1' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.5' \
--header 'Accept-Encoding: gzip, deflate, br' \
--header 'Referer: https://app.hyperswitch.io/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZTE4ZjJlMjMtMWZlOC00OTIyLTllNGQtODI4MTNjYmNhMmJiIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzAyNjQxMjUyIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTcwNTA3MDY4NSwib3JnX2lkIjoib3JnXzZNTTNMcWFJdGJvVFhIdXhHaDFDIn0.gPoeiQinucoo7lEOG-u68lDM_H9zI_T4LCTQFWAVCSk' \
--header 'api-key: hyperswitch' \
--header 'Origin: https://app.hyperswitch.io' \
--header 'Connection: keep-alive' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'TE: trailers'

@harsh-sharma-juspay
Copy link
Contributor Author

sample Response:

[
    {
        "merchant_id": "merchant_1702641252",
        "event_id": "pay_7Ipa9i5nyphFOqA5BGA1_payment_succeeded",
        "event_type": "payment_succeeded",
        "outgoing_webhook_event_type": "payment",
        "payment_id": "pay_7Ipa9i5nyphFOqA5BGA1",
        "refund_id": null,
        "attempt_id": null,
        "dispute_id": null,
        "payment_method_id": null,
        "mandate_id": null,
        "content": "{\"payment_id\":\"pay_7Ipa9i5nyphFOqA5BGA1\",\"merchant_id\":\"merchant_1702641252\",\"status\":\"succeeded\",\"amount\":6540,\"amount_capturable\":0,\"amount_received\":6540,\"connector\":\"stripe\",\"client_secret\":\"*** alloc::string::String ***\",\"created\":\"2024-01-05T07:30:54.728Z\",\"currency\":\"USD\",\"customer_id\":\"StripeCustomer\",\"description\":\"Its my first payment request\",\"refunds\":null,\"disputes\":null,\"mandate_id\":null,\"mandate_data\":null,\"setup_future_usage\":null,\"off_session\":null,\"capture_on\":null,\"capture_method\":\"automatic\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"last4\":\"4242\",\"card_type\":null,\"card_network\":null,\"card_issuer\":null,\"card_issuing_country\":null,\"card_isin\":\"424242\",\"card_exp_month\":\"*** alloc::string::String ***\",\"card_exp_year\":\"*** alloc::string::String ***\",\"card_holder_name\":\"*** alloc::string::String ***\"}},\"payment_token\":null,\"shipping\":{\"address\":{\"city\":\"San Fransico\",\"country\":\"US\",\"line1\":\"*** alloc::string::String ***\",\"line2\":\"*** alloc::string::String ***\",\"line3\":\"*** alloc::string::String ***\",\"zip\":\"*** alloc::string::String ***\",\"state\":\"*** alloc::string::String ***\",\"first_name\":\"*** alloc::string::String ***\",\"last_name\":\"*** alloc::string::String ***\"},\"phone\":{\"number\":\"*** alloc::string::String ***\",\"country_code\":\"+91\"}},\"billing\":{\"address\":{\"city\":\"San Fransico\",\"country\":\"US\",\"line1\":\"*** alloc::string::String ***\",\"line2\":\"*** alloc::string::String ***\",\"line3\":\"*** alloc::string::String ***\",\"zip\":\"*** alloc::string::String ***\",\"state\":\"*** alloc::string::String ***\",\"first_name\":\"*** alloc::string::String ***\",\"last_name\":\"*** alloc::string::String ***\"},\"phone\":{\"number\":\"*** alloc::string::String ***\",\"country_code\":\"+91\"}},\"order_details\":null,\"email\":\"*****@example.com\",\"name\":\"*** alloc::string::String ***\",\"phone\":\"*** alloc::string::String ***\",\"return_url\":\"https://google.com/\",\"authentication_type\":\"no_three_ds\",\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"next_action\":null,\"cancellation_reason\":null,\"error_code\":null,\"error_message\":null,\"unified_code\":null,\"unified_message\":null,\"payment_experience\":null,\"payment_method_type\":\"credit\",\"connector_label\":null,\"business_country\":null,\"business_label\":\"default\",\"business_sub_label\":null,\"allowed_payment_method_types\":null,\"ephemeral_key\":{\"customer_id\":\"StripeCustomer\",\"created_at\":1704439854,\"expires\":1704443454,\"secret\":\"epk_58eb2fb1951d440e927f4740a7a00ce2\"},\"manual_retry_allowed\":false,\"connector_transaction_id\":\"pi_3OV7rnD5R7gDAGff0JmWCZNC\",\"frm_message\":null,\"metadata\":\"*** serde_json::value::Value ***\",\"connector_metadata\":null,\"feature_metadata\":null,\"reference_id\":\"pi_3OV7rnD5R7gDAGff0JmWCZNC\",\"payment_link\":null,\"profile_id\":\"pro_dJTN6uGsYIuKeeG9IsgV\",\"surcharge_details\":null,\"attempt_count\":1,\"merchant_decision\":null,\"merchant_connector_id\":\"mca_FmLwc8mWoZR22H1nt4Ce\",\"incremental_authorization_allowed\":null,\"authorization_count\":null,\"incremental_authorizations\":null}",
        "is_error": false,
        "error": null,
        "created_at_timestamp": "2024-01-05T07:30:57.638Z"
    }
]

Copy link
Contributor

@lsampras lsampras left a comment

Choose a reason for hiding this comment

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

minor nit

ivor11
ivor11 previously approved these changes Jan 11, 2024
lsampras
lsampras previously approved these changes Jan 11, 2024
ivor11
ivor11 previously approved these changes Jan 11, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Jan 11, 2024
Merged via the queue into main with commit 54d44be Jan 11, 2024
@likhinbopanna likhinbopanna deleted the outgoing_webhook_audit_query branch January 11, 2024 13:25
pixincreate added a commit that referenced this pull request Jan 12, 2024
…-router

* 'main' of github.com:juspay/hyperswitch: (84 commits)
  chore(config): add merchant_secret config for webhooks for  cashtocode and volt in wasm dashboard (#3333)
  chore(version): 2024.01.12.0
  fix: update amount_capturable based on intent_status and payment flow (#3278)
  feat: add support for card extended bin in payment attempt (#3312)
  feat(connector): [cybersource] Implement 3DS flow for cards (#3290)
  chore: remove connector auth TOML files from `.gitignore` and `.dockerignore` (#3330)
  fix(refund): add merchant_connector_id in refund (#3303)
  feat(connector): [BOA/CYB] Store AVS response in connector_metadata (#3271)
  feat(outgoingwebhookevent): adding api for query to fetch outgoing webhook events log (#3310)
  feat(router): payment_method block (#3056)
  feat(connector): [Volt] Add support for refund webhooks  (#3326)
  feat(users): invite user without email (#3328)
  feat(euclid_wasm): config changes for NMI (#3329)
  refactor(router): restricted list payment method Customer to api-key based (#3100)
  feat(connector): [BOA/Cyb] Include merchant metadata in capture and void requests (#3308)
  fix(router): add config to avoid connector tokenization for `apple pay` `simplified flow` (#3234)
  refactor(router): flagged order_details validation to skip validation (#3116)
  fix(core): surcharge with saved card failure (#3318)
  feat(payment_link): Added sdk layout option payment link (#3207)
  chore(version): 2024.01.11.0
  ...
pixincreate added a commit that referenced this pull request Jan 13, 2024
* 'main' of github.com:juspay/hyperswitch: (22 commits)
  chore(version): 2024.01.12.1
  chore: add api reference for blocklist (#3336)
  chore(config): add merchant_secret config for webhooks for  cashtocode and volt in wasm dashboard (#3333)
  chore(version): 2024.01.12.0
  fix: update amount_capturable based on intent_status and payment flow (#3278)
  feat: add support for card extended bin in payment attempt (#3312)
  feat(connector): [cybersource] Implement 3DS flow for cards (#3290)
  chore: remove connector auth TOML files from `.gitignore` and `.dockerignore` (#3330)
  fix(refund): add merchant_connector_id in refund (#3303)
  feat(connector): [BOA/CYB] Store AVS response in connector_metadata (#3271)
  feat(outgoingwebhookevent): adding api for query to fetch outgoing webhook events log (#3310)
  feat(router): payment_method block (#3056)
  feat(connector): [Volt] Add support for refund webhooks  (#3326)
  feat(users): invite user without email (#3328)
  feat(euclid_wasm): config changes for NMI (#3329)
  refactor(router): restricted list payment method Customer to api-key based (#3100)
  feat(connector): [BOA/Cyb] Include merchant metadata in capture and void requests (#3308)
  fix(router): add config to avoid connector tokenization for `apple pay` `simplified flow` (#3234)
  refactor(router): flagged order_details validation to skip validation (#3116)
  fix(core): surcharge with saved card failure (#3318)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

audit trail - add webhook events
6 participants