feat(opensearch): add profile_id and organization_id to /search APIs#5705
Merged
Gnanasundari24 merged 18 commits intomainfrom Sep 11, 2024
Merged
feat(opensearch): add profile_id and organization_id to /search APIs#5705Gnanasundari24 merged 18 commits intomainfrom
Gnanasundari24 merged 18 commits intomainfrom
Conversation
|
Review changes with SemanticDiff. Analyzed 3 of 3 files. Overall, the semantic diff is 17% smaller than the GitHub diff.
|
…auth layer and constructing search_params
ThisIsMani
previously approved these changes
Sep 4, 2024
ThisIsMani
approved these changes
Sep 11, 2024
lsampras
approved these changes
Sep 11, 2024
pixincreate
added a commit
that referenced
this pull request
Sep 13, 2024
* 'main' of github.com:juspay/hyperswitch: (51 commits) feat(connector): [DEUTSCHEBANK] Integrate SEPA Payments (#5826) feat(payments_v2): payment intent diesel and domain models changes v2 (#5783) feat(connector): [Fiuu] ADD Wasm Configs (#5874) chore(version): 2024.09.13.0 refactor(core): Update shipping_cost and order_tax_amount to net_amount of payment_attempt (#5844) refactor: return optional request body from build_request_v2 in ConnectorIntegrationV2 trait (#5865) feat(refunds): Refunds aggregate api (#5795) refactor: handle redirections for iframed content (#5591) refactor(payment_links): Update API contract for dynamic transaction details and upgrade UI (#5849) fix(router): add payment_method check in `get_mandate_type` (#5828) fix(connector): [ZSL] compare consr_paid_amt with the total amount for identifying partial payments (#5873) feat(connector): [Novalnet] add Payment flows for cards (#5726) chore(version): 2024.09.12.0 fix(router): return `collect_billing_details_from_wallet_connector` if `always_collect_billing_details_from_wallet_connector ` is false in merchant payment method list (#5854) feat(opensearch): add profile_id and organization_id to /search APIs (#5705) build(deps): bump `sqlx` to `0.8.2` (#5859) refactor: Remove unwanted commented lines (#5851) feat(payments): add support for profile aggregates (#5845) Feat(connector): [Fiuu] Add DuitNow/FPX PaymentMethod (#5841) chore: remove Connectors enum dependency from ConnectorIntegrationV2 trait (#5840) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Global Search is currently being done through the
merchant_idauthentication.Enhancing the global search to search through new hierarchical structure of OrgLevel, MerchantLevel and ProfileLevel.
Structure of the enum used:
pub enum AuthInfo { OrgLevel { org_id: id_type::OrganizationId, }, MerchantLevel { org_id: id_type::OrganizationId, merchant_ids: Vec<id_type::MerchantId>, }, ProfileLevel { org_id: id_type::OrganizationId, merchant_id: id_type::MerchantId, profile_ids: Vec<id_type::ProfileId>, }, }Additional Changes
Motivation and Context
OrgLevel, MerchantLevel and ProfileLevel provide for enhanced analytics insights while using global search to the users
How did you test it?
Sample Query Structure

Hit the
/searchAPI (using query, filters and timeRange).[ { "count": 2, "index": "payment_attempts", "hits": [ { "payment_id": "pay_mUtaBhUnlC2b7kTtxTJ0", "merchant_id": "merchant_1725267397", "attempt_id": "pay_mUtaBhUnlC2b7kTtxTJ0_1", "status": "charged", "amount": 6540, "currency": "USD", "save_to_locker": null, "connector": "stripe_test", "error_message": null, "offer_amount": null, "surcharge_amount": null, "tax_amount": null, "payment_method_id": null, "payment_method": "card", "connector_transaction_id": "pay_XO5KGoaMl5y7R8fM3Xya", "capture_method": "automatic", "capture_on": 1662804672, "confirm": true, "authentication_type": "no_three_ds", "created_at": 1725339016, "modified_at": 1725339017, "last_synced": 1725339016, "cancellation_reason": null, "amount_to_capture": 6540, "mandate_id": null, "browser_info": null, "error_code": null, "connector_metadata": null, "payment_experience": null, "payment_method_type": "credit", "payment_method_data": "{\"card\":{\"last4\":\"4242\",\"bank_code\":null,\"card_isin\":\"424242\",\"card_type\":null,\"card_issuer\":null,\"card_network\":null,\"card_exp_year\":\"25\",\"card_exp_month\":\"10\",\"payment_checks\":null,\"card_holder_name\":null,\"card_extended_bin\":null,\"authentication_data\":null,\"card_issuing_country\":null}}", "error_reason": null, "multiple_capture_count": null, "amount_capturable": 0, "merchant_connector_id": "mca_zPBTVwk8mQPMvW9rrW8n", "net_amount": 6540, "unified_code": null, "unified_message": null, "mandate_data": null, "client_source": null, "client_version": null, "profile_id": "pro_GOyb8ecA2QA4pXnJTvAL", "organization_id": "org_Iim4q8zOvP7hjwA4qNJh", "card_network": null, "sign_flag": 1, "tenant_id": "public", "clickhouse_database": "default", "@timestamp": "2024-09-03T04:50:16.000000000+00:00" }, { "payment_id": "pay_CW0tpqeKk7F6q2TVKffH", "merchant_id": "merchant_1725267397", "attempt_id": "pay_CW0tpqeKk7F6q2TVKffH_1", "status": "charged", "amount": 6540, "currency": "USD", "save_to_locker": null, "connector": "stripe_test", "error_message": null, "offer_amount": null, "surcharge_amount": null, "tax_amount": null, "payment_method_id": null, "payment_method": "card", "connector_transaction_id": "pay_w5UHXOqOiLqRieOUQL63", "capture_method": "automatic", "capture_on": 1662804672, "confirm": true, "authentication_type": "no_three_ds", "created_at": 1725283209, "modified_at": 1725283210, "last_synced": 1725283209, "cancellation_reason": null, "amount_to_capture": 6540, "mandate_id": null, "browser_info": null, "error_code": null, "connector_metadata": null, "payment_experience": null, "payment_method_type": "credit", "payment_method_data": "{\"card\":{\"last4\":\"4242\",\"bank_code\":null,\"card_isin\":\"424242\",\"card_type\":null,\"card_issuer\":null,\"card_network\":null,\"card_exp_year\":\"25\",\"card_exp_month\":\"10\",\"payment_checks\":null,\"card_holder_name\":null,\"card_extended_bin\":null,\"authentication_data\":null,\"card_issuing_country\":null}}", "error_reason": null, "multiple_capture_count": null, "amount_capturable": 0, "merchant_connector_id": "mca_zPBTVwk8mQPMvW9rrW8n", "net_amount": 6540, "unified_code": null, "unified_message": null, "mandate_data": null, "client_source": null, "client_version": null, "profile_id": "pro_GOyb8ecA2QA4pXnJTvAL", "organization_id": "org_Iim4q8zOvP7hjwA4qNJh", "card_network": null, "sign_flag": 1, "tenant_id": "public", "clickhouse_database": "default", "@timestamp": "2024-09-02T13:20:09.000000000+00:00" } ], "status": "Success" }, { "count": 2, "index": "payment_intents", "hits": [ { "payment_id": "pay_mUtaBhUnlC2b7kTtxTJ0", "merchant_id": "merchant_1725267397", "status": "succeeded", "amount": 6540, "currency": "USD", "amount_captured": 6540, "customer_id": "StripeCustomer", "description": "Its my first payment request", "return_url": "https://google.com/", "metadata": "{\"data2\":\"camel\",\"login_date\":\"2019-09-10T10:11:12Z\",\"new_customer\":\"true\"}", "connector_id": null, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "created_at": 1725339016, "modified_at": 1725339017, "last_synced": 1725339016, "setup_future_usage": null, "off_session": null, "client_secret": "pay_mUtaBhUnlC2b7kTtxTJ0_secret_wiZ5NQnCZ2i9ajdAYyAJ", "active_attempt_id": "pay_mUtaBhUnlC2b7kTtxTJ0_1", "business_country": null, "business_label": "default", "attempt_count": 1, "profile_id": "pro_GOyb8ecA2QA4pXnJTvAL", "payment_confirm_source": null, "billing_details": null, "shipping_details": null, "customer_email": "f6cd0753a831880835a0e0d23136ef66318d8303605bd37fa80b4ecf248bd303", "feature_metadata": { "redirect_response": null, "search_tags": [ "9c202f2fabd12f758a12b449944f5cdaeadf39132680667543033158023bc805", "ffd1c37eb18f3459e3da6f21f739866bce89a334061c248656cb71d83d2375f4" ] }, "merchant_order_reference_id": null, "organization_id": "org_Iim4q8zOvP7hjwA4qNJh", "sign_flag": 1, "tenant_id": "public", "clickhouse_database": "default", "@timestamp": "2024-09-03T04:50:16.000000000+00:00" }, { "payment_id": "pay_CW0tpqeKk7F6q2TVKffH", "merchant_id": "merchant_1725267397", "status": "succeeded", "amount": 6540, "currency": "USD", "amount_captured": 6540, "customer_id": "StripeCustomer", "description": "Its my first payment request", "return_url": "https://google.com/", "metadata": "{\"data2\":\"camel\",\"login_date\":\"2019-09-10T10:11:12Z\",\"new_customer\":\"true\"}", "connector_id": null, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "created_at": 1725283209, "modified_at": 1725283210, "last_synced": 1725283209, "setup_future_usage": null, "off_session": null, "client_secret": "pay_CW0tpqeKk7F6q2TVKffH_secret_rZIT5OsQzbhkE7rhsUrq", "active_attempt_id": "pay_CW0tpqeKk7F6q2TVKffH_1", "business_country": null, "business_label": "default", "attempt_count": 1, "profile_id": "pro_GOyb8ecA2QA4pXnJTvAL", "payment_confirm_source": null, "billing_details": null, "shipping_details": null, "customer_email": "f6cd0753a831880835a0e0d23136ef66318d8303605bd37fa80b4ecf248bd303", "feature_metadata": { "redirect_response": null, "search_tags": [ "9c202f2fabd12f758a12b449944f5cdaeadf39132680667543033158023bc805", "ffd1c37eb18f3459e3da6f21f739866bce89a334061c248656cb71d83d2375f4" ] }, "merchant_order_reference_id": null, "organization_id": "org_Iim4q8zOvP7hjwA4qNJh", "sign_flag": 1, "tenant_id": "public", "clickhouse_database": "default", "@timestamp": "2024-09-02T13:20:09.000000000+00:00" } ], "status": "Success" }, { "count": 1, "index": "refunds", "hits": [ { "internal_reference_id": "refid_yWIsLDexIn3LvMoEvXds", "refund_id": "ref_WBSqj48rx3gaOuz1kUJv", "payment_id": "pay_mUtaBhUnlC2b7kTtxTJ0", "merchant_id": "merchant_1725267397", "connector_transaction_id": "pay_XO5KGoaMl5y7R8fM3Xya", "connector": "stripe_test", "connector_refund_id": "dummy_ref_DA5VW0KwaiCvnTaeBtcA", "external_reference_id": "ref_WBSqj48rx3gaOuz1kUJv", "refund_type": "instant_refund", "total_amount": 6540, "currency": "USD", "refund_amount": 600, "refund_status": "success", "sent_to_gateway": true, "refund_error_message": null, "refund_arn": "", "created_at": 1725339184, "modified_at": 1725339185, "description": "Customer returned product", "attempt_id": "pay_mUtaBhUnlC2b7kTtxTJ0_1", "refund_reason": "Customer returned product", "refund_error_code": null, "profile_id": "pro_GOyb8ecA2QA4pXnJTvAL", "organization_id": "org_Iim4q8zOvP7hjwA4qNJh", "sign_flag": 1, "tenant_id": "public", "clickhouse_database": "default", "@timestamp": "2024-09-03T04:53:04.000000000+00:00" } ], "status": "Success" }, { "count": 0, "index": "disputes", "hits": [], "status": "Failure" } ]Checklist
cargo +nightly fmt --allcargo clippy