Skip to content

Conversation

hrithikesh026
Copy link
Contributor

@hrithikesh026 hrithikesh026 commented Mar 4, 2025

Type of Change

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

Description

made changes to populate id column in merchant account while creating a new merchant_account record in v1.
So that the merchant account created in v1 can be read from v2.

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?

Made sure that id column is being populated with merchant_id when creating a new merchant account

  1. create merchant account in v1 application.
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
  "merchant_id": "merchant_1741338438",
  "locker_id": "m0010",
  "merchant_name": "NewAge Retailer",
  "merchant_details": {
    "primary_contact_person": "John Test",
    "primary_email": "[email protected]",
    "primary_phone": "sunt laborum",
    "secondary_contact_person": "John Test2",
    "secondary_email": "[email protected]",
    "secondary_phone": "cillum do dolor id",
    "website": "www.example.com",
    "about_business": "Online Retail with a wide selection of organic products for North America",
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US"
    }
  },
  "return_url": "https://google.com/success",
  "webhook_details": {
    "webhook_version": "1.0.1",
    "webhook_username": "ekart_retail",
    "webhook_password": "password_ekart@123",
    "payment_created_enabled": true,
    "payment_succeeded_enabled": true,
    "payment_failed_enabled": true
  },
  "sub_merchants_enabled": false,
  "metadata": {
    "city": "NY",
    "unit": "245"
  },
  "primary_business_details": [
    {
      "country": "US",
      "business": "default"
    }
  ]
}'

image

  1. fetch the merchant account in v2 application.
curl --location 'http://localhost:8080/v2/merchant-accounts/merchant_1741338105' \
--header 'api-key: test_admin'

Response:

{
    "id": "merchant_1741338105",
    "merchant_name": "NewAge Retailer",
    "merchant_details": {
        "primary_contact_person": "John Test",
        "primary_phone": "sunt laborum",
        "primary_email": "[email protected]",
        "secondary_contact_person": "John Test2",
        "secondary_phone": "cillum do dolor id",
        "secondary_email": "[email protected]",
        "website": "www.example.com",
        "about_business": "Online Retail with a wide selection of organic products for North America",
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": null,
            "last_name": null
        }
    },
    "publishable_key": "pk_dev_2d588a75c92b402caf7f9794bf50b3a5",
    "metadata": {
        "city": "NY",
        "unit": "245",
        "compatible_connector": null
    },
    "organization_id": "org_A62v8pidYbQaGZevTQhP",
    "recon_status": "not_requested"
}

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

@hrithikesh026 hrithikesh026 self-assigned this Mar 4, 2025
@hrithikesh026 hrithikesh026 requested review from a team as code owners March 4, 2025 13:46
Copy link

semanticdiff-com bot commented Mar 4, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/hyperswitch_domain_models/src/merchant_account.rs  74% smaller
  crates/api_models/src/admin.rs  0% smaller
  crates/diesel_models/src/query/merchant_account.rs  0% smaller
  crates/router/src/core/admin.rs  0% smaller
  crates/router/src/routes/admin.rs  0% smaller
  crates/router/src/types/api/admin.rs  0% smaller
  crates/router/src/types/domain/user.rs  0% smaller
  crates/router/src/utils/user.rs  0% smaller

@hrithikesh026 hrithikesh026 requested a review from a team as a code owner March 6, 2025 07:24
@hrithikesh026 hrithikesh026 requested review from jarnura and racnan March 6, 2025 11:12
jarnura
jarnura previously approved these changes Mar 6, 2025
@hrithikesh026 hrithikesh026 linked an issue Mar 6, 2025 that may be closed by this pull request
2 tasks
@likhinbopanna likhinbopanna added this pull request to the merge queue Mar 7, 2025
Merged via the queue into main with commit b63439a Mar 7, 2025
26 of 32 checks passed
@likhinbopanna likhinbopanna deleted the make-v1-merchant-account-forward-compatible branch March 7, 2025 11:44
pixincreate added a commit that referenced this pull request Mar 7, 2025
…juspay/hyperswitch into connector/gpay-mandates-authorizedotnet

* 'connector/gpay-mandates-authorizedotnet' of github.com:juspay/hyperswitch: (25 commits)
  ci(cypress): address lints and refactor redirection handler (#7437)
  chore: make v1 merchant account forward compatible (#7426)
  fix(dashboard): Added auth key to juspay threeds server (#7457)
  feat(hipay): Add Template PR (#7360)
  chore(version): 2025.03.07.0
  chore(postman): update Postman collection files
  feat(analytics): add new filters, dimensions and metrics for authentication analytics (#7451)
  feat(router): add capability to force challenge for 3DS Payments through Netcetera and send few optional fields (#7429)
  feat(analytics): refactor and rewrite authentication related analytics (#7433)
  refactor(core): Added payment id in authentication router data (#7441)
  feat(connector): Added ThreeDs server integration template pr (#7424)
  fix(xendit): Fix wasm changes (#7419)
  chore(postman): postman tests fixes (#7159)
  ci(cypress): move customer acceptance in configs to a const within commons (#7435)
  feat(core): add additional revenue recovery call flow (#7402)
  chore(version): 2025.03.06.0
  feat(payment_link): expose payment link configs for SDK UI rules and payment button (#7427)
  feat(connector): [EFT] Add EFT as a payment method (#7304)
  chore(version): 2025.03.05.1
  feat(connector): [Moneris] Implement mandate for Moneris (#7322)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] create accounts schema for accounts tables
4 participants