Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

feat(users): refactorProdIntent to support product-type context and merchant-scope#7638

Merged
likhinbopanna merged 20 commits intomainfromprod-intent-v2
Apr 10, 2025

Conversation

tsdk02
Copy link
Contributor

@tsdk02tsdk02 commentedMar 26, 2025
edited
Loading

Type of Change

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

Description

This PR introduces support for associating ProdIntent with specific product_types and transitions the feature from being user-scoped to merchant-scoped, enabling more flexible usage across different products.

Changes Introduced

1. New V2 Routes for Dashboard Metadata

  • Added v2 routes to supportProdIntent creation and retrieval with respect toproduct_type.

2. Product-Type Context for ProdIntent

  • While inserting theProdIntent into thedashboard_metadata table (for bothv1 andv2 schemas), theproduct_type is now included in the metadata.

3. Merchant-Scoped ProdIntent

  • Before:ProdIntent wasuser-scoped, allowing a single request per user.
  • Now: It ismerchant-scoped, allowing a user to raise separateProdIntent requests for different merchant accounts for each product by the same user.

4. Enhanced Email Body

  • The email body sent forProdIntent now includes theproduct_type context, helping understand for which product the prod intent was raised.

Additional Changes

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

Motivation and Context

Enable requesting for Production Access for every product type merchant account.

How did you test it?

Hit the curl:

  • Dashboard Metadata - ProdIntent (POST):
curl --location'http://localhost:8080/user/data' \--header'accept: */*' \--header'accept-language: en-US,en;q=0.9' \--header'api-key: hyperswitch' \--header'content-type: application/json' \--header'origin: https://app.hyperswitch.io' \--header'priority: u=1, i' \--header'referer: https://app.hyperswitch.io/dashboard/home' \--header'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"' \--header'sec-ch-ua-mobile: ?0' \--header'sec-ch-ua-platform: "macOS"' \--header'sec-fetch-dest: empty' \--header'sec-fetch-mode: cors' \--header'sec-fetch-site: same-origin' \--header'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' \--header'x-merchant-id: merchant_1715600622' \--header'x-profile-id: pro_CqAdpUQBUUam1n0g56mB' \--header'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiOWExMGExMTYtZDc1Ny00MjBlLTkzNWQtZWRlZmQ5ZmQ3NTFmIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQzMDUxMDM3Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MzIyMzg0Mywib3JnX2lkIjoib3JnX1h5ZmR4eUttS1RGTEtuNTJ1clBVIiwicHJvZmlsZV9pZCI6InByb190Y3NsZWJDNDhmN1pkNG9mVlRqWCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.NuvkkzrYPcba0JKUUrlM39NfyD2rHZ_jHIkHgPyM39s' \--header'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMzcwZWUwYWUtZDI0ZS00ODJhLTlmNDktZDYzYmZkNGE0ZjVhIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF9qdmMzb1dXRmxkb0xHNG1GbFc0UCIsInJvbGVfaWQiOiJvcmdfYWRtaW4iLCJleHAiOjE3NDMxMDQxMzcsIm9yZ19pZCI6Im9yZ19hU3NCOWozTWVJcWxVS0YwbDJxRCIsInByb2ZpbGVfaWQiOiJwcm9fcGdrWUkzcnl6TlU2NlBLa3A4ZjciLCJ0ZW5hbnRfaWQiOiJwdWJsaWMifQ.oRERTxTsgrZWNXwSJ5w8CvDHOW1qB2GV3wBQ5Mv-BC8' \--data-raw'{    "ProdIntent": {        "poc_email": "berry@gmail.com",        "is_completed": true,        "legal_business_name": "blueberry",        "business_location": "IN",        "business_website": "https://google.com",        "poc_name": "berry",        "comments": "tx123",        "product_type": "orchestration"    }}'

Dashboard Metadata table should get inserted/updated with the record along with the product_type in the json body.
Sample entry to table:
image

Also, product_type should also be sent in the email body to the configured recepient email-id.
WhatsApp Image 2025-03-28 at 12 58 24 AM

  • Dashboard Metadata - ProdIntent (GET):
curl --location'http://localhost:8080/user/data?keys=ProdIntent' \--header'X-Merchant-Id: ddcd_oBuAVsHl0XMLag9JsHCV' \--header'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiM2RlMDFhYWYtOWVkMi00YTY5LTg3YWItNWU1YmI2ZWFiNGQ5IiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQyMjEyMzQxIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0Mjk4MDgyOCwib3JnX2lkIjoib3JnX3pMQmRNTnpLaDZrNmhiT2tockdJIiwicHJvZmlsZV9pZCI6InByb19LWnhHZ21rUHFkMldQdXBFa2psWCIsInRlbmFudF9pZCI6InB1YmxpYyJ9.aD185AZEOcIjHnLnZZ9GJ2ujSHIdRPbPtrYhzNo0V4M' \--header'sec-ch-ua-platform: "macOS"' \--header'Referer: https://integ.hyperswitch.io/dashboard/v2/recon' \--header'sec-ch-ua: "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"' \--header'X-Profile-Id: pro_UaxaxwTw4A0a9D0QNBrf' \--header'sec-ch-ua-mobile: ?0' \--header'api-key: hyperswitch' \--header'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \--header'Content-Type: application/json'

Expected Output:

[    {"ProdIntent": {"legal_business_name":"blueberry","business_label":null,"business_location":"IN","display_name":null,"poc_email":"berry@gmail.com","business_type":null,"business_identifier":null,"business_website":"https://google.com","poc_name":"berry","poc_contact":null,"comments":"tx123","is_completed":true,"product_type":"orchestration"        }    }]

Similarly v2 routes:
http://localhost:8080/v2/user/data (POST)
http://localhost:8080/v2/user/data?keys=ProdIntent (GET)

Checklist

  • I formatted the codecargo +nightly fmt --all
  • I addressed lints thrown bycargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@tsdk02tsdk02 added the C-featureCategory: Feature request or enhancement labelMar 26, 2025
@tsdk02tsdk02 self-assigned thisMar 26, 2025
@tsdk02tsdk02 requested a review froma team as acode ownerMarch 26, 2025 09:04
@semanticdiff-comSemanticDiff.com
Copy link

semanticdiff-combot commentedMar 26, 2025
edited
Loading

@tsdk02tsdk02 requested a review froma team as acode ownerMarch 26, 2025 09:06
@tsdk02tsdk02 linked an issueMar 26, 2025 that may beclosed by this pull request
@tsdk02tsdk02 changed the titlefeat(users): add v2 routes for dashboard_metadatafeat(users): refactorProdIntent to support product-type context and merchant-scopeMar 26, 2025
SanchithHegde
SanchithHegde previously approved these changesMar 28, 2025
SanchithHegde
SanchithHegde previously approved these changesApr 3, 2025
@likhinbopannalikhinbopanna added this pull request to themerge queueApr 10, 2025
Merged via the queue intomain with commitbbd2102Apr 10, 2025
16 of 20 checks passed
@likhinbopannalikhinbopanna deleted the prod-intent-v2 branchApril 10, 2025 10:14
tsdk02 added a commit that referenced this pull requestApr 10, 2025
…d merchant-scope (#7638)Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
pixincreate added a commit that referenced this pull requestApr 10, 2025
…acilitapay-pix-pmt* 'main' of github.com:juspay/hyperswitch:  feat: remove client_secret from payment_intent and update related code (#7648)  chore(version): 2025.04.10.1  feat(users): refactor `ProdIntent` to support product-type context and merchant-scope (#7638)  refactor(users): modify query to list only v1 merchant_accounts for list v1 merchant accounts API (#7782)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@SanchithHegdeSanchithHegdeSanchithHegde approved these changes

@ThisIsManiThisIsManiThisIsMani approved these changes

@racnanracnanAwaiting requested review from racnan

Assignees

@tsdk02tsdk02

Labels
C-featureCategory: Feature request or enhancement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

ProdIntent Changes
4 participants
@tsdk02@SanchithHegde@ThisIsMani@likhinbopanna

[8]ページ先頭

©2009-2025 Movatter.jp