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(euclid_wasm): checkout wasm metadata issue (#4198)
Jeeva Ramachandran246898fbb00a
diff --git a/crates/connector_configs/src/common_config.rs b/crates/connector_configs/src/common_config.rsindex 2af5b88b33..495c0e5b6c 100644--- a/crates/connector_configs/src/common_config.rs+++ b/crates/connector_configs/src/common_config.rs@@ -82,6 +82,11 @@ pub struct ApiModelMetaData {pub apple_pay: Option<ApplePayData>,pub apple_pay_combined: Option<ApplePayData>,pub endpoint_prefix: Option<String>,+ pub mcc: Option<String>,+ pub merchant_country_code: Option<String>,+ pub merchant_name: Option<String>,+ pub acquirer_bin: Option<String>,+ pub acquirer_merchant_id: Option<String>,}#[serde_with::skip_serializing_none]@@ -175,4 +180,9 @@ pub struct DashboardMetaData {pub apple_pay: Option<ApplePayData>,pub apple_pay_combined: Option<ApplePayData>,pub endpoint_prefix: Option<String>,+ pub mcc: Option<String>,+ pub merchant_country_code: Option<String>,+ pub merchant_name: Option<String>,+ pub acquirer_bin: Option<String>,+ pub acquirer_merchant_id: Option<String>,}diff --git a/crates/connector_configs/src/response_modifier.rs b/crates/connector_configs/src/response_modifier.rsindex 5942a9e01a..6fbf85f4fc 100644--- a/crates/connector_configs/src/response_modifier.rs+++ b/crates/connector_configs/src/response_modifier.rs@@ -1,6 +1,7 @@use crate::common_config::{- CardProvider, ConnectorApiIntegrationPayload, DashboardMetaData, DashboardPaymentMethodPayload,- DashboardRequestPayload, GoogleApiModelData, GooglePayData, GpayDashboardPayLoad, Provider,+ ApiModelMetaData, CardProvider, ConnectorApiIntegrationPayload, DashboardMetaData,+ DashboardPaymentMethodPayload, DashboardRequestPayload, GoogleApiModelData, GooglePayData,+ GpayDashboardPayLoad, Provider,};impl ConnectorApiIntegrationPayload {@@ -275,52 +276,7 @@ impl ConnectorApiIntegrationPayload {card_provider: Some(credit_details),};- let google_pay = Self::get_google_pay_metadata_response(response.clone());- let account_name = match response.metadata.clone() {- Some(meta_data) => meta_data.account_name,- _ => None,- };-- let merchant_account_id = match response.metadata.clone() {- Some(meta_data) => meta_data.merchant_account_id,- _ => None,- };- let merchant_id = match response.metadata.clone() {- Some(meta_data) => meta_data.merchant_id,- _ => None,- };- let terminal_id = match response.metadata.clone() {- Some(meta_data) => meta_data.terminal_id,- _ => None,- };- let endpoint_prefix = match response.metadata.clone() {- Some(meta_data) => meta_data.endpoint_prefix,- _ => None,- };- let apple_pay = match response.metadata.clone() {- Some(meta_data) => meta_data.apple_pay,- _ => None,- };- let apple_pay_combined = match response.metadata.clone() {- Some(meta_data) => meta_data.apple_pay_combined,- _ => None,- };- let merchant_config_currency = match response.metadata.clone() {- Some(meta_data) => meta_data.merchant_config_currency,- _ => None,- };-- let meta_data = DashboardMetaData {- merchant_config_currency,- merchant_account_id,- apple_pay,- apple_pay_combined,- google_pay,- account_name,- terminal_id,- merchant_id,- endpoint_prefix,- };+ let meta_data = response.metadata.map(DashboardMetaData::from);DashboardRequestPayload {connector: response.connector_name,@@ -339,35 +295,52 @@ impl ConnectorApiIntegrationPayload {credit_details,gift_card,]),- metadata: Some(meta_data),+ metadata: meta_data,}}+}- pub fn get_google_pay_metadata_response(response: Self) -> Option<GooglePayData> {- match response.metadata {- Some(meta_data) => {- match meta_data.google_pay {- Some(google_pay) => match google_pay {- GoogleApiModelData::Standard(standard_data) => {- let data = standard_data.allowed_payment_methods.first().map(- |allowed_pm| {- allowed_pm.tokenization_specification.parameters.clone()- },- )?;- Some(GooglePayData::Standard(GpayDashboardPayLoad {- gateway_merchant_id: data.gateway_merchant_id,- stripe_version: data.stripe_version,- stripe_publishable_key: data.stripe_publishable_key,- merchant_name: standard_data.merchant_info.merchant_name,- merchant_id: standard_data.merchant_info.merchant_id,- }))- }- GoogleApiModelData::Zen(data) => Some(GooglePayData::Zen(data)),- },- None => None,- }- }- None => None,+impl From<ApiModelMetaData> for DashboardMetaData {+ fn from(api_model: ApiModelMetaData) -> Self {+ Self {+ merchant_config_currency: api_model.merchant_config_currency,+ merchant_account_id: api_model.merchant_account_id,+ account_name: api_model.account_name,+ terminal_id: api_model.terminal_id,+ merchant_id: api_model.merchant_id,+ google_pay: get_google_pay_metadata_response(api_model.google_pay),+ apple_pay: api_model.apple_pay,+ apple_pay_combined: api_model.apple_pay_combined,+ endpoint_prefix: api_model.endpoint_prefix,+ mcc: api_model.mcc,+ merchant_country_code: api_model.merchant_country_code,+ merchant_name: api_model.merchant_name,+ acquirer_bin: api_model.acquirer_bin,+ acquirer_merchant_id: api_model.acquirer_merchant_id,}}}++pub fn get_google_pay_metadata_response(+ google_pay_data: Option<GoogleApiModelData>,+) -> Option<GooglePayData> {+ match google_pay_data {+ Some(google_pay) => match google_pay {+ GoogleApiModelData::Standard(standard_data) => {+ let data = standard_data+ .allowed_payment_methods+ .first()+ .map(|allowed_pm| allowed_pm.tokenization_specification.parameters.clone())?;+ Some(GooglePayData::Standard(GpayDashboardPayLoad {+ gateway_merchant_id: data.gateway_merchant_id,+ stripe_version: data.stripe_version,+ stripe_publishable_key: data.stripe_publishable_key,+ merchant_name: standard_data.merchant_info.merchant_name,+ merchant_id: standard_data.merchant_info.merchant_id,+ }))+ }+ GoogleApiModelData::Zen(data) => Some(GooglePayData::Zen(data)),+ },+ None => None,+ }+}diff --git a/crates/connector_configs/src/transformer.rs b/crates/connector_configs/src/transformer.rsindex 735178cd67..09a28ac2b0 100644--- a/crates/connector_configs/src/transformer.rs+++ b/crates/connector_configs/src/transformer.rs@@ -187,6 +187,11 @@ impl DashboardRequestPayload {merchant_id: None,merchant_config_currency: None,endpoint_prefix: None,+ mcc: None,+ merchant_country_code: None,+ merchant_name: None,+ acquirer_bin: None,+ acquirer_merchant_id: None,};let meta_data = match request.metadata {Some(data) => data,@@ -201,6 +206,12 @@ impl DashboardRequestPayload {let apple_pay = meta_data.apple_pay;let apple_pay_combined = meta_data.apple_pay_combined;let merchant_config_currency = meta_data.merchant_config_currency;+ let mcc = meta_data.mcc;+ let merchant_country_code = meta_data.merchant_country_code;+ let merchant_name = meta_data.merchant_name;+ let acquirer_bin = meta_data.acquirer_bin;+ let acquirer_merchant_id = meta_data.acquirer_merchant_id;+Some(ApiModelMetaData {google_pay,apple_pay,@@ -211,6 +222,11 @@ impl DashboardRequestPayload {merchant_config_currency,apple_pay_combined,endpoint_prefix,+ mcc,+ merchant_country_code,+ merchant_name,+ acquirer_bin,+ acquirer_merchant_id,})}