juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
12.35k stars 1.34k forks source link

[REFACTOR] Use `MerchantJwtWithProfileId` instead of `MerchantJwt` in Authentication data #5937

Open ThisIsMani opened 1 month ago

ThisIsMani commented 1 month ago

Feature Description

We have recently introduced MerchantJwtWithProfileId to the AuthenticationData enum. The new variant includes both a profile_id and a non-optional user_id field, improving upon the older MerchantJwt variant. The goal of this issue is to replace all instances of MerchantJwt with MerchantJwtWithProfileId.

You can find the location of MerchantJwt here: https://github.com/juspay/hyperswitch/blob/2bc8756e061e9e0e705ce2c6b533c3583f3efa8b/crates/router/src/services/authentication.rs#L91 MerchantJwtWithProfileId is located just under it.

Possible Implementation

Have you spent some time checking if this feature request has been raised before?

Submission Process:

Refer here for Terms and conditions for the contest.

arkzuse commented 1 month ago

Hi @ThisIsMani can I work on this issue?

gorakhnathy7 commented 1 month ago

Hey @arkzuse, Thanks for showing interest in contributing to Hyperswitch! This issue is open for contributions, and you can work on it. It's also part of Hacktoberfest 2024, If you work on resolving it during Hacktoberfest, you'll be eligible to claim a goodie as a reward. Let us know if you need any help getting started!

arkzuse commented 1 month ago

I need help here. After setting up the project using docker compose. I am trying the APIs, but getting status: failed in "Payment-Create" on postman. How can i create a test payment connector account, couldn't understand this step from the docs.

ThisIsMani commented 1 month ago

@arkzuse, assuming you are using Hyperswitch Postman collection, you will find a folder named Quickstart. In that you will have Merchant Account Create, API Key Create, Payment Connector Create. You will have to run those before you create any payment.

If you want to connect a test payment connector account, you can use stripe_test. Header Key can be any string. You can find the cards that are supported by stripe_test (we refer to them as dummy connectors) in the docs.

arkzuse commented 1 month ago

@ThisIsMani thanks for your help! Yes I was using Hyperswitch Postman collection. Do I have to write some test for this implementation? If yes please guide me how it would look like.

ThisIsMani commented 1 month ago

Hey @arkzuse, sorry for the delay. You don't have to write any test.

Log the auth_type in this function, and you should see the changes. https://github.com/juspay/hyperswitch/blob/809c92bdcb07a89f37dfdceecc7b72e75e8d1343/crates/router/src/services/api.rs#L769

This will be pushed to our analytics and logs.

arkzuse commented 1 month ago

@ThisIsMani please have a look at workflow, i don't understand why they are failing

ThisIsMani commented 1 month ago

You can ignore them, they are not required checks.