Skip to content
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

feat: add option to enable kv on merchant account create #2799

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

dracarys18
Copy link
Member

@dracarys18 dracarys18 commented Nov 7, 2023

Type of Change

  • Enhancement

Description

Add kv_enabled field in MerchantAccountCreate to give an option to enable KV while creating merchant.

Additional Changes

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

Motivation and Context

Currently we do not have an option to enable KV while creating the merchant hence the two calls of creating a merchant and enabling KV this PR adds an option to enable Kv during create.

How did you test it?

  • Create a merchant with kv_enabled = true
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
  "merchant_id": "mer_1699342570",
  "locker_id" : "m0010",
  "merchant_name": "NewAge Retailer",
  "merchant_details": {
    "primary_contact_person": "John Test",
    "primary_email": "JohnTest@test.com",
    "primary_phone": "sunt laborum",
    "secondary_contact_person": "John Test2",
    "secondary_email": "JohnTest2@test.com",
    "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": "http://www.example.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,
    "webhook_url": " https://cb30-13-232-74-226.ngrok.io"
  },
  "sub_merchants_enabled": false,
  "metadata": {
    "city": "NY",
    "unit": "245"
  },
  "kv_enabled": true
}'
  • Check storage_scheme of the merchant in DB. It should be redis_kv for kv_enabled = true
Screenshot 2023-11-07 at 1 07 42 PM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code

@dracarys18 dracarys18 added A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Nov 7, 2023
@dracarys18 dracarys18 self-assigned this Nov 7, 2023
@dracarys18 dracarys18 requested review from a team as code owners November 7, 2023 07:38
@dracarys18 dracarys18 added this to the November 2023 Release milestone Nov 7, 2023
jarnura
jarnura previously approved these changes Nov 7, 2023
Narayanbhat166
Narayanbhat166 previously approved these changes Nov 7, 2023
likhinbopanna
likhinbopanna previously approved these changes Nov 8, 2023
SanchithHegde
SanchithHegde previously approved these changes Dec 18, 2023
@dracarys18 dracarys18 requested a review from jarnura March 1, 2024 07:41
@bernard-eugine bernard-eugine modified the milestones: April 2024, May 2024 May 3, 2024
@dracarys18 dracarys18 linked an issue May 10, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] allow enabling KV during merchant account create
7 participants