-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(events): Add payment metadata to hyperswitch-payment-intent-events #5170
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
Conversation
@tsdk02 why do we need to remove the masking for serde json value? |
We wanted to use the metadata field for global_search as well for generating events, we're removing the constraint on metadata being pii sensitive since it is being sent out of the code for global search |
2087869
@@ -664,7 +664,7 @@ host = "https://localhost:9200" | |||
[opensearch.auth] | |||
auth = "basic" | |||
username = "admin" | |||
password = "admin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you revert this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is a required change for running opensearch locally.
@@ -382,6 +382,7 @@ services: | |||
environment: | |||
- "discovery.type=single-node" | |||
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=0penS3arc# | |||
- LOG_LEVEL=DEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this intended change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as it helps in better logging and debugging
@@ -453,7 +453,7 @@ pub struct PaymentsRequest { | |||
|
|||
/// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object. | |||
#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)] | |||
pub metadata: Option<pii::SecretSerdeValue>, | |||
pub metadata: Option<serde_json::Value>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd intentionally kept this a Secret
since this was a field provided by the merchant, and to not expose possible sensitive information in application logs. If we're now removing the Secret
, we may have to consider masking possible sensitive information to our best efforts, both in application logs and in ClickHouse events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding an issue for this #5227 .
we need to add consistency for this,
either by masking/hashing/encrypting it everywhere and deciding on a proper way for this
…ify-cypress * 'main' of github.com:juspay/hyperswitch: chore(version): 2024.07.08.0 fix(connector): [adyen] remove browser info for mit and [paypal] add refund key in headers (#5225) chore(version): 2024.07.06.0 feat(router): Pass the shipping email whenever the billing details are included in the session token response (#5228) fix(cypress): fix metadata missing while creating connector if not in auth (#5215) refactor: fix unit and documentation tests (#4754) feat(events): add hashed customer_email and feature_metadata (#5220) feat(events): Add payment metadata to hyperswitch-payment-intent-events (#5170) fix(analytics): using HashSet to represent the returned metrics (#5179) feat(core): billing_details inclusion in Payment Intent (#5090) feat(router): pass fields to indicate if the customer address details to be connector from wallets (#5210) fix(refunds): Add aliases on refund status for backwards compatibility (#5216) Feat(connector): [BRAINTREE] Implement Card Mandates (#5204)
…ts (#5170) Co-authored-by: Narayan Bhat <[email protected]> Co-authored-by: Sampras Lopes <[email protected]> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Type of Change
Description
metadata
is marked aspii::SecretSerdeValue
, now changed it toserde_json::Value
to remove the masking.metadata
field forhyperswitch-payment-intent-events
(type - String).Additional Changes
Motivation and Context
Adding the metadata to the payment-intent-event helps in providing better information about the event.
How did you test it?
Make a normal payment through Postman by following the steps:
You should now be able to see the



metadata
field in hyperswitch-payment-intent-events when viewed in kafka-ui.And can also be searched using global search in the dashboard.
Metadata is of type - String

Checklist
cargo +nightly fmt --all
cargo clippy