mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
feat(connector): [Adyen] Implement Bizum in Bank Redirects (#1589)
Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
@ -239,6 +239,7 @@ ach = {country = "US", currency = "USD"}
|
||||
bacs = {country = "UK", currency = "GBP"}
|
||||
sepa = {country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR"}
|
||||
ali_pay_hk = {country = "HK", currency = "HKD"}
|
||||
bizum = {country = "ES", currency = "EUR"}
|
||||
|
||||
[pm_filters.braintree]
|
||||
paypal = { currency = "AUD,BRL,CAD,CNY,CZK,DKK,EUR,HKD,HUF,ILS,JPY,MYR,MXN,TWD,NZD,NOK,PHP,PLN,GBP,RUB,SGD,SEK,CHF,THB,USD" }
|
||||
|
||||
@ -763,6 +763,7 @@ pub enum BankRedirectData {
|
||||
//Required by Stripes
|
||||
billing_details: Option<BankRedirectBilling>,
|
||||
},
|
||||
Bizum {},
|
||||
Blik {
|
||||
// Blik Code
|
||||
blik_code: String,
|
||||
|
||||
@ -265,6 +265,7 @@ pub enum AdyenPaymentMethod<'a> {
|
||||
AliPayHk(Box<AliPayHkData>),
|
||||
ApplePay(Box<AdyenApplePay>),
|
||||
BancontactCard(Box<BancontactCardData>),
|
||||
Bizum(Box<BankRedirectionPMData>),
|
||||
Blik(Box<BlikRedirectionData>),
|
||||
Eps(Box<BankRedirectionWithIssuer<'a>>),
|
||||
Giropay(Box<BankRedirectionPMData>),
|
||||
@ -677,6 +678,7 @@ pub enum PaymentType {
|
||||
#[serde(rename = "alipay_hk")]
|
||||
AlipayHk,
|
||||
Applepay,
|
||||
Bizum,
|
||||
Blik,
|
||||
Eps,
|
||||
Giropay,
|
||||
@ -1227,6 +1229,11 @@ impl<'a> TryFrom<&api_models::payments::BankRedirectData> for AdyenPaymentMethod
|
||||
.clone(),
|
||||
},
|
||||
))),
|
||||
api_models::payments::BankRedirectData::Bizum { .. } => {
|
||||
Ok(AdyenPaymentMethod::Bizum(Box::new(BankRedirectionPMData {
|
||||
payment_type: PaymentType::Bizum,
|
||||
})))
|
||||
}
|
||||
api_models::payments::BankRedirectData::Blik { blik_code } => {
|
||||
Ok(AdyenPaymentMethod::Blik(Box::new(BlikRedirectionData {
|
||||
payment_type: PaymentType::Blik,
|
||||
|
||||
@ -171,6 +171,27 @@ async fn should_make_adyen_alipay_hk_payment(c: WebDriver) -> Result<(), WebDriv
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn should_make_adyen_bizum_payment(driver: WebDriver) -> Result<(), WebDriverError> {
|
||||
let conn = AdyenSeleniumTest {};
|
||||
conn.make_redirection_payment(
|
||||
driver,
|
||||
vec![
|
||||
Event::Trigger(Trigger::Goto(&format!("{CHEKOUT_BASE_URL}/saved/186"))),
|
||||
Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
|
||||
Event::Trigger(Trigger::SendKeys(By::Id("iPhBizInit"), "700000000")),
|
||||
Event::Trigger(Trigger::Click(By::Id("bBizInit"))),
|
||||
Event::Trigger(Trigger::Click(By::ClassName("btn"))),
|
||||
Event::Assert(Assert::IsPresent("Google")),
|
||||
Event::Assert(Assert::Contains(
|
||||
Selector::QueryParamStr,
|
||||
"status=succeeded",
|
||||
)),
|
||||
],
|
||||
)
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
#[ignore]
|
||||
@ -216,4 +237,10 @@ fn should_make_adyen_alipay_hk_payment_test() {
|
||||
tester!(should_make_adyen_alipay_hk_payment);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn should_make_adyen_bizum_payment_test() {
|
||||
tester!(should_make_adyen_bizum_payment);
|
||||
}
|
||||
|
||||
// https://hs-payments-test.netlify.app/paypal-redirect?amount=70.00&country=US¤cy=USD&mandate_data[customer_acceptance][acceptance_type]=offline&mandate_data[customer_acceptance][accepted_at]=1963-05-03T04:07:52.723Z&mandate_data[customer_acceptance][online][ip_address]=127.0.0.1&mandate_data[customer_acceptance][online][user_agent]=amet%20irure%20esse&mandate_data[mandate_type][multi_use][amount]=700&mandate_data[mandate_type][multi_use][currency]=USD&apikey=dev_uFpxA0r6jjbVaxHSY3X0BZLL3erDUzvg3i51abwB1Bknu3fdiPxw475DQgnByn1z
|
||||
|
||||
@ -2337,6 +2337,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"bizum"
|
||||
],
|
||||
"properties": {
|
||||
"bizum": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
Reference in New Issue
Block a user