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

refactor(open_banking): Added merchant data update in mca update #5655

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

Sarthak1799
Copy link
Contributor

@Sarthak1799 Sarthak1799 commented Aug 21, 2024

Type of Change

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

Description

This PR does -

  • In the PIS flow, in merchant connector update, we didn't collect additional_merchant_data in the update req, have fixed that. Have also added relevant logic in MCA update core to process the data collected.

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?

  1. MCA create for Plaid -
curl --location --request POST 'http://localhost:8080/account/merchant_1724231900/connectors' \
--header 'api-key: test_admin' \
--header 'Content-Type: application/json' \
--data-raw '{
    "connector_type": "payment_processor",
    "connector_name": "plaid",
    "connector_account_details": {
        "auth_type": "BodyKey",
        "api_key": "something",
        "key1": "something"
    },
    "test_mode": false,
    "disabled": false,
    "payment_methods_enabled": [
        {
            "payment_method": "open_banking",
            "payment_method_types": [
                {
                    "payment_method_type": "open_banking_pis",
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true,
                    "payment_experience": "redirect_to_url",
                    "accepted_currencies": {
                        "type": "enable_only",
                        "list": [
                            "EUR",
                            "GBP"
                        ]
                    },
                    "minimum_amount": 0
                }
            ]
        }
    ],
    "metadata": {
        "city": "NY",
        "unit": "246"
    }
}'
  1. Update MCA with additional_merchant_data
curl --location --request POST 'http://localhost:8080/account/merchant_1724231900/connectors/mca_HaQGes1t8LKrBYOF6OGj' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cZOhqwgSt6Dl6A95YW10eWHV6LI9h2mdQ9JtDB8kxMJ4YCjFEwf0g5O2WfDnrgrW' \
--data-raw '{
    "connector_type": "payment_processor",
    "additional_merchant_data": {
        "open_banking_recipient_data": {
            "account_data": {
                "iban": {
                    "iban": "IT38R7004962566080427G36725",
                    "name": "merchant_name"
                }
            }
        }
    }
}'

Resposne -

{
    "connector_type": "payment_processor",
    "connector_name": "plaid",
    "connector_label": "plaid_GB_default",
    "merchant_connector_id": "mca_HaQGes1t8LKrBYOF6OGj",
    "profile_id": "pro_iWX6p7sOYZnOE10swzA2",
    "connector_account_details": {
        "auth_type": "BodyKey",
        "api_key": "something",
        "key1": "something"
    },
    "payment_methods_enabled": [
        {
            "payment_method": "open_banking",
            "payment_method_types": [
                {
                    "payment_method_type": "open_banking_pis",
                    "payment_experience": "redirect_to_url",
                    "card_networks": null,
                    "accepted_currencies": {
                        "type": "enable_only",
                        "list": [
                            "EUR",
                            "GBP"
                        ]
                    },
                    "accepted_countries": null,
                    "minimum_amount": 0,
                    "maximum_amount": 68607706,
                    "recurring_enabled": true,
                    "installment_payment_enabled": true
                }
            ]
        }
    ],
    "connector_webhook_details": null,
    "metadata": {
        "city": "NY",
        "unit": "246"
    },
    "test_mode": false,
    "disabled": false,
    "frm_configs": null,
    "business_country": null,
    "business_label": null,
    "business_sub_label": null,
    "applepay_verified_domains": null,
    "pm_auth_config": null,
    "status": "active",
    "additional_merchant_data": {
        "open_banking_recipient_data": {
            "account_data": {
                "iban": {
                    "iban": "IT38R7004962566080427G36725",
                    "name": "merchant_name",
                    "connector_recipient_id": "recipient-id-sandbox-3fafd4a5-269e-4ebc-9f9b-6f18c8f91a73"
                }
            }
        }
    }
}

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

@Sarthak1799 Sarthak1799 added the C-bug Category: Bug label Aug 21, 2024
@Sarthak1799 Sarthak1799 self-assigned this Aug 21, 2024
@Sarthak1799 Sarthak1799 requested review from a team as code owners August 21, 2024 10:05
Copy link

semanticdiff-com bot commented Aug 21, 2024

Review changes with SemanticDiff.

Analyzed 8 of 8 files.

Overall, the semantic diff is 1% smaller than the GitHub diff.

Filename Status
✔️ crates/router/src/core/admin.rs 0.49% smaller
✔️ crates/router/src/core/verification/utils.rs Analyzed
✔️ crates/router/src/core/connector_onboarding/paypal.rs Analyzed
✔️ crates/hyperswitch_domain_models/src/merchant_connector_account.rs Analyzed
✔️ crates/diesel_models/src/merchant_connector_account.rs Analyzed
✔️ crates/api_models/src/admin.rs Analyzed
✔️ api-reference-v2/openapi_spec.json Analyzed
✔️ api-reference/openapi_spec.json Analyzed

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Aug 21, 2024
@Sarthak1799 Sarthak1799 changed the title fix(open_banking): Added merchant data update in mca update refactor(open_banking): Added merchant data update in mca update Aug 22, 2024
Copy link
Contributor

@ThisIsMani ThisIsMani left a comment

Choose a reason for hiding this comment

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

Dashboard specific changes looks fine.

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Aug 27, 2024
Merged via the queue into main with commit 4585e16 Aug 27, 2024
14 checks passed
@Gnanasundari24 Gnanasundari24 deleted the plaid-wasm-fix branch August 27, 2024 08:35
pixincreate added a commit that referenced this pull request Aug 27, 2024
* 'main' of github.com:juspay/hyperswitch:
  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)
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
  ...
cookieg13 pushed a commit that referenced this pull request Aug 27, 2024
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
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
C-bug Category: Bug M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Update MCA Update to process additional merchant data for open banking connectors
5 participants