Skip to content

Commit 55bb284

Browse files
fix(router): [Cybersource] add flag to indicate final capture (#7085)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
1 parent 8ac1b83 commit 55bb284

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ pub enum CybersourcePaymentInitiatorTypes {
417417
pub struct CaptureOptions {
418418
capture_sequence_number: u32,
419419
total_capture_count: u32,
420+
is_final: Option<bool>,
420421
}
421422

422423
#[derive(Debug, Serialize)]
@@ -2142,11 +2143,18 @@ impl TryFrom<&CybersourceRouterData<&PaymentsCaptureRouterData>>
21422143
.clone()
21432144
.map(convert_metadata_to_merchant_defined_info);
21442145

2146+
let is_final = matches!(
2147+
item.router_data.request.capture_method,
2148+
Some(enums::CaptureMethod::Manual)
2149+
)
2150+
.then_some(true);
2151+
21452152
Ok(Self {
21462153
processing_information: ProcessingInformation {
21472154
capture_options: Some(CaptureOptions {
21482155
capture_sequence_number: 1,
21492156
total_capture_count: 1,
2157+
is_final,
21502158
}),
21512159
action_list: None,
21522160
action_token_types: None,

0 commit comments

Comments
 (0)