Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(connector): [BANKOFAMERICA] Fix Capture
Browse files Browse the repository at this point in the history
deepanshu-iiitu committed Nov 3, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 646a16b commit 1575ba5
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions crates/router/src/connector/bankofamerica/transformers.rs
Original file line number Diff line number Diff line change
@@ -411,28 +411,32 @@ impl<F, T>
}
}

impl TryFrom<&types::PaymentsCaptureRouterData> for BankofamericaPaymentsRequest {
#[derive(Default, Debug, Serialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct OrderInformation {
amount_details: Amount,
}

#[derive(Default, Debug, Serialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct BankofamericaCaptureRequest {
order_information: OrderInformation,
client_reference_information: ClientReferenceInformation,
}

impl TryFrom<&types::PaymentsCaptureRouterData> for BankofamericaCaptureRequest {
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(value: &types::PaymentsCaptureRouterData) -> Result<Self, Self::Error> {
Ok(Self {
processing_information: ProcessingInformation {
capture_options: Some(CaptureOptions {
capture_sequence_number: 1,
total_capture_count: 1,
}),
..Default::default()
},
order_information: OrderInformationWithBill {
order_information: OrderInformation {
amount_details: Amount {
total_amount: value.request.amount_to_capture.to_string(),
..Default::default()
currency: value.request.currency.to_string(),
},
..Default::default()
},
client_reference_information: ClientReferenceInformation {
code: Some(value.connector_request_reference_id.clone()),
},
..Default::default()
})
}
}

0 comments on commit 1575ba5

Please sign in to comment.