refactor: make NextAction as enum (#1234)

This commit is contained in:
Sangamesh Kulkarni
2023-05-24 10:46:00 +05:30
committed by GitHub
parent 48e537568d
commit a359b76d09
8 changed files with 81 additions and 53 deletions

View File

@ -380,7 +380,10 @@ impl PaymentRedirectFlow for PaymentRedirectCompleteAuthorize {
api_models::enums::IntentStatus::RequiresCustomerAction => {
let startpay_url = payments_response
.next_action
.and_then(|next_action| next_action.redirect_to_url)
.and_then(|next_action_data| match next_action_data {
api_models::payments::NextActionData::RedirectToUrl { redirect_to_url } => Some(redirect_to_url),
api_models::payments::NextActionData::DisplayBankTransferInformation { .. } => None,
})
.ok_or(errors::ApiErrorResponse::InternalServerError)
.into_report()
.attach_printable(