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
fix: Passing connector_name instead of ConnectorCallType (#1050)
Manoj Ghorelac888635166be
diff --git a/config/development.toml b/config/development.tomlindex 7ba940bc58..00c5a1228d 100644--- a/config/development.toml+++ b/config/development.toml@@ -220,3 +220,6 @@ region = ""[tokenization]stripe = { long_lived_token = false, payment_method = "wallet" }checkout = { long_lived_token = false, payment_method = "wallet" }++[connector_customer]+connector_list = "stripe"diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rsindex 93c3b8f6da..fbd8dba8ff 100644--- a/crates/router/src/core/payments.rs+++ b/crates/router/src/core/payments.rs@@ -118,7 +118,7 @@ wherelet updated_customer = call_create_connector_customer(state,- &connector,+ &payment_data.payment_attempt.connector.clone(),&customer,&merchant_account,&mut payment_data,@@ -603,7 +603,7 @@ wherepub async fn call_create_connector_customer<F, Req>(state: &AppState,- connector: &Option<api::ConnectorCallType>,+ connector_name: &Option<String>,customer: &Option<storage::Customer>,merchant_account: &storage::MerchantAccount,payment_data: &mut PaymentData<F>,@@ -622,25 +622,22 @@ where// To perform router related operation for PaymentResponsePaymentResponse: Operation<F, Req>,{- match connector {- Some(connector_details) => match connector_details {- api::ConnectorCallType::Single(connector) => {- let router_data = payment_data- .construct_router_data(- state,- connector.connector.id(),- merchant_account,- customer,- )- .await?;- let (connector_customer, customer_update) = router_data- .create_connector_customer(state, connector, customer)- .await?;- payment_data.connector_customer_id = connector_customer;- Ok(customer_update)- }- api::ConnectorCallType::Multiple(_) => Ok(None),- },+ match connector_name {+ Some(connector_name) => {+ let connector = api::ConnectorData::get_connector_by_name(+ &state.conf.connectors,+ connector_name,+ api::GetToken::Connector,+ )?;+ let router_data = payment_data+ .construct_router_data(state, connector.connector.id(), merchant_account, customer)+ .await?;+ let (connector_customer, customer_update) = router_data+ .create_connector_customer(state, &connector, customer)+ .await?;+ payment_data.connector_customer_id = connector_customer;+ Ok(customer_update)+ }None => Ok(None),}}