-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(connector): implement auth and post auth flows for gpayments #4746
feat(connector): implement auth and post auth flows for gpayments #4746
Conversation
…nticaition connector
…or pre authentication
…ll' into implement-pre-auth-flow-gpayments
…ll' into implement-pre-auth-flow-gpayments
3136ecf
to
56ed568
Compare
…l-auth-and-post_auth-flows-gpayments
pub enum GpaymentsAuthenticationResponse { | ||
Success(Box<GpaymentsAuthenticationSuccessResponse>), | ||
Error(Box<GpaymentsErrorResponse>), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This untagged enum is not required since Gpayments will always return GpaymentsAuthenticationSuccessResponse
with 200 status code.
} | ||
|
||
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] | ||
pub struct GpaymentsErrorResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required since pub struct TDS2ApiError {
is already available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TDS@ApiError and this struct have different field names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i saw from gpayments api documentation that error response structure will always be TDS2ApiError
https://docs.activeserver.cloud/en/api/auth/#/Auth%20API%20V2/BRW_AUTH_V2_1
@@ -68,7 +76,6 @@ impl TryFrom<&GpaymentsRouterData<&types::authentication::PreAuthNVersionCallRou | |||
} | |||
} | |||
|
|||
//TODO: Fill the struct with respective fields | |||
#[derive(Default, Debug, Serialize, Deserialize, PartialEq)] | |||
pub struct GpaymentsErrorResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is added by u and i gonna remove that enum and i gonna use this errorstruct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this struct was created during template code generation. But we are not using this anywhere. So I think it is better to get rid of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already using struct TDS2ApiError
for deserializing error response.
TryFrom< | ||
types::ResponseRouterData< | ||
api::Authentication, | ||
GpaymentsAuthenticationResponse, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GpaymentsAuthenticationResponse, | |
GpaymentsAuthenticationSuccessResponse, |
fn try_from( | ||
item: types::ResponseRouterData< | ||
api::Authentication, | ||
GpaymentsAuthenticationResponse, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GpaymentsAuthenticationResponse, | |
GpaymentsAuthenticationSuccessResponse, |
Type of Change
Description
I have implemented Auth and Post Auth flows for GPayments and GPayments is a Authenticator connector
Additional Changes
Motivation and Context
https://github.com/juspay/hyperswitch-cloud/issues/4996
How did you test it?
I have tested it with postman apis
the apis:
3ds connector copy request :
response:
Payment request:
response:
Payment confirm:
response:
Authenticate request:
response:
Authorize request:
response:
Checklist
cargo +nightly fmt --all
cargo clippy