Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions crates/router/src/connector/authorizedotnet/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1811,13 +1811,13 @@ pub struct PaypalPaymentConfirm {
#[derive(Debug, Serialize, Deserialize)]
pub struct Paypal {
#[serde(rename = "payerID")]
payer_id: Secret<String>,
payer_id: Option<Secret<String>>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct PaypalQueryParams {
#[serde(rename = "PayerID")]
payer_id: Secret<String>,
payer_id: Option<Secret<String>>,
}

impl TryFrom<&AuthorizedotnetRouterData<&types::PaymentsCompleteAuthorizeRouterData>>
Expand All @@ -1834,10 +1834,13 @@ impl TryFrom<&AuthorizedotnetRouterData<&types::PaymentsCompleteAuthorizeRouterD
.as_ref()
.and_then(|redirect_response| redirect_response.params.as_ref())
.ok_or(errors::ConnectorError::ResponseDeserializationFailed)?;
let payer_id: Secret<String> =
serde_urlencoded::from_str::<PaypalQueryParams>(params.peek())
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?
.payer_id;

let query_params: PaypalQueryParams = serde_urlencoded::from_str(params.peek())
.change_context(errors::ConnectorError::ResponseDeserializationFailed)
.attach_printable("Failed to parse connector response")?;

let payer_id = query_params.payer_id;

let transaction_type = match item.router_data.request.capture_method {
Some(enums::CaptureMethod::Manual) => Ok(TransactionType::ContinueAuthorization),
Some(enums::CaptureMethod::SequentialAutomatic)
Expand Down
Loading