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

fix(connector_onboarding): Check if connector exists for the merchant account and add reset tracking id API #3229

Merged
merged 7 commits into from
Jan 16, 2024

Conversation

ThisIsMani
Copy link
Contributor

@ThisIsMani ThisIsMani commented Jan 3, 2024

Type of Change

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

Description

  1. This PR adds checks in connector_onboarding to only proceed if the connector exists for the given merchant_account.
  2. Reset tracking id api has been added to connector onboarding, which will reset the tracking details of the onboarded merchant. This can be used to update the process without any interference of previous account.

Additional Changes

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

Motivation and Context

  1. To catch any errors without the connector id check beforehand.
  2. To make the update flow of connector onboarding better.

How did you test it?

Postman.

curl --location 'http://localhost:8080/connector_onboarding/action_url' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer JWT' \
--data '{
    "connector": "paypal",
    "connector_id": "",
    "return_url": "https://google.com"
}'
curl --location 'http://localhost:8080/connector_onboarding/sync' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer JWT' \
--data '{
    "connector": "paypal",
    "profile_id": "",
    "connector_id": ""
}'

If the connector_id is invalid, these apis will throw this error

{
    "error": {
        "type": "invalid_request",
        "message": "Merchant connector account does not exist in our records",
        "code": "HE_02",
        "reason": " does not exist"
    }
}

This api will reset the progress of the onboarding flow. This api will give 200 OK if everything works correctly.

curl --location 'http://localhost:8080/connector_onboarding/reset_tracking_id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer JWT' \
--data '{
    "connector_id": "",
    "connector": "paypal"
}'

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
  • I added a CHANGELOG entry if applicable

@ThisIsMani ThisIsMani added A-connector-compatibility Area: Connector compatibility C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jan 3, 2024
@ThisIsMani ThisIsMani self-assigned this Jan 3, 2024
@ThisIsMani ThisIsMani requested a review from a team as a code owner January 3, 2024 08:48
@ThisIsMani ThisIsMani requested a review from a team as a code owner January 11, 2024 06:45
@ThisIsMani ThisIsMani linked an issue Jan 11, 2024 that may be closed by this pull request
@ThisIsMani ThisIsMani changed the title fix(connector_onboarding): Check if connector exists for the merchant account fix(connector_onboarding): Check if connector exists for the merchant account and add reset tracking id API Jan 11, 2024
apoorvdixit88
apoorvdixit88 previously approved these changes Jan 11, 2024
Narayanbhat166
Narayanbhat166 previously approved these changes Jan 11, 2024
@preetamrevankar preetamrevankar added this pull request to the merge queue Jan 16, 2024
Merged via the queue into main with commit 58cc8d6 Jan 16, 2024
@preetamrevankar preetamrevankar deleted the connector-onboarding branch January 16, 2024 07:50
pixincreate added a commit that referenced this pull request Jan 17, 2024
* 'main' of github.com:juspay/hyperswitch:
  chore(version): 2024.01.17.0
  feat(connector): [BANKOFAMERICA] Implement 3DS flow for cards (#3343)
  ci(s3): fetch connector creds from s3 for added security (#3323)
  feat(recon): add recon APIs (#3345)
  fix(payment_link): added expires_on in payment response (#3332)
  fix(connector_onboarding): Check if connector exists for the merchant account and add reset tracking id API (#3229)
pixincreate added a commit that referenced this pull request Jan 18, 2024
…-router

* 'main' of github.com:juspay/hyperswitch:
  fix(payment_link): added expires_on in payment response (#3332)
  fix(connector_onboarding): Check if connector exists for the merchant account and add reset tracking id API (#3229)
  chore(version): 2024.01.12.1
  chore: add api reference for blocklist (#3336)
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-compatibility Area: Connector compatibility C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: reset tracking id api for connector onboarding
5 participants