Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(connector): [Adyen] Implement Bizum in Bank Redirects (#1589)
Sakil Mostakc654d76660fc
diff --git a/config/development.toml b/config/development.tomlindex a3aafd6060..24a5540ba5 100644--- a/config/development.toml+++ b/config/development.toml@@ -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" }diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex a49a8f00fa..f265af4d90 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -763,6 +763,7 @@ pub enum BankRedirectData {//Required by Stripesbilling_details: Option<BankRedirectBilling>,},+ Bizum {},Blik {// Blik Codeblik_code: String,diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rsindex 5837e1522c..710aa4b486 100644--- a/crates/router/src/connector/adyen/transformers.rs+++ b/crates/router/src/connector/adyen/transformers.rs@@ -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,diff --git a/crates/router/tests/connectors/adyen_uk_ui.rs b/crates/router/tests/connectors/adyen_uk_ui.rsindex 9d24bb8dfe..250ec55a41 100644--- a/crates/router/tests/connectors/adyen_uk_ui.rs+++ b/crates/router/tests/connectors/adyen_uk_ui.rs@@ -171,6 +171,27 @@ async fn should_make_adyen_alipay_hk_payment(c: WebDriver) -> Result<(), WebDrivOk(())}+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_uFpxA0r6jjbVaxHSY3X0BZLL3erDUzvg3i51abwB1Bknu3fdiPxw475DQgnByn1zdiff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.jsonindex 344500a49e..c6d34ef6dd 100644--- a/openapi/openapi_spec.json+++ b/openapi/openapi_spec.json@@ -2337,6 +2337,17 @@}}},+ {+ "type": "object",+ "required": [+ "bizum"+ ],+ "properties": {+ "bizum": {+ "type": "object"+ }+ }+ },{"type": "object","required": [