-
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(core): confirm flow and authorization api changes for external authentication #4015
Conversation
…odules-for-external-authn
…odules-for-external-authn
} | ||
|
||
fn get_payment_action(&self) -> services::PaymentAction { | ||
services::PaymentAction::CompleteAuthorize |
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 can maybe add a separate variant for this use case?
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 will fixed in the upcoming refactor PR.
authentication::perform_post_authentication( | ||
state, | ||
authentication_connector_name.clone(), | ||
business_profile.clone(), | ||
authentication_connector_mca, | ||
authentication::types::PostAuthenthenticationFlowInput::PaymentAuthNFlow { | ||
payment_data, | ||
authentication_data, | ||
should_continue_confirm_transaction, | ||
}, | ||
) |
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.
call authentication core with appropriate generics, can be taken up in the refactors PR
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 will fixed in the upcoming refactor PR.
payment_data.authentication = match payment_data.authentication { | ||
Some((authentication, authentication_data)) => { | ||
let authentication_update = storage::AuthenticationUpdate::PostAuthorizationUpdate { | ||
authentication_lifecycle_status: | ||
storage::enums::AuthenticationLifecycleStatus::Used, | ||
}; | ||
let updated_authentication = state | ||
.store | ||
.update_authentication_by_merchant_id_authentication_id( | ||
authentication, | ||
authentication_update, | ||
) | ||
.await | ||
.to_not_found_response(errors::ApiErrorResponse::PaymentNotFound)?; | ||
Some((updated_authentication, authentication_data)) | ||
} | ||
None => None, | ||
}; |
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 can also be handled in the authentication_core
.
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 will fixed in the upcoming refactor PR.
.attach_printable("Error while parsing authentication_data") | ||
}) | ||
.transpose()? | ||
.unwrap_or_default(); |
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 should not be inferred as default.
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 will fixed in the upcoming refactor PR.
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 fixed in this PR. #4093
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.
There are no connector specific changes in this PR.
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.
Approved on behalf of @juspay/hyperswitch-routing
Type of Change
Description
Added post 3ds authentication, payment authorize endpoint to send authrorization request to the payment connector after completing 3ds authentication separately.
newly added endpoint is
{base_url}/payments/{payment_id}/{merchant_id}/authorize/{connector}
.Other changes:
added support for calling pre and post authentication services in payments core.
pre_authn will be called during confirm flow to determine the 3ds version.
post_authn will be called after external authentication is completed to retrieve the authentication data.
Additional Changes
Motivation and Context
How did you test it?
Checklist
cargo +nightly fmt --all
cargo clippy