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(business_profile): add tax_connector_id column in business_profile table #5576

Merged
merged 24 commits into from
Aug 26, 2024

Conversation

ImSagnik007
Copy link
Contributor

@ImSagnik007 ImSagnik007 commented Aug 9, 2024

Type of Change

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

Description

Added tax_connector_id and is_tax_connector_enabled in business_profile table.

Create Curl:

curl --location 'http://localhost:8080/account/merchant_1724326233/business_profile' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
  "profile_name": "food"
}'

Create Response:

{
    "merchant_id": "merchant_1724326084",
    "profile_id": "pro_SnLMrR7pY0cl8Npb8DyZ",
    "profile_name": "food",
    "return_url": "https://google.com/success",
    "enable_payment_response_hash": true,
    "payment_response_hash_key": "14zxU6SmNKq1m7rVQTg1EbJu9jALg8emsh4KRNPeMlUxCGKOfyp4ZgezG6VtcMnT",
    "redirect_to_merchant_with_http_post": false,
    "webhook_details": {
        "webhook_version": "1.0.1",
        "webhook_username": "ekart_retail",
        "webhook_password": "password_ekart@123",
        "webhook_url": null,
        "payment_created_enabled": true,
        "payment_succeeded_enabled": true,
        "payment_failed_enabled": true
    },
    "metadata": null,
    "routing_algorithm": null,
    "intent_fulfillment_time": 900,
    "frm_routing_algorithm": null,
    "payout_routing_algorithm": null,
    "applepay_verified_domains": null,
    "session_expiry": 900,
    "payment_link_config": null,
    "authentication_connector_details": null,
    "use_billing_as_payment_method_billing": true,
    "extended_card_info_config": null,
    "collect_shipping_details_from_wallet_connector": false,
    "collect_billing_details_from_wallet_connector": false,
    "is_connector_agnostic_mit_enabled": false,
    "payout_link_config": null,
    "outgoing_webhook_custom_http_headers": null,
    "tax_connector_id": null,
    "is_tax_connector_enabled": false
}

Update Curl:

curl --location 'http://localhost:8080/account/merchant_1724326233/business_profile/pro_0NKGAbAl8s3qfAO6FUk6' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
  "tax_connector_id": "taxjar_abc",
  "is_tax_connector_enabled": true
}'

Update Response :-

{
    "merchant_id": "merchant_1724326233",
    "profile_id": "pro_0NKGAbAl8s3qfAO6FUk6",
    "profile_name": "US_food",
    "return_url": "https://google.com/success",
    "enable_payment_response_hash": true,
    "payment_response_hash_key": "n2NsjF2OAHg9BlNpxUD3hf5N5ZUnJKr2W2NErI2yGZEhciVGVRzk8vjRKWmD514i",
    "redirect_to_merchant_with_http_post": false,
    "webhook_details": {
        "webhook_version": "1.0.1",
        "webhook_username": "ekart_retail",
        "webhook_password": "password_ekart@123",
        "webhook_url": null,
        "payment_created_enabled": true,
        "payment_succeeded_enabled": true,
        "payment_failed_enabled": true
    },
    "metadata": null,
    "routing_algorithm": null,
    "intent_fulfillment_time": 900,
    "frm_routing_algorithm": null,
    "payout_routing_algorithm": null,
    "applepay_verified_domains": null,
    "session_expiry": 900,
    "payment_link_config": null,
    "authentication_connector_details": null,
    "use_billing_as_payment_method_billing": true,
    "extended_card_info_config": null,
    "collect_shipping_details_from_wallet_connector": false,
    "collect_billing_details_from_wallet_connector": false,
    "is_connector_agnostic_mit_enabled": false,
    "payout_link_config": null,
    "outgoing_webhook_custom_http_headers": null,
    "tax_connector_id": "taxjar_abc",
    "is_tax_connector_enabled": true
}

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?

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

@ImSagnik007 ImSagnik007 requested review from a team as code owners August 9, 2024 03:37
@hyperswitch-bot hyperswitch-bot bot added M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Aug 9, 2024
@ImSagnik007 ImSagnik007 changed the title Added support for taxjar to create connector api and added tax_conenctor_id in business_profile table Added support for taxjar to create connector api and added tax_connector_id in business_profile table Aug 9, 2024
@@ -485,6 +486,8 @@ pub enum ConnectorType {
PaymentMethodAuth,
/// 3DS Authentication Service Providers
AuthenticationProcessor,
/// Tax Calculators
TaxCalculator,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TaxCalculator,
TaxProcessor

Comment on lines 2568 to 2569
Taxjar,
Avalara,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only add 1 which we are integrating.

Suggested change
Taxjar,
Avalara,
Taxjar,

@@ -1266,7 +1266,8 @@ impl<'a> ConnectorAuthTypeAndMetadataValidation<'a> {
| api_enums::Connector::DummyConnector4
| api_enums::Connector::DummyConnector5
| api_enums::Connector::DummyConnector6
| api_enums::Connector::DummyConnector7 => {
| api_enums::Connector::DummyConnector7
| api_enums::Connector::Taxjar => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be under dummy_connector feature flag

@ImSagnik007 ImSagnik007 self-assigned this Aug 9, 2024
@ImSagnik007 ImSagnik007 changed the title Added support for taxjar to create connector api and added tax_connector_id in business_profile table feat(connector): [Taxjar] add taxjar connector and add tax_connector_id column in business_profile table Aug 9, 2024
@ImSagnik007 ImSagnik007 force-pushed the connector_create_taxjar branch 2 times, most recently from 4dd3de2 to 6068625 Compare August 12, 2024 08:38
@ImSagnik007 ImSagnik007 changed the title feat(connector): [Taxjar] add taxjar connector and add tax_connector_id column in business_profile table feat(business_profile): add tax_connector_id column in business_profile table Aug 12, 2024
@ImSagnik007 ImSagnik007 force-pushed the connector_create_taxjar branch from 6068625 to bbe33cb Compare August 12, 2024 10:35
@ImSagnik007 ImSagnik007 reopened this Aug 13, 2024
@ImSagnik007 ImSagnik007 force-pushed the connector_create_taxjar branch from bbe33cb to 8cf6bbb Compare August 13, 2024 10:58
@hyperswitch-bot hyperswitch-bot bot requested a review from a team as a code owner August 13, 2024 11:08
@ImSagnik007 ImSagnik007 force-pushed the connector_create_taxjar branch from b6d70ba to 8cf6bbb Compare August 13, 2024 11:18
@ImSagnik007 ImSagnik007 force-pushed the connector_create_taxjar branch 2 times, most recently from 4fcb36b to c40dac9 Compare August 14, 2024 11:05
Copy link
Contributor

@sai-harsha-vardhan sai-harsha-vardhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ImSagnik007 Can you please add the relevant test cases in PR description please?

@@ -359,6 +364,8 @@ impl BusinessProfileUpdateInternal {
frm_routing_algorithm_id,
payout_routing_algorithm_id,
default_fallback_routing,
// default_fallback_routing,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please remove this comment?

@ImSagnik007 ImSagnik007 force-pushed the connector_create_taxjar branch 2 times, most recently from 1d4f809 to e6a454a Compare August 21, 2024 11:59

/// Indicates if tax_calculator connector is enabled or not.
/// If set to `true` tax_connector_id will be checked.
pub is_tax_connector_enabled: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please make this an option?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a serde default here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

@@ -0,0 +1,3 @@
-- Your SQL goes here
ALTER TABLE business_profile ADD COLUMN IF NOT EXISTS tax_connector_id VARCHAR(64);
ALTER TABLE business_profile ADD COLUMN IF NOT EXISTS is_tax_connector_enabled BOOLEAN;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may to move this migration to a new file / rename the existing migration to convey the new change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, renamed the folder

@ImSagnik007 ImSagnik007 force-pushed the connector_create_taxjar branch 2 times, most recently from 821a555 to 215216f Compare August 22, 2024 07:08
SamraatBansal
SamraatBansal previously approved these changes Aug 25, 2024
crates/api_models/src/admin.rs Outdated Show resolved Hide resolved
crates/api_models/src/admin.rs Outdated Show resolved Hide resolved
crates/router/src/core/admin.rs Outdated Show resolved Hide resolved
crates/router/src/core/admin.rs Outdated Show resolved Hide resolved
SanchithHegde
SanchithHegde previously approved these changes Aug 25, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Aug 26, 2024
Merged via the queue into main with commit 963a254 Aug 26, 2024
14 checks passed
@likhinbopanna likhinbopanna deleted the connector_create_taxjar branch August 26, 2024 08:24
pixincreate added a commit that referenced this pull request Aug 26, 2024
* 'main' of github.com:juspay/hyperswitch:
  feat(customer_v2):  added list customer v2 end point (#5517)
  feat(business_profile): add tax_connector_id column in business_profile table (#5576)
  chore: create v2 route for organization (#5679)
  refactor(payments_response): remove setter from payments response (#5676)
  feat(payment_methods_v2): Payment methods v2 API models (#5564)
  chore(version): 2024.08.26.0
pixincreate added a commit that referenced this pull request Aug 27, 2024
* 'main' of github.com:juspay/hyperswitch: (134 commits)
  refactor(open_banking): Added merchant data update in mca update (#5655)
  feat: add test_mode for quickly testing payout links (#5669)
  refactor: introduce a domain type for profile ID (#5687)
  ci(cypress): update paybox configs (#5664)
  feat(openapi):  Add open api routes for routing v2 (#5686)
  feat(connector): [NOVALNET] Add template code (#5670)
  feat(user): business email update (#5674)
  chore(config): add production connector-configs for netcetera external 3ds flow (#5698)
  chore(version): 2024.08.27.0
  refactor(euclid): make the disabled node's relation as negative (#5701)
  feat: populate payment method details in payments response (#5661)
  build(deps): bump `diesel` to `2.2.3` and `sqlx` to `0.8.1` (#5688)
  feat(customer_v2):  added list customer v2 end point (#5517)
  feat(business_profile): add tax_connector_id column in business_profile table (#5576)
  chore: create v2 route for organization (#5679)
  refactor(payments_response): remove setter from payments response (#5676)
  feat(payment_methods_v2): Payment methods v2 API models (#5564)
  chore(version): 2024.08.26.0
  feat(connector): [Adyen] add dispute flows for adyen connector (#5514)
  chore(version): 2024.08.23.0
  ...
pixincreate added a commit that referenced this pull request Aug 27, 2024
…-key-check

* 'main' of github.com:juspay/hyperswitch:
  feat(core): Add mTLS certificates for each request (#5636)
  refactor(open_banking): Added merchant data update in mca update (#5655)
  feat: add test_mode for quickly testing payout links (#5669)
  refactor: introduce a domain type for profile ID (#5687)
  ci(cypress): update paybox configs (#5664)
  feat(openapi):  Add open api routes for routing v2 (#5686)
  feat(connector): [NOVALNET] Add template code (#5670)
  feat(user): business email update (#5674)
  chore(config): add production connector-configs for netcetera external 3ds flow (#5698)
  chore(version): 2024.08.27.0
  refactor(euclid): make the disabled node's relation as negative (#5701)
  feat: populate payment method details in payments response (#5661)
  build(deps): bump `diesel` to `2.2.3` and `sqlx` to `0.8.1` (#5688)
  feat(customer_v2):  added list customer v2 end point (#5517)
  feat(business_profile): add tax_connector_id column in business_profile table (#5576)
  chore: create v2 route for organization (#5679)
  refactor(payments_response): remove setter from payments response (#5676)
  feat(payment_methods_v2): Payment methods v2 API models (#5564)
  chore(version): 2024.08.26.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-api-contract-changes Metadata: This PR involves API contract changes M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants