mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat: apple pay through adyen (#62)
Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
committed by
GitHub
parent
bbe30403ed
commit
cd39dd4a99
@ -141,6 +141,7 @@ pub enum AdyenPaymentMethod {
|
|||||||
AdyenCard(AdyenCard),
|
AdyenCard(AdyenCard),
|
||||||
AdyenPaypal(AdyenPaypal),
|
AdyenPaypal(AdyenPaypal),
|
||||||
Gpay(AdyenGPay),
|
Gpay(AdyenGPay),
|
||||||
|
ApplePay(AdyenApplePay),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
@ -185,6 +186,14 @@ pub struct AdyenGPay {
|
|||||||
google_pay_token: String,
|
google_pay_token: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct AdyenApplePay {
|
||||||
|
#[serde(rename = "type")]
|
||||||
|
payment_type: String,
|
||||||
|
#[serde(rename = "applePayToken")]
|
||||||
|
apple_pay_token: String,
|
||||||
|
}
|
||||||
|
|
||||||
// Refunds Request and Response
|
// Refunds Request and Response
|
||||||
#[derive(Default, Debug, Serialize, Deserialize)]
|
#[derive(Default, Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
@ -314,9 +323,17 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for AdyenPaymentRequest {
|
|||||||
};
|
};
|
||||||
Ok(AdyenPaymentMethod::Gpay(gpay_data))
|
Ok(AdyenPaymentMethod::Gpay(gpay_data))
|
||||||
}
|
}
|
||||||
_ => Err(errors::ConnectorError::NotImplemented(
|
enums::WalletIssuer::ApplePay => {
|
||||||
"ApplePay".to_string(),
|
let apple_pay_data = AdyenApplePay {
|
||||||
)),
|
payment_type,
|
||||||
|
apple_pay_token: wallet_data
|
||||||
|
.get_required_value("token")
|
||||||
|
.change_context(errors::ConnectorError::RequestEncodingFailed)?
|
||||||
|
.token
|
||||||
|
.to_string(),
|
||||||
|
};
|
||||||
|
Ok(AdyenPaymentMethod::ApplePay(apple_pay_data))
|
||||||
|
}
|
||||||
},
|
},
|
||||||
enums::PaymentMethodType::Paypal => {
|
enums::PaymentMethodType::Paypal => {
|
||||||
let wallet = AdyenPaypal { payment_type };
|
let wallet = AdyenPaypal { payment_type };
|
||||||
|
|||||||
Reference in New Issue
Block a user