mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix(connector): [CYBERSOURCE] Pass transaction type for only wallet MITs (#9444)
Co-authored-by: Debarati Ghatak <debarati.ghatak@Debarati-Ghatak-FW569NC29L.local>
This commit is contained in:
@ -575,7 +575,8 @@ pub struct MandateCard {
|
|||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct MandatePaymentInformation {
|
pub struct MandatePaymentInformation {
|
||||||
payment_instrument: CybersoucrePaymentInstrument,
|
payment_instrument: CybersoucrePaymentInstrument,
|
||||||
tokenized_card: MandatePaymentTokenizedCard,
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
tokenized_card: Option<MandatePaymentTokenizedCard>,
|
||||||
card: Option<MandateCard>,
|
card: Option<MandateCard>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2584,6 +2585,15 @@ impl TryFrom<(&CybersourceRouterData<&PaymentsAuthorizeRouterData>, String)>
|
|||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let tokenized_card = match item.router_data.request.payment_method_type {
|
||||||
|
Some(enums::PaymentMethodType::GooglePay)
|
||||||
|
| Some(enums::PaymentMethodType::ApplePay)
|
||||||
|
| Some(enums::PaymentMethodType::SamsungPay) => Some(MandatePaymentTokenizedCard {
|
||||||
|
transaction_type: TransactionType::StoredCredentials,
|
||||||
|
}),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
|
|
||||||
let bill_to = item
|
let bill_to = item
|
||||||
.router_data
|
.router_data
|
||||||
.get_optional_billing_email()
|
.get_optional_billing_email()
|
||||||
@ -2593,9 +2603,7 @@ impl TryFrom<(&CybersourceRouterData<&PaymentsAuthorizeRouterData>, String)>
|
|||||||
let payment_information =
|
let payment_information =
|
||||||
PaymentInformation::MandatePayment(Box::new(MandatePaymentInformation {
|
PaymentInformation::MandatePayment(Box::new(MandatePaymentInformation {
|
||||||
payment_instrument,
|
payment_instrument,
|
||||||
tokenized_card: MandatePaymentTokenizedCard {
|
tokenized_card,
|
||||||
transaction_type: TransactionType::StoredCredentials,
|
|
||||||
},
|
|
||||||
card: mandate_card_information,
|
card: mandate_card_information,
|
||||||
}));
|
}));
|
||||||
let client_reference_information = ClientReferenceInformation::from(item);
|
let client_reference_information = ClientReferenceInformation::from(item);
|
||||||
|
|||||||
Reference in New Issue
Block a user