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
test(connector): [Adyen] Add test for bank debits, bank redirects, and wallets (#1260)
Swangi Kumarieddcc3455b91
diff --git a/crates/router/tests/connectors/adyen_uk_ui.rs b/crates/router/tests/connectors/adyen_uk_ui.rsindex 2ffbd99cbc..fef4026e84 100644--- a/crates/router/tests/connectors/adyen_uk_ui.rs+++ b/crates/router/tests/connectors/adyen_uk_ui.rs@@ -13,27 +13,25 @@ impl SeleniumTest for AdyenSeleniumTest {async fn should_make_adyen_gpay_payment(c: WebDriver) -> Result<(), WebDriverError> {let conn = AdyenSeleniumTest {};- let pub_key = conn.get_configs().adyen_uk.unwrap().key1;conn.make_gpay_payment(c,- &format!("{CHEKOUT_BASE_URL}/gpay?gatewayname=adyen&gatewaymerchantid={pub_key}&amount=70.00&country=US¤cy=USD"),+ &format!("{CHEKOUT_BASE_URL}/gpay?gatewayname=adyen&gatewaymerchantid=JuspayDEECOM&amount=70.00&country=US¤cy=USD"),vec![- Event::Assert(Assert::IsPresent("processing")),+ Event::Assert(Assert::IsPresent("succeeded")),]).await?;Ok(())}async fn should_make_adyen_gpay_mandate_payment(c: WebDriver) -> Result<(), WebDriverError> {let conn = AdyenSeleniumTest {};- let pub_key = conn.get_configs().adyen_uk.unwrap().key1;conn.make_gpay_payment(c,- &format!("{CHEKOUT_BASE_URL}/gpay?gatewayname=adyen&gatewaymerchantid={pub_key}&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]=7000&mandate_data[mandate_type][multi_use][currency]=USD"),+ &format!("{CHEKOUT_BASE_URL}/gpay?gatewayname=adyen&gatewaymerchantid=JuspayDEECOM&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]=7000&mandate_data[mandate_type][multi_use][currency]=USD"),vec![- Event::Assert(Assert::IsPresent("processing")),+ Event::Assert(Assert::IsPresent("succeeded")),Event::Assert(Assert::IsPresent("Mandate ID")),Event::Assert(Assert::IsPresent("man_")),// mandate id starting with man_- Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),+ Event::Trigger(Trigger::Click(By::Id("pm-mandate-btn"))),Event::Trigger(Trigger::Click(By::Id("pay-with-mandate-btn"))),- Event::Assert(Assert::IsPresent("processing")),+ Event::Assert(Assert::IsPresent("succeeded")),]).await?;Ok(())}@@ -42,16 +40,15 @@ async fn should_make_adyen_gpay_zero_dollar_mandate_payment(c: WebDriver,) -> Result<(), WebDriverError> {let conn = AdyenSeleniumTest {};- let pub_key = conn.get_configs().adyen_uk.unwrap().key1;conn.make_gpay_payment(c,- &format!("{CHEKOUT_BASE_URL}/gpay?gatewayname=adyen&gatewaymerchantid={pub_key}&amount=0.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"),+ &format!("{CHEKOUT_BASE_URL}/gpay?gatewayname=adyen&gatewaymerchantid=JuspayDEECOM&amount=0.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"),vec![- Event::Assert(Assert::IsPresent("processing")),+ Event::Assert(Assert::IsPresent("succeeded")),Event::Assert(Assert::IsPresent("Mandate ID")),Event::Assert(Assert::IsPresent("man_")),// mandate id starting with man_- Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),+ Event::Trigger(Trigger::Click(By::Id("pm-mandate-btn"))),Event::Trigger(Trigger::Click(By::Id("pay-with-mandate-btn"))),- Event::Assert(Assert::IsPresent("processing")),+ Event::Assert(Assert::IsPresent("succeeded")),]).await?;Ok(())}@@ -74,12 +71,12 @@ async fn should_make_adyen_klarna_mandate_payment(c: WebDriver) -> Result<(), We]),Event::Trigger(Trigger::SwitchTab(Position::Prev)),- Event::Assert(Assert::IsPresent("processing")),+ Event::Assert(Assert::IsPresent("succeeded")),Event::Assert(Assert::IsPresent("Mandate ID")),Event::Assert(Assert::IsPresent("man_")),// mandate id starting with man_- Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),+ Event::Trigger(Trigger::Click(By::Id("pm-mandate-btn"))),Event::Trigger(Trigger::Click(By::Id("pay-with-mandate-btn"))),- Event::Assert(Assert::IsPresent("processing")),+ Event::Assert(Assert::IsPresent("succeeded")),]).await?;Ok(())}diff --git a/crates/router/tests/connectors/selenium.rs b/crates/router/tests/connectors/selenium.rsindex cbf80299e7..5936350dc8 100644--- a/crates/router/tests/connectors/selenium.rs+++ b/crates/router/tests/connectors/selenium.rs@@ -230,16 +230,18 @@ pub trait SeleniumTest {}Trigger::Click(by) => {let ele = driver.query(by).first().await?;+ ele.wait_until().enabled().await?;ele.wait_until().displayed().await?;ele.wait_until().clickable().await?;- ele.wait_until().enabled().await?;+ ele.scroll_into_view().await?;ele.click().await?;}Trigger::ClickNth(by, n) => {let ele = driver.query(by).all().await?.into_iter().nth(n).unwrap();+ ele.wait_until().enabled().await?;ele.wait_until().displayed().await?;ele.wait_until().clickable().await?;- ele.wait_until().enabled().await?;+ ele.scroll_into_view().await?;ele.click().await?;}Trigger::Find(by) => {diff --git a/crates/router/tests/connectors/stripe_ui.rs b/crates/router/tests/connectors/stripe_ui.rsindex 9fc19d9431..9e7d0cd63d 100644--- a/crates/router/tests/connectors/stripe_ui.rs+++ b/crates/router/tests/connectors/stripe_ui.rs@@ -34,6 +34,7 @@ async fn should_make_3ds_mandate_payment(c: WebDriver) -> Result<(), WebDriverErEvent::Assert(Assert::IsPresent("Mandate ID")),Event::Assert(Assert::IsPresent("man_")),// mandate id starting with man_Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),+ Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),Event::Trigger(Trigger::Click(By::Id("pay-with-mandate-btn"))),Event::Assert(Assert::IsPresent("succeeded")),@@ -53,6 +54,7 @@ async fn should_fail_recurring_payment_due_to_authentication(Event::Assert(Assert::IsPresent("Mandate ID")),Event::Assert(Assert::IsPresent("man_")),// mandate id starting with man_Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),+ Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),Event::Trigger(Trigger::Click(By::Id("pay-with-mandate-btn"))),Event::Assert(Assert::IsPresent("authentication_required: Your card was declined. This transaction requires authentication.")),@@ -72,6 +74,7 @@ async fn should_make_3ds_mandate_with_zero_dollar_payment(Event::Assert(Assert::IsPresent("Mandate ID")),Event::Assert(Assert::IsPresent("man_")),// mandate id starting with man_Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),+ Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),Event::Trigger(Trigger::Click(By::Id("pay-with-mandate-btn"))),// Need to be handled as mentioned in https://stripe.com/docs/payments/save-and-reuse?platform=web#charge-saved-payment-methodEvent::Assert(Assert::IsPresent("succeeded")),