refactor(connector): [ACI] Use verbose names for InstructionSource variants (#1575)

This commit is contained in:
Sakil Mostak
2023-07-03 11:29:37 +05:30
committed by GitHub
parent 47cd08a0b0
commit df01f8f382

View File

@ -300,12 +300,11 @@ pub enum InstructionType {
} }
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "UPPERCASE")]
pub enum InstructionSource { pub enum InstructionSource {
// Cardholder initiated transaction #[serde(rename = "CIT")]
Cit, CardholderInitiatedTransaction,
// Merchant initiated transaction #[serde(rename = "MIT")]
Mit, MerchantInitiatedTransaction,
} }
#[derive(Debug, Clone, Serialize)] #[derive(Debug, Clone, Serialize)]
@ -520,14 +519,14 @@ fn get_instruction_details(item: &types::PaymentsAuthorizeRouterData) -> Option<
return Some(Instruction { return Some(Instruction {
mode: InstructionMode::Initial, mode: InstructionMode::Initial,
transaction_type: InstructionType::Unscheduled, transaction_type: InstructionType::Unscheduled,
source: InstructionSource::Cit, source: InstructionSource::CardholderInitiatedTransaction,
create_registration: Some(true), create_registration: Some(true),
}); });
} else if item.request.mandate_id.is_some() { } else if item.request.mandate_id.is_some() {
return Some(Instruction { return Some(Instruction {
mode: InstructionMode::Repeated, mode: InstructionMode::Repeated,
transaction_type: InstructionType::Unscheduled, transaction_type: InstructionType::Unscheduled,
source: InstructionSource::Mit, source: InstructionSource::MerchantInitiatedTransaction,
create_registration: None, create_registration: None,
}); });
} }