Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- diffs/pr_10061/b7bcc6b/diff.json +39 -0
- diffs/pr_10100/f5e00a5/diff.json +0 -0
- diffs/pr_10119/5767eea/diff.json +0 -0
- diffs/pr_10119/e3a6ab8/diff.json +39 -0
- diffs/pr_10124/1e962ad/diff.json +6 -0
- diffs/pr_10124/5a1e03b/diff.json +6 -0
- diffs/pr_10124/bdb3478/diff.json +8 -0
- diffs/pr_10124/c46e3a7/diff.json +6 -0
- diffs/pr_10254/c2b8610/diff.json +24 -0
- diffs/pr_10278/ccafbf6/diff.json +0 -0
- diffs/pr_6743/28c22aa/diff.json +0 -0
- diffs/pr_6743/34a5f6e/diff.json +0 -0
- diffs/pr_6743/3d8fee7/diff.json +0 -0
- diffs/pr_6799/e84bbac/diff.json +103 -0
- diffs/pr_6836/1cef108/diff.json +97 -0
- diffs/pr_6836/24e7cc5/diff.json +8 -0
- diffs/pr_6836/25111ec/diff.json +0 -0
- diffs/pr_6836/2a72106/diff.json +10 -0
- diffs/pr_6836/2f30119/diff.json +24 -0
- diffs/pr_6836/38cc82e/diff.json +8 -0
- diffs/pr_6836/3cbb5ba/diff.json +39 -0
- diffs/pr_6836/61d7290/diff.json +356 -0
- diffs/pr_6836/b3a0297/diff.json +85 -0
- diffs/pr_6836/bcade37/diff.json +55 -0
- diffs/pr_6836/c12d8ef/diff.json +6 -0
- diffs/pr_6836/e581f1d/diff.json +0 -0
- diffs/pr_6859/0e7922b/diff.json +6 -0
- diffs/pr_6859/249e82b/diff.json +6 -0
- diffs/pr_6859/2e791d5/diff.json +150 -0
- diffs/pr_6859/389ae52/diff.json +6 -0
- diffs/pr_6859/392c044/diff.json +8 -0
- diffs/pr_6859/3c2e034/diff.json +0 -0
- diffs/pr_6859/3cfac70/diff.json +24 -0
- diffs/pr_6859/4f82382/diff.json +6 -0
- diffs/pr_6859/5128445/diff.json +6 -0
- diffs/pr_6859/55029ed/diff.json +0 -0
- diffs/pr_6859/5b1cd69/diff.json +6 -0
- diffs/pr_6859/5b4178b/diff.json +6 -0
- diffs/pr_6859/5d0d9d1/diff.json +25 -0
- diffs/pr_6859/5f694cf/diff.json +0 -0
- diffs/pr_6859/60a60e1/diff.json +8 -0
- diffs/pr_6859/6e4bc87/diff.json +8 -0
- diffs/pr_6859/98b5af4/diff.json +24 -0
- diffs/pr_6859/a0ea8e7/diff.json +6 -0
- diffs/pr_6859/a97f01e/diff.json +6 -0
- diffs/pr_6859/be0ffa9/diff.json +0 -0
- diffs/pr_6859/c6bc417/diff.json +6 -0
- diffs/pr_6859/c7a0b06/diff.json +6 -0
- diffs/pr_6859/ecbee61/diff.json +0 -0
- diffs/pr_6859/edae612/diff.json +6 -0
diffs/pr_10061/b7bcc6b/diff.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "b7bcc6bf9e9eba706f12ecedaf11ec4b9997f2cc",
|
| 3 |
+
"pr_number": 10061,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/router/src/core/refunds.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": [
|
| 8 |
+
{
|
| 9 |
+
"id": "crates/router/src/core/refunds.rs::function::sync_refund_with_gateway",
|
| 10 |
+
"file": "crates/router/src/core/refunds.rs",
|
| 11 |
+
"kind": "function_item",
|
| 12 |
+
"status": "modified",
|
| 13 |
+
"code_changed": true,
|
| 14 |
+
"imports_changed": false,
|
| 15 |
+
"before_code": "pub async fn sync_refund_with_gateway(\n state: &SessionState,\n merchant_context: &domain::MerchantContext,\n payment_attempt: &storage::PaymentAttempt,\n payment_intent: &storage::PaymentIntent,\n refund: &diesel_refund::Refund,\n creds_identifier: Option<String>,\n split_refunds: Option<SplitRefundsRequest>,\n) -> RouterResult<diesel_refund::Refund> {\n let connector_id = refund.connector.to_string();\n let connector: api::ConnectorData = api::ConnectorData::get_connector_by_name(\n &state.conf.connectors,\n &connector_id,\n api::GetToken::Connector,\n payment_attempt.merchant_connector_id.clone(),\n )\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed to get the connector\")?;\n\n let storage_scheme = merchant_context.get_merchant_account().storage_scheme;\n\n let currency = payment_attempt.currency.get_required_value(\"currency\")?;\n\n // Fetch merchant connector account\n let profile_id = payment_intent\n .profile_id\n .as_ref()\n .get_required_value(\"profile_id\")\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"profile_id is not set in payment_intent\")?;\n\n let merchant_connector_account = helpers::get_merchant_connector_account(\n state,\n merchant_context.get_merchant_account().get_id(),\n creds_identifier.as_deref(),\n merchant_context.get_merchant_key_store(),\n profile_id,\n &connector_id,\n payment_attempt.merchant_connector_id.as_ref(),\n )\n .await?;\n\n let mut router_data = core_utils::construct_refund_router_data::<api::RSync>(\n state,\n &connector_id,\n merchant_context,\n (payment_attempt.get_total_amount(), currency),\n payment_intent,\n payment_attempt,\n refund,\n split_refunds,\n &merchant_connector_account,\n )\n .await?;\n\n // Add access token for both UCS and direct connector paths\n let add_access_token_result = Box::pin(access_token::add_access_token(\n state,\n &connector,\n &router_data,\n creds_identifier.as_deref(),\n ))\n .await?;\n\n logger::debug!(refund_retrieve_router_data=?router_data);\n\n access_token::update_router_data_with_access_token_result(\n &add_access_token_result,\n &mut router_data,\n &payments::CallConnectorAction::Trigger,\n );\n\n // Common access token handling for all flows\n let router_data_res = if !(add_access_token_result.connector_supports_access_token\n && router_data.access_token.is_none())\n {\n // Access token available or not needed - proceed with execution\n\n // Check which gateway system to use for refund sync\n let (execution_path, _session_state) =\n unified_connector_service::should_call_unified_connector_service(\n state,\n merchant_context,\n &router_data,\n None::<&payments::PaymentData<api::RSync>>, // No payment data for refunds\n payments::CallConnectorAction::Trigger,\n )\n .await?;\n\n router_env::logger::info!(\n refund_id = router_data.request.refund_id,\n execution_path = ?execution_path,\n \"Executing refund sync via {execution_path:?}\"\n );\n\n // Execute refund sync based on gateway system decision\n match execution_path {\n common_enums::ExecutionPath::UnifiedConnectorService => {\n unified_connector_service::call_unified_connector_service_for_refund_sync(\n state,\n merchant_context,\n router_data.clone(),\n ExecutionMode::Primary,\n merchant_connector_account,\n )\n .await\n .attach_printable(format!(\n \"UCS refund sync failed for connector: {}, refund_id: {}\",\n connector.connector_name, router_data.request.refund_id\n ))?\n }\n common_enums::ExecutionPath::Direct => {\n Box::pin(execute_refund_sync_via_direct(\n state,\n &connector,\n router_data,\n ))\n .await?\n }\n common_enums::ExecutionPath::ShadowUnifiedConnectorService => {\n Box::pin(execute_refund_sync_via_direct_with_ucs_shadow(\n state,\n &connector,\n merchant_context,\n router_data,\n merchant_connector_account,\n ))\n .await?\n }\n }\n } else {\n // Access token needed but not available - return error router_data\n router_data\n };\n\n let refund_update = match router_data_res.response {\n Err(error_message) => {\n let refund_status = match error_message.status_code {\n // marking failure for 2xx because this is genuine refund failure\n 200..=299 => Some(enums::RefundStatus::Failure),\n _ => None,\n };\n diesel_refund::RefundUpdate::ErrorUpdate {\n refund_status,\n refund_error_message: error_message.reason.or(Some(error_message.message)),\n refund_error_code: Some(error_message.code),\n updated_by: storage_scheme.to_string(),\n connector_refund_id: None,\n processor_refund_data: None,\n unified_code: None,\n unified_message: None,\n issuer_error_code: error_message.network_decline_code,\n issuer_error_message: error_message.network_error_message,\n }\n }\n Ok(response) => match router_data_res.integrity_check.clone() {\n Err(err) => {\n metrics::INTEGRITY_CHECK_FAILED.add(\n 1,\n router_env::metric_attributes!(\n (\"connector\", connector.connector_name.to_string()),\n (\n \"merchant_id\",\n merchant_context.get_merchant_account().get_id().clone()\n ),\n ),\n );\n let (refund_connector_transaction_id, processor_refund_data) = err\n .connector_transaction_id\n .map_or((None, None), |refund_id| {\n let (refund_id, refund_data) =\n ConnectorTransactionId::form_id_and_data(refund_id);\n (Some(refund_id), refund_data)\n });\n diesel_refund::RefundUpdate::ErrorUpdate {\n refund_status: Some(enums::RefundStatus::ManualReview),\n refund_error_message: Some(format!(\n \"Integrity Check Failed! as data mismatched for fields {}\",\n err.field_names\n )),\n refund_error_code: Some(\"IE\".to_string()),\n updated_by: storage_scheme.to_string(),\n connector_refund_id: refund_connector_transaction_id,\n processor_refund_data,\n unified_code: None,\n unified_message: None,\n issuer_error_code: None,\n issuer_error_message: None,\n }\n }\n Ok(()) => {\n let (connector_refund_id, processor_refund_data) =\n ConnectorTransactionId::form_id_and_data(response.connector_refund_id);\n diesel_refund::RefundUpdate::Update {\n connector_refund_id,\n refund_status: response.refund_status,\n sent_to_gateway: true,\n refund_error_message: None,\n refund_arn: \"\".to_string(),\n updated_by: storage_scheme.to_string(),\n processor_refund_data,\n }\n }\n },\n };\n\n let response = state\n .store\n .update_refund(\n refund.to_owned(),\n refund_update,\n merchant_context.get_merchant_account().storage_scheme,\n )\n .await\n .to_not_found_response(errors::ApiErrorResponse::RefundNotFound)\n .attach_printable_lazy(|| {\n format!(\n \"Unable to update refund with refund_id: {}\",\n refund.refund_id\n )\n })?;\n utils::trigger_refund_outgoing_webhook(\n state,\n merchant_context,\n &response,\n payment_attempt.profile_id.clone(),\n )\n .await\n .map_err(|error| logger::warn!(refunds_outgoing_webhook_error=?error))\n .ok();\n Ok(response)\n}",
|
| 16 |
+
"after_code": "pub async fn sync_refund_with_gateway(\n state: &SessionState,\n merchant_context: &domain::MerchantContext,\n payment_attempt: &storage::PaymentAttempt,\n payment_intent: &storage::PaymentIntent,\n refund: &diesel_refund::Refund,\n creds_identifier: Option<String>,\n split_refunds: Option<SplitRefundsRequest>,\n) -> RouterResult<diesel_refund::Refund> {\n let connector_id = refund.connector.to_string();\n let connector: api::ConnectorData = api::ConnectorData::get_connector_by_name(\n &state.conf.connectors,\n &connector_id,\n api::GetToken::Connector,\n payment_attempt.merchant_connector_id.clone(),\n )\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed to get the connector\")?;\n\n let storage_scheme = merchant_context.get_merchant_account().storage_scheme;\n\n let currency = payment_attempt.currency.get_required_value(\"currency\")?;\n\n // Fetch merchant connector account\n let profile_id = payment_intent\n .profile_id\n .as_ref()\n .get_required_value(\"profile_id\")\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"profile_id is not set in payment_intent\")?;\n\n let merchant_connector_account = helpers::get_merchant_connector_account(\n state,\n merchant_context.get_merchant_account().get_id(),\n creds_identifier.as_deref(),\n merchant_context.get_merchant_key_store(),\n profile_id,\n &connector_id,\n payment_attempt.merchant_connector_id.as_ref(),\n )\n .await?;\n\n let mut router_data = core_utils::construct_refund_router_data::<api::RSync>(\n state,\n &connector_id,\n merchant_context,\n (payment_attempt.get_total_amount(), currency),\n payment_intent,\n payment_attempt,\n refund,\n split_refunds,\n &merchant_connector_account,\n )\n .await?;\n\n // Add access token for both UCS and direct connector paths\n let add_access_token_result = Box::pin(access_token::add_access_token(\n state,\n &connector,\n &router_data,\n creds_identifier.as_deref(),\n ))\n .await?;\n\n logger::debug!(refund_retrieve_router_data=?router_data);\n\n access_token::update_router_data_with_access_token_result(\n &add_access_token_result,\n &mut router_data,\n &payments::CallConnectorAction::Trigger,\n );\n\n // Common access token handling for all flows\n let router_data_res = if !(add_access_token_result.connector_supports_access_token\n && router_data.access_token.is_none())\n {\n // Access token available or not needed - proceed with execution\n\n // Check which gateway system to use for refund sync\n let (execution_path, updated_state) =\n unified_connector_service::should_call_unified_connector_service(\n state,\n merchant_context,\n &router_data,\n None::<&payments::PaymentData<api::RSync>>, // No payment data for refunds\n payments::CallConnectorAction::Trigger,\n )\n .await?;\n\n router_env::logger::info!(\n refund_id = router_data.request.refund_id,\n execution_path = ?execution_path,\n \"Executing refund sync via {execution_path:?}\"\n );\n\n // Execute refund sync based on gateway system decision\n match execution_path {\n common_enums::ExecutionPath::UnifiedConnectorService => {\n unified_connector_service::call_unified_connector_service_for_refund_sync(\n state,\n merchant_context,\n router_data.clone(),\n ExecutionMode::Primary,\n merchant_connector_account,\n )\n .await\n .attach_printable(format!(\n \"UCS refund sync failed for connector: {}, refund_id: {}\",\n connector.connector_name, router_data.request.refund_id\n ))?\n }\n common_enums::ExecutionPath::Direct => {\n Box::pin(execute_refund_sync_via_direct(\n state,\n &connector,\n router_data,\n ))\n .await?\n }\n common_enums::ExecutionPath::ShadowUnifiedConnectorService => {\n Box::pin(execute_refund_sync_via_direct_with_ucs_shadow(\n &updated_state,\n &connector,\n merchant_context,\n router_data,\n merchant_connector_account,\n ))\n .await?\n }\n }\n } else {\n // Access token needed but not available - return error router_data\n router_data\n };\n\n let refund_update = match router_data_res.response {\n Err(error_message) => {\n let refund_status = match error_message.status_code {\n // marking failure for 2xx because this is genuine refund failure\n 200..=299 => Some(enums::RefundStatus::Failure),\n _ => None,\n };\n diesel_refund::RefundUpdate::ErrorUpdate {\n refund_status,\n refund_error_message: error_message.reason.or(Some(error_message.message)),\n refund_error_code: Some(error_message.code),\n updated_by: storage_scheme.to_string(),\n connector_refund_id: None,\n processor_refund_data: None,\n unified_code: None,\n unified_message: None,\n issuer_error_code: error_message.network_decline_code,\n issuer_error_message: error_message.network_error_message,\n }\n }\n Ok(response) => match router_data_res.integrity_check.clone() {\n Err(err) => {\n metrics::INTEGRITY_CHECK_FAILED.add(\n 1,\n router_env::metric_attributes!(\n (\"connector\", connector.connector_name.to_string()),\n (\n \"merchant_id\",\n merchant_context.get_merchant_account().get_id().clone()\n ),\n ),\n );\n let (refund_connector_transaction_id, processor_refund_data) = err\n .connector_transaction_id\n .map_or((None, None), |refund_id| {\n let (refund_id, refund_data) =\n ConnectorTransactionId::form_id_and_data(refund_id);\n (Some(refund_id), refund_data)\n });\n diesel_refund::RefundUpdate::ErrorUpdate {\n refund_status: Some(enums::RefundStatus::ManualReview),\n refund_error_message: Some(format!(\n \"Integrity Check Failed! as data mismatched for fields {}\",\n err.field_names\n )),\n refund_error_code: Some(\"IE\".to_string()),\n updated_by: storage_scheme.to_string(),\n connector_refund_id: refund_connector_transaction_id,\n processor_refund_data,\n unified_code: None,\n unified_message: None,\n issuer_error_code: None,\n issuer_error_message: None,\n }\n }\n Ok(()) => {\n let (connector_refund_id, processor_refund_data) =\n ConnectorTransactionId::form_id_and_data(response.connector_refund_id);\n diesel_refund::RefundUpdate::Update {\n connector_refund_id,\n refund_status: response.refund_status,\n sent_to_gateway: true,\n refund_error_message: None,\n refund_arn: \"\".to_string(),\n updated_by: storage_scheme.to_string(),\n processor_refund_data,\n }\n }\n },\n };\n\n let response = state\n .store\n .update_refund(\n refund.to_owned(),\n refund_update,\n merchant_context.get_merchant_account().storage_scheme,\n )\n .await\n .to_not_found_response(errors::ApiErrorResponse::RefundNotFound)\n .attach_printable_lazy(|| {\n format!(\n \"Unable to update refund with refund_id: {}\",\n refund.refund_id\n )\n })?;\n utils::trigger_refund_outgoing_webhook(\n state,\n merchant_context,\n &response,\n payment_attempt.profile_id.clone(),\n )\n .await\n .map_err(|error| logger::warn!(refunds_outgoing_webhook_error=?error))\n .ok();\n Ok(response)\n}",
|
| 17 |
+
"diff_span": {
|
| 18 |
+
"before": "\n // Check which gateway system to use for refund sync\n let (execution_path, _session_state) =\n unified_connector_service::should_call_unified_connector_service(\n state,\n merchant_context,\n &router_data,\n None::<&payments::PaymentData<api::RSync>>, // No payment data for refunds\n payments::CallConnectorAction::Trigger,\n )\n .await?;\n\n router_env::logger::info!(\n refund_id = router_data.request.refund_id,\n execution_path = ?execution_path,\n \"Executing refund sync via {execution_path:?}\"\n );\n\n // Execute refund sync based on gateway system decision\n match execution_path {\n common_enums::ExecutionPath::UnifiedConnectorService => {\n unified_connector_service::call_unified_connector_service_for_refund_sync(\n state,\n merchant_context,\n router_data.clone(),\n ExecutionMode::Primary,\n merchant_connector_account,\n )\n .await\n .attach_printable(format!(\n \"UCS refund sync failed for connector: {}, refund_id: {}\",\n connector.connector_name, router_data.request.refund_id\n ))?\n }\n common_enums::ExecutionPath::Direct => {\n Box::pin(execute_refund_sync_via_direct(\n state,\n &connector,\n router_data,\n ))\n .await?\n }\n common_enums::ExecutionPath::ShadowUnifiedConnectorService => {\n Box::pin(execute_refund_sync_via_direct_with_ucs_shadow(\n state,\n &connector,\n merchant_context,",
|
| 19 |
+
"after": "\n // Check which gateway system to use for refund sync\n let (execution_path, updated_state) =\n unified_connector_service::should_call_unified_connector_service(\n state,\n merchant_context,\n &router_data,\n None::<&payments::PaymentData<api::RSync>>, // No payment data for refunds\n payments::CallConnectorAction::Trigger,\n )\n .await?;\n\n router_env::logger::info!(\n refund_id = router_data.request.refund_id,\n execution_path = ?execution_path,\n \"Executing refund sync via {execution_path:?}\"\n );\n\n // Execute refund sync based on gateway system decision\n match execution_path {\n common_enums::ExecutionPath::UnifiedConnectorService => {\n unified_connector_service::call_unified_connector_service_for_refund_sync(\n state,\n merchant_context,\n router_data.clone(),\n ExecutionMode::Primary,\n merchant_connector_account,\n )\n .await\n .attach_printable(format!(\n \"UCS refund sync failed for connector: {}, refund_id: {}\",\n connector.connector_name, router_data.request.refund_id\n ))?\n }\n common_enums::ExecutionPath::Direct => {\n Box::pin(execute_refund_sync_via_direct(\n state,\n &connector,\n router_data,\n ))\n .await?\n }\n common_enums::ExecutionPath::ShadowUnifiedConnectorService => {\n Box::pin(execute_refund_sync_via_direct_with_ucs_shadow(\n &updated_state,\n &connector,\n merchant_context,"
|
| 20 |
+
},
|
| 21 |
+
"commit_sha": "b7bcc6bf9e9eba706f12ecedaf11ec4b9997f2cc"
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"id": "crates/router/src/core/refunds.rs::function::trigger_refund_to_gateway",
|
| 25 |
+
"file": "crates/router/src/core/refunds.rs",
|
| 26 |
+
"kind": "function_item",
|
| 27 |
+
"status": "modified",
|
| 28 |
+
"code_changed": true,
|
| 29 |
+
"imports_changed": false,
|
| 30 |
+
"before_code": "pub async fn trigger_refund_to_gateway(\n state: &SessionState,\n refund: &diesel_refund::Refund,\n merchant_context: &domain::MerchantContext,\n payment_attempt: &storage::PaymentAttempt,\n payment_intent: &storage::PaymentIntent,\n creds_identifier: Option<String>,\n split_refunds: Option<SplitRefundsRequest>,\n) -> RouterResult<diesel_refund::Refund> {\n let routed_through = payment_attempt\n .connector\n .clone()\n .ok_or(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed to retrieve connector from payment attempt\")?;\n\n let storage_scheme = merchant_context.get_merchant_account().storage_scheme;\n metrics::REFUND_COUNT.add(\n 1,\n router_env::metric_attributes!((\"connector\", routed_through.clone())),\n );\n\n let connector: api::ConnectorData = api::ConnectorData::get_connector_by_name(\n &state.conf.connectors,\n &routed_through,\n api::GetToken::Connector,\n payment_attempt.merchant_connector_id.clone(),\n )?;\n\n let currency = payment_attempt.currency.ok_or_else(|| {\n report!(errors::ApiErrorResponse::InternalServerError).attach_printable(\n \"Transaction in invalid. Missing field \\\"currency\\\" in payment_attempt.\",\n )\n })?;\n\n validator::validate_for_valid_refunds(payment_attempt, connector.connector_name)?;\n\n // Fetch merchant connector account\n let profile_id = payment_intent\n .profile_id\n .as_ref()\n .get_required_value(\"profile_id\")\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"profile_id is not set in payment_intent\")?;\n\n let merchant_connector_account = helpers::get_merchant_connector_account(\n state,\n merchant_context.get_merchant_account().get_id(),\n creds_identifier.as_deref(),\n merchant_context.get_merchant_key_store(),\n profile_id,\n &routed_through,\n payment_attempt.merchant_connector_id.as_ref(),\n )\n .await?;\n\n let mut router_data = core_utils::construct_refund_router_data(\n state,\n &routed_through,\n merchant_context,\n (payment_attempt.get_total_amount(), currency),\n payment_intent,\n payment_attempt,\n refund,\n split_refunds,\n &merchant_connector_account,\n )\n .await?;\n\n // Add access token for both UCS and direct connector paths\n let add_access_token_result = Box::pin(access_token::add_access_token(\n state,\n &connector,\n &router_data,\n creds_identifier.as_deref(),\n ))\n .await?;\n\n logger::debug!(refund_router_data=?router_data);\n\n access_token::update_router_data_with_access_token_result(\n &add_access_token_result,\n &mut router_data,\n &payments::CallConnectorAction::Trigger,\n );\n\n // Common access token handling for all flows\n let router_data_res = if !(add_access_token_result.connector_supports_access_token\n && router_data.access_token.is_none())\n {\n // Access token available or not needed - proceed with execution\n\n // Check which gateway system to use for refunds\n let (execution_path, _session_state) =\n unified_connector_service::should_call_unified_connector_service(\n state,\n merchant_context,\n &router_data,\n None::<&payments::PaymentData<api::Execute>>, // No payment data for refunds\n payments::CallConnectorAction::Trigger,\n )\n .await?;\n\n router_env::logger::info!(\n refund_id = refund.refund_id,\n execution_path = ?execution_path,\n \"Executing refund via {execution_path:?}\"\n );\n\n // Execute refund based on gateway system decision\n match execution_path {\n common_enums::ExecutionPath::UnifiedConnectorService => {\n unified_connector_service::call_unified_connector_service_for_refund_execute(\n state,\n merchant_context,\n router_data.clone(),\n ExecutionMode::Primary,\n merchant_connector_account,\n )\n .await\n .attach_printable(format!(\n \"UCS refund execution failed for connector: {}, refund_id: {}\",\n connector.connector_name, router_data.request.refund_id\n ))?\n }\n common_enums::ExecutionPath::Direct => {\n Box::pin(execute_refund_execute_via_direct(\n state,\n &connector,\n merchant_context,\n refund,\n router_data,\n ))\n .await?\n }\n common_enums::ExecutionPath::ShadowUnifiedConnectorService => {\n Box::pin(execute_refund_execute_via_direct_with_ucs_shadow(\n state,\n &connector,\n merchant_context,\n refund,\n router_data,\n merchant_connector_account.clone(),\n ))\n .await?\n }\n }\n } else {\n // Access token needed but not available - return error router_data\n router_data\n };\n\n let refund_update = match router_data_res.response {\n Err(err) => {\n let option_gsm = helpers::get_gsm_record(\n state,\n Some(err.code.clone()),\n Some(err.message.clone()),\n connector.connector_name.to_string(),\n consts::REFUND_FLOW_STR.to_string(),\n )\n .await;\n // Note: Some connectors do not have a separate list of refund errors\n // In such cases, the error codes and messages are stored under \"Authorize\" flow in GSM table\n // So we will have to fetch the GSM using Authorize flow in case GSM is not found using \"refund_flow\"\n let option_gsm = if option_gsm.is_none() {\n helpers::get_gsm_record(\n state,\n Some(err.code.clone()),\n Some(err.message.clone()),\n connector.connector_name.to_string(),\n consts::AUTHORIZE_FLOW_STR.to_string(),\n )\n .await\n } else {\n option_gsm\n };\n\n let gsm_unified_code = option_gsm.as_ref().and_then(|gsm| gsm.unified_code.clone());\n let gsm_unified_message = option_gsm.and_then(|gsm| gsm.unified_message);\n\n let (unified_code, unified_message) = if let Some((code, message)) =\n gsm_unified_code.as_ref().zip(gsm_unified_message.as_ref())\n {\n (code.to_owned(), message.to_owned())\n } else {\n (\n consts::DEFAULT_UNIFIED_ERROR_CODE.to_owned(),\n consts::DEFAULT_UNIFIED_ERROR_MESSAGE.to_owned(),\n )\n };\n\n diesel_refund::RefundUpdate::ErrorUpdate {\n refund_status: Some(enums::RefundStatus::Failure),\n refund_error_message: err.reason.or(Some(err.message)),\n refund_error_code: Some(err.code),\n updated_by: storage_scheme.to_string(),\n connector_refund_id: None,\n processor_refund_data: None,\n unified_code: Some(unified_code),\n unified_message: Some(unified_message),\n issuer_error_code: err.network_decline_code,\n issuer_error_message: err.network_error_message,\n }\n }\n Ok(response) => {\n // match on connector integrity checks\n match router_data_res.integrity_check.clone() {\n Err(err) => {\n let (refund_connector_transaction_id, processor_refund_data) =\n err.connector_transaction_id.map_or((None, None), |txn_id| {\n let (refund_id, refund_data) =\n ConnectorTransactionId::form_id_and_data(txn_id);\n (Some(refund_id), refund_data)\n });\n metrics::INTEGRITY_CHECK_FAILED.add(\n 1,\n router_env::metric_attributes!(\n (\"connector\", connector.connector_name.to_string()),\n (\n \"merchant_id\",\n merchant_context.get_merchant_account().get_id().clone()\n ),\n ),\n );\n diesel_refund::RefundUpdate::ErrorUpdate {\n refund_status: Some(enums::RefundStatus::ManualReview),\n refund_error_message: Some(format!(\n \"Integrity Check Failed! as data mismatched for fields {}\",\n err.field_names\n )),\n refund_error_code: Some(\"IE\".to_string()),\n updated_by: storage_scheme.to_string(),\n connector_refund_id: refund_connector_transaction_id,\n processor_refund_data,\n unified_code: None,\n unified_message: None,\n issuer_error_code: None,\n issuer_error_message: None,\n }\n }\n Ok(()) => {\n if response.refund_status == diesel_models::enums::RefundStatus::Success {\n metrics::SUCCESSFUL_REFUND.add(\n 1,\n router_env::metric_attributes!((\n \"connector\",\n connector.connector_name.to_string(),\n )),\n )\n }\n let (connector_refund_id, processor_refund_data) =\n ConnectorTransactionId::form_id_and_data(response.connector_refund_id);\n diesel_refund::RefundUpdate::Update {\n connector_refund_id,\n refund_status: response.refund_status,\n sent_to_gateway: true,\n refund_error_message: None,\n refund_arn: \"\".to_string(),\n updated_by: storage_scheme.to_string(),\n processor_refund_data,\n }\n }\n }\n }\n };\n\n let response = state\n .store\n .update_refund(\n refund.to_owned(),\n refund_update,\n merchant_context.get_merchant_account().storage_scheme,\n )\n .await\n .to_not_found_response(errors::ApiErrorResponse::InternalServerError)\n .attach_printable_lazy(|| {\n format!(\n \"Failed while updating refund: refund_id: {}\",\n refund.refund_id\n )\n })?;\n utils::trigger_refund_outgoing_webhook(\n state,\n merchant_context,\n &response,\n payment_attempt.profile_id.clone(),\n )\n .await\n .map_err(|error| logger::warn!(refunds_outgoing_webhook_error=?error))\n .ok();\n Ok(response)\n}",
|
| 31 |
+
"after_code": "pub async fn trigger_refund_to_gateway(\n state: &SessionState,\n refund: &diesel_refund::Refund,\n merchant_context: &domain::MerchantContext,\n payment_attempt: &storage::PaymentAttempt,\n payment_intent: &storage::PaymentIntent,\n creds_identifier: Option<String>,\n split_refunds: Option<SplitRefundsRequest>,\n) -> RouterResult<diesel_refund::Refund> {\n let routed_through = payment_attempt\n .connector\n .clone()\n .ok_or(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed to retrieve connector from payment attempt\")?;\n\n let storage_scheme = merchant_context.get_merchant_account().storage_scheme;\n metrics::REFUND_COUNT.add(\n 1,\n router_env::metric_attributes!((\"connector\", routed_through.clone())),\n );\n\n let connector: api::ConnectorData = api::ConnectorData::get_connector_by_name(\n &state.conf.connectors,\n &routed_through,\n api::GetToken::Connector,\n payment_attempt.merchant_connector_id.clone(),\n )?;\n\n let currency = payment_attempt.currency.ok_or_else(|| {\n report!(errors::ApiErrorResponse::InternalServerError).attach_printable(\n \"Transaction in invalid. Missing field \\\"currency\\\" in payment_attempt.\",\n )\n })?;\n\n validator::validate_for_valid_refunds(payment_attempt, connector.connector_name)?;\n\n // Fetch merchant connector account\n let profile_id = payment_intent\n .profile_id\n .as_ref()\n .get_required_value(\"profile_id\")\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"profile_id is not set in payment_intent\")?;\n\n let merchant_connector_account = helpers::get_merchant_connector_account(\n state,\n merchant_context.get_merchant_account().get_id(),\n creds_identifier.as_deref(),\n merchant_context.get_merchant_key_store(),\n profile_id,\n &routed_through,\n payment_attempt.merchant_connector_id.as_ref(),\n )\n .await?;\n\n let mut router_data = core_utils::construct_refund_router_data(\n state,\n &routed_through,\n merchant_context,\n (payment_attempt.get_total_amount(), currency),\n payment_intent,\n payment_attempt,\n refund,\n split_refunds,\n &merchant_connector_account,\n )\n .await?;\n\n // Add access token for both UCS and direct connector paths\n let add_access_token_result = Box::pin(access_token::add_access_token(\n state,\n &connector,\n &router_data,\n creds_identifier.as_deref(),\n ))\n .await?;\n\n logger::debug!(refund_router_data=?router_data);\n\n access_token::update_router_data_with_access_token_result(\n &add_access_token_result,\n &mut router_data,\n &payments::CallConnectorAction::Trigger,\n );\n\n // Common access token handling for all flows\n let router_data_res = if !(add_access_token_result.connector_supports_access_token\n && router_data.access_token.is_none())\n {\n // Access token available or not needed - proceed with execution\n\n // Check which gateway system to use for refunds\n let (execution_path, updated_state) =\n unified_connector_service::should_call_unified_connector_service(\n state,\n merchant_context,\n &router_data,\n None::<&payments::PaymentData<api::Execute>>, // No payment data for refunds\n payments::CallConnectorAction::Trigger,\n )\n .await?;\n\n router_env::logger::info!(\n refund_id = refund.refund_id,\n execution_path = ?execution_path,\n \"Executing refund via {execution_path:?}\"\n );\n\n // Execute refund based on gateway system decision\n match execution_path {\n common_enums::ExecutionPath::UnifiedConnectorService => {\n unified_connector_service::call_unified_connector_service_for_refund_execute(\n state,\n merchant_context,\n router_data.clone(),\n ExecutionMode::Primary,\n merchant_connector_account,\n )\n .await\n .attach_printable(format!(\n \"UCS refund execution failed for connector: {}, refund_id: {}\",\n connector.connector_name, router_data.request.refund_id\n ))?\n }\n common_enums::ExecutionPath::Direct => {\n Box::pin(execute_refund_execute_via_direct(\n state,\n &connector,\n merchant_context,\n refund,\n router_data,\n ))\n .await?\n }\n common_enums::ExecutionPath::ShadowUnifiedConnectorService => {\n Box::pin(execute_refund_execute_via_direct_with_ucs_shadow(\n &updated_state,\n &connector,\n merchant_context,\n refund,\n router_data,\n merchant_connector_account.clone(),\n ))\n .await?\n }\n }\n } else {\n // Access token needed but not available - return error router_data\n router_data\n };\n\n let refund_update = match router_data_res.response {\n Err(err) => {\n let option_gsm = helpers::get_gsm_record(\n state,\n Some(err.code.clone()),\n Some(err.message.clone()),\n connector.connector_name.to_string(),\n consts::REFUND_FLOW_STR.to_string(),\n )\n .await;\n // Note: Some connectors do not have a separate list of refund errors\n // In such cases, the error codes and messages are stored under \"Authorize\" flow in GSM table\n // So we will have to fetch the GSM using Authorize flow in case GSM is not found using \"refund_flow\"\n let option_gsm = if option_gsm.is_none() {\n helpers::get_gsm_record(\n state,\n Some(err.code.clone()),\n Some(err.message.clone()),\n connector.connector_name.to_string(),\n consts::AUTHORIZE_FLOW_STR.to_string(),\n )\n .await\n } else {\n option_gsm\n };\n\n let gsm_unified_code = option_gsm.as_ref().and_then(|gsm| gsm.unified_code.clone());\n let gsm_unified_message = option_gsm.and_then(|gsm| gsm.unified_message);\n\n let (unified_code, unified_message) = if let Some((code, message)) =\n gsm_unified_code.as_ref().zip(gsm_unified_message.as_ref())\n {\n (code.to_owned(), message.to_owned())\n } else {\n (\n consts::DEFAULT_UNIFIED_ERROR_CODE.to_owned(),\n consts::DEFAULT_UNIFIED_ERROR_MESSAGE.to_owned(),\n )\n };\n\n diesel_refund::RefundUpdate::ErrorUpdate {\n refund_status: Some(enums::RefundStatus::Failure),\n refund_error_message: err.reason.or(Some(err.message)),\n refund_error_code: Some(err.code),\n updated_by: storage_scheme.to_string(),\n connector_refund_id: None,\n processor_refund_data: None,\n unified_code: Some(unified_code),\n unified_message: Some(unified_message),\n issuer_error_code: err.network_decline_code,\n issuer_error_message: err.network_error_message,\n }\n }\n Ok(response) => {\n // match on connector integrity checks\n match router_data_res.integrity_check.clone() {\n Err(err) => {\n let (refund_connector_transaction_id, processor_refund_data) =\n err.connector_transaction_id.map_or((None, None), |txn_id| {\n let (refund_id, refund_data) =\n ConnectorTransactionId::form_id_and_data(txn_id);\n (Some(refund_id), refund_data)\n });\n metrics::INTEGRITY_CHECK_FAILED.add(\n 1,\n router_env::metric_attributes!(\n (\"connector\", connector.connector_name.to_string()),\n (\n \"merchant_id\",\n merchant_context.get_merchant_account().get_id().clone()\n ),\n ),\n );\n diesel_refund::RefundUpdate::ErrorUpdate {\n refund_status: Some(enums::RefundStatus::ManualReview),\n refund_error_message: Some(format!(\n \"Integrity Check Failed! as data mismatched for fields {}\",\n err.field_names\n )),\n refund_error_code: Some(\"IE\".to_string()),\n updated_by: storage_scheme.to_string(),\n connector_refund_id: refund_connector_transaction_id,\n processor_refund_data,\n unified_code: None,\n unified_message: None,\n issuer_error_code: None,\n issuer_error_message: None,\n }\n }\n Ok(()) => {\n if response.refund_status == diesel_models::enums::RefundStatus::Success {\n metrics::SUCCESSFUL_REFUND.add(\n 1,\n router_env::metric_attributes!((\n \"connector\",\n connector.connector_name.to_string(),\n )),\n )\n }\n let (connector_refund_id, processor_refund_data) =\n ConnectorTransactionId::form_id_and_data(response.connector_refund_id);\n diesel_refund::RefundUpdate::Update {\n connector_refund_id,\n refund_status: response.refund_status,\n sent_to_gateway: true,\n refund_error_message: None,\n refund_arn: \"\".to_string(),\n updated_by: storage_scheme.to_string(),\n processor_refund_data,\n }\n }\n }\n }\n };\n\n let response = state\n .store\n .update_refund(\n refund.to_owned(),\n refund_update,\n merchant_context.get_merchant_account().storage_scheme,\n )\n .await\n .to_not_found_response(errors::ApiErrorResponse::InternalServerError)\n .attach_printable_lazy(|| {\n format!(\n \"Failed while updating refund: refund_id: {}\",\n refund.refund_id\n )\n })?;\n utils::trigger_refund_outgoing_webhook(\n state,\n merchant_context,\n &response,\n payment_attempt.profile_id.clone(),\n )\n .await\n .map_err(|error| logger::warn!(refunds_outgoing_webhook_error=?error))\n .ok();\n Ok(response)\n}",
|
| 32 |
+
"diff_span": {
|
| 33 |
+
"before": "\n // Check which gateway system to use for refunds\n let (execution_path, _session_state) =\n unified_connector_service::should_call_unified_connector_service(\n state,\n merchant_context,\n &router_data,\n None::<&payments::PaymentData<api::Execute>>, // No payment data for refunds\n payments::CallConnectorAction::Trigger,\n )\n .await?;\n\n router_env::logger::info!(\n refund_id = refund.refund_id,\n execution_path = ?execution_path,\n \"Executing refund via {execution_path:?}\"\n );\n\n // Execute refund based on gateway system decision\n match execution_path {\n common_enums::ExecutionPath::UnifiedConnectorService => {\n unified_connector_service::call_unified_connector_service_for_refund_execute(\n state,\n merchant_context,\n router_data.clone(),\n ExecutionMode::Primary,\n merchant_connector_account,\n )\n .await\n .attach_printable(format!(\n \"UCS refund execution failed for connector: {}, refund_id: {}\",\n connector.connector_name, router_data.request.refund_id\n ))?\n }\n common_enums::ExecutionPath::Direct => {\n Box::pin(execute_refund_execute_via_direct(\n state,\n &connector,\n merchant_context,\n refund,\n router_data,\n ))\n .await?\n }\n common_enums::ExecutionPath::ShadowUnifiedConnectorService => {\n Box::pin(execute_refund_execute_via_direct_with_ucs_shadow(\n state,\n &connector,\n merchant_context,",
|
| 34 |
+
"after": "\n // Check which gateway system to use for refunds\n let (execution_path, updated_state) =\n unified_connector_service::should_call_unified_connector_service(\n state,\n merchant_context,\n &router_data,\n None::<&payments::PaymentData<api::Execute>>, // No payment data for refunds\n payments::CallConnectorAction::Trigger,\n )\n .await?;\n\n router_env::logger::info!(\n refund_id = refund.refund_id,\n execution_path = ?execution_path,\n \"Executing refund via {execution_path:?}\"\n );\n\n // Execute refund based on gateway system decision\n match execution_path {\n common_enums::ExecutionPath::UnifiedConnectorService => {\n unified_connector_service::call_unified_connector_service_for_refund_execute(\n state,\n merchant_context,\n router_data.clone(),\n ExecutionMode::Primary,\n merchant_connector_account,\n )\n .await\n .attach_printable(format!(\n \"UCS refund execution failed for connector: {}, refund_id: {}\",\n connector.connector_name, router_data.request.refund_id\n ))?\n }\n common_enums::ExecutionPath::Direct => {\n Box::pin(execute_refund_execute_via_direct(\n state,\n &connector,\n merchant_context,\n refund,\n router_data,\n ))\n .await?\n }\n common_enums::ExecutionPath::ShadowUnifiedConnectorService => {\n Box::pin(execute_refund_execute_via_direct_with_ucs_shadow(\n &updated_state,\n &connector,\n merchant_context,"
|
| 35 |
+
},
|
| 36 |
+
"commit_sha": "b7bcc6bf9e9eba706f12ecedaf11ec4b9997f2cc"
|
| 37 |
+
}
|
| 38 |
+
]
|
| 39 |
+
}
|
diffs/pr_10100/f5e00a5/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_10119/5767eea/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_10119/e3a6ab8/diff.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "e3a6ab841b3f5efc8183336ca73c62b3263a4de6",
|
| 3 |
+
"pr_number": 10119,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": [
|
| 8 |
+
{
|
| 9 |
+
"id": "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs::SetupIntentRequest::function::try_from",
|
| 10 |
+
"file": "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs",
|
| 11 |
+
"kind": "function_item",
|
| 12 |
+
"status": "modified",
|
| 13 |
+
"code_changed": true,
|
| 14 |
+
"imports_changed": false,
|
| 15 |
+
"before_code": "fn try_from(item: &SetupMandateRouterData) -> Result<Self, Self::Error> {\n //Only cards supported for mandates\n let pm_type = StripePaymentMethodType::Card;\n let payment_data = StripePaymentMethodData::try_from((item, item.auth_type, pm_type))?;\n\n let meta_data = Some(get_transaction_metadata(\n item.request.metadata.clone(),\n item.connector_request_reference_id.clone(),\n ));\n\n let browser_info = item\n .request\n .browser_info\n .clone()\n .map(StripeBrowserInformation::from);\n\n let is_moto = item.request.payment_channel == Some(common_enums::PaymentChannel::MailOrder)\n || item.request.payment_channel == Some(common_enums::PaymentChannel::TelephoneOrder);\n\n let setup_future_usage = match (item.request.setup_future_usage, is_moto) {\n (Some(enums::FutureUsage::OnSession), true) => None,\n _ => item.request.setup_future_usage,\n };\n\n Ok(Self {\n confirm: true,\n payment_data,\n return_url: item.request.router_return_url.clone(),\n off_session: item.request.off_session,\n usage: setup_future_usage,\n payment_method_options: None,\n customer: item.connector_customer.to_owned().map(Secret::new),\n meta_data,\n payment_method_types: Some(pm_type),\n expand: Some(ExpandableObjects::LatestAttempt),\n browser_info,\n moto: Some(is_moto),\n })\n }",
|
| 16 |
+
"after_code": "fn try_from(item: &SetupMandateRouterData) -> Result<Self, Self::Error> {\n //Only cards supported for mandates\n let pm_type = StripePaymentMethodType::Card;\n let payment_data = StripePaymentMethodData::try_from((item, item.auth_type, pm_type))?;\n\n let meta_data = Some(get_transaction_metadata(\n item.request.metadata.clone(),\n item.connector_request_reference_id.clone(),\n ));\n\n let browser_info = item\n .request\n .browser_info\n .clone()\n .map(StripeBrowserInformation::from);\n\n let is_moto = if matches!(\n item.request.payment_method_data,\n PaymentMethodData::Card { .. }\n ) && item.request.payment_channel\n == Some(common_enums::PaymentChannel::MailOrder)\n || item.request.payment_channel == Some(common_enums::PaymentChannel::TelephoneOrder)\n {\n Some(true)\n } else {\n None\n };\n\n let setup_future_usage = match (item.request.setup_future_usage, is_moto) {\n (Some(enums::FutureUsage::OnSession), Some(true)) => None,\n _ => item.request.setup_future_usage,\n };\n\n Ok(Self {\n confirm: true,\n payment_data,\n return_url: item.request.router_return_url.clone(),\n off_session: item.request.off_session,\n usage: setup_future_usage,\n payment_method_options: None,\n customer: item.connector_customer.to_owned().map(Secret::new),\n meta_data,\n payment_method_types: Some(pm_type),\n expand: Some(ExpandableObjects::LatestAttempt),\n browser_info,\n moto: is_moto,\n })\n }",
|
| 17 |
+
"diff_span": {
|
| 18 |
+
"before": " .map(StripeBrowserInformation::from);\n\n let is_moto = item.request.payment_channel == Some(common_enums::PaymentChannel::MailOrder)\n || item.request.payment_channel == Some(common_enums::PaymentChannel::TelephoneOrder);\n\n let setup_future_usage = match (item.request.setup_future_usage, is_moto) {\n (Some(enums::FutureUsage::OnSession), true) => None,\n _ => item.request.setup_future_usage,\n };\n\n Ok(Self {\n confirm: true,\n payment_data,\n return_url: item.request.router_return_url.clone(),\n off_session: item.request.off_session,\n usage: setup_future_usage,\n payment_method_options: None,\n customer: item.connector_customer.to_owned().map(Secret::new),\n meta_data,\n payment_method_types: Some(pm_type),\n expand: Some(ExpandableObjects::LatestAttempt),\n browser_info,\n moto: Some(is_moto),\n })\n }",
|
| 19 |
+
"after": " .map(StripeBrowserInformation::from);\n\n let is_moto = if matches!(\n item.request.payment_method_data,\n PaymentMethodData::Card { .. }\n ) && item.request.payment_channel\n == Some(common_enums::PaymentChannel::MailOrder)\n || item.request.payment_channel == Some(common_enums::PaymentChannel::TelephoneOrder)\n {\n Some(true)\n } else {\n None\n };\n\n let setup_future_usage = match (item.request.setup_future_usage, is_moto) {\n (Some(enums::FutureUsage::OnSession), Some(true)) => None,\n _ => item.request.setup_future_usage,\n };\n\n Ok(Self {\n confirm: true,\n payment_data,\n return_url: item.request.router_return_url.clone(),\n off_session: item.request.off_session,\n usage: setup_future_usage,\n payment_method_options: None,\n customer: item.connector_customer.to_owned().map(Secret::new),\n meta_data,\n payment_method_types: Some(pm_type),\n expand: Some(ExpandableObjects::LatestAttempt),\n browser_info,\n moto: is_moto,\n })\n }"
|
| 20 |
+
},
|
| 21 |
+
"commit_sha": "e3a6ab841b3f5efc8183336ca73c62b3263a4de6"
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"id": "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs::impl::SetupIntentRequest",
|
| 25 |
+
"file": "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs",
|
| 26 |
+
"kind": "impl_item",
|
| 27 |
+
"status": "modified",
|
| 28 |
+
"code_changed": true,
|
| 29 |
+
"imports_changed": false,
|
| 30 |
+
"before_code": "impl TryFrom<&SetupMandateRouterData> for SetupIntentRequest {\n type Error = error_stack::Report<ConnectorError>;\n fn try_from(item: &SetupMandateRouterData) -> Result<Self, Self::Error> {\n //Only cards supported for mandates\n let pm_type = StripePaymentMethodType::Card;\n let payment_data = StripePaymentMethodData::try_from((item, item.auth_type, pm_type))?;\n\n let meta_data = Some(get_transaction_metadata(\n item.request.metadata.clone(),\n item.connector_request_reference_id.clone(),\n ));\n\n let browser_info = item\n .request\n .browser_info\n .clone()\n .map(StripeBrowserInformation::from);\n\n let is_moto = item.request.payment_channel == Some(common_enums::PaymentChannel::MailOrder)\n || item.request.payment_channel == Some(common_enums::PaymentChannel::TelephoneOrder);\n\n let setup_future_usage = match (item.request.setup_future_usage, is_moto) {\n (Some(enums::FutureUsage::OnSession), true) => None,\n _ => item.request.setup_future_usage,\n };\n\n Ok(Self {\n confirm: true,\n payment_data,\n return_url: item.request.router_return_url.clone(),\n off_session: item.request.off_session,\n usage: setup_future_usage,\n payment_method_options: None,\n customer: item.connector_customer.to_owned().map(Secret::new),\n meta_data,\n payment_method_types: Some(pm_type),\n expand: Some(ExpandableObjects::LatestAttempt),\n browser_info,\n moto: Some(is_moto),\n })\n }\n}",
|
| 31 |
+
"after_code": "impl TryFrom<&SetupMandateRouterData> for SetupIntentRequest {\n type Error = error_stack::Report<ConnectorError>;\n fn try_from(item: &SetupMandateRouterData) -> Result<Self, Self::Error> {\n //Only cards supported for mandates\n let pm_type = StripePaymentMethodType::Card;\n let payment_data = StripePaymentMethodData::try_from((item, item.auth_type, pm_type))?;\n\n let meta_data = Some(get_transaction_metadata(\n item.request.metadata.clone(),\n item.connector_request_reference_id.clone(),\n ));\n\n let browser_info = item\n .request\n .browser_info\n .clone()\n .map(StripeBrowserInformation::from);\n\n let is_moto = if matches!(\n item.request.payment_method_data,\n PaymentMethodData::Card { .. }\n ) && item.request.payment_channel\n == Some(common_enums::PaymentChannel::MailOrder)\n || item.request.payment_channel == Some(common_enums::PaymentChannel::TelephoneOrder)\n {\n Some(true)\n } else {\n None\n };\n\n let setup_future_usage = match (item.request.setup_future_usage, is_moto) {\n (Some(enums::FutureUsage::OnSession), Some(true)) => None,\n _ => item.request.setup_future_usage,\n };\n\n Ok(Self {\n confirm: true,\n payment_data,\n return_url: item.request.router_return_url.clone(),\n off_session: item.request.off_session,\n usage: setup_future_usage,\n payment_method_options: None,\n customer: item.connector_customer.to_owned().map(Secret::new),\n meta_data,\n payment_method_types: Some(pm_type),\n expand: Some(ExpandableObjects::LatestAttempt),\n browser_info,\n moto: is_moto,\n })\n }\n}",
|
| 32 |
+
"diff_span": {
|
| 33 |
+
"before": " .map(StripeBrowserInformation::from);\n\n let is_moto = item.request.payment_channel == Some(common_enums::PaymentChannel::MailOrder)\n || item.request.payment_channel == Some(common_enums::PaymentChannel::TelephoneOrder);\n\n let setup_future_usage = match (item.request.setup_future_usage, is_moto) {\n (Some(enums::FutureUsage::OnSession), true) => None,\n _ => item.request.setup_future_usage,\n };\n\n Ok(Self {\n confirm: true,\n payment_data,\n return_url: item.request.router_return_url.clone(),\n off_session: item.request.off_session,\n usage: setup_future_usage,\n payment_method_options: None,\n customer: item.connector_customer.to_owned().map(Secret::new),\n meta_data,\n payment_method_types: Some(pm_type),\n expand: Some(ExpandableObjects::LatestAttempt),\n browser_info,\n moto: Some(is_moto),\n })\n }",
|
| 34 |
+
"after": " .map(StripeBrowserInformation::from);\n\n let is_moto = if matches!(\n item.request.payment_method_data,\n PaymentMethodData::Card { .. }\n ) && item.request.payment_channel\n == Some(common_enums::PaymentChannel::MailOrder)\n || item.request.payment_channel == Some(common_enums::PaymentChannel::TelephoneOrder)\n {\n Some(true)\n } else {\n None\n };\n\n let setup_future_usage = match (item.request.setup_future_usage, is_moto) {\n (Some(enums::FutureUsage::OnSession), Some(true)) => None,\n _ => item.request.setup_future_usage,\n };\n\n Ok(Self {\n confirm: true,\n payment_data,\n return_url: item.request.router_return_url.clone(),\n off_session: item.request.off_session,\n usage: setup_future_usage,\n payment_method_options: None,\n customer: item.connector_customer.to_owned().map(Secret::new),\n meta_data,\n payment_method_types: Some(pm_type),\n expand: Some(ExpandableObjects::LatestAttempt),\n browser_info,\n moto: is_moto,\n })\n }"
|
| 35 |
+
},
|
| 36 |
+
"commit_sha": "e3a6ab841b3f5efc8183336ca73c62b3263a4de6"
|
| 37 |
+
}
|
| 38 |
+
]
|
| 39 |
+
}
|
diffs/pr_10124/1e962ad/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "1e962adb2884fca759f4bab0ece664900a0986b1",
|
| 3 |
+
"pr_number": 10124,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_10124/5a1e03b/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "5a1e03b1035e48294619d08e91280a29746ff157",
|
| 3 |
+
"pr_number": 10124,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_10124/bdb3478/diff.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "bdb3478d4f44034e7184356fe927f8ed509377fd",
|
| 3 |
+
"pr_number": 10124,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": []
|
| 8 |
+
}
|
diffs/pr_10124/c46e3a7/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "c46e3a73bbe19ed2e012fcbe105f9ae49c935dc9",
|
| 3 |
+
"pr_number": 10124,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_10254/c2b8610/diff.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "c2b86103b9a8fa3dd24d8f81abd491d83ec6cde0",
|
| 3 |
+
"pr_number": 10254,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/router/src/core/payments.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": [
|
| 8 |
+
{
|
| 9 |
+
"id": "crates/router/src/core/payments.rs::function::complete_preprocessing_steps_if_required",
|
| 10 |
+
"file": "crates/router/src/core/payments.rs",
|
| 11 |
+
"kind": "function_item",
|
| 12 |
+
"status": "modified",
|
| 13 |
+
"code_changed": true,
|
| 14 |
+
"imports_changed": false,
|
| 15 |
+
"before_code": "async fn complete_preprocessing_steps_if_required<F, Req, Q, D>(\n state: &SessionState,\n connector: &api::ConnectorData,\n payment_data: &D,\n mut router_data: RouterData<F, Req, router_types::PaymentsResponseData>,\n operation: &BoxedOperation<'_, F, Q, D>,\n should_continue_payment: bool,\n) -> RouterResult<(RouterData<F, Req, router_types::PaymentsResponseData>, bool)>\nwhere\n F: Send + Clone + Sync,\n D: OperationSessionGetters<F> + Send + Sync + Clone,\n Req: Send + Sync,\n RouterData<F, Req, router_types::PaymentsResponseData>: Feature<F, Req> + Send,\n dyn api::Connector:\n services::api::ConnectorIntegration<F, Req, router_types::PaymentsResponseData>,\n{\n //TODO: For ACH transfers, if preprocessing_step is not required for connectors encountered in future, add the check\n let router_data_and_should_continue_payment = match payment_data.get_payment_method_data() {\n Some(domain::PaymentMethodData::BankTransfer(_)) => (router_data, should_continue_payment),\n Some(domain::PaymentMethodData::Wallet(_)) => {\n if is_preprocessing_required_for_wallets(connector.connector_name.to_string()) {\n (\n router_data.preprocessing_steps(state, connector).await?,\n false,\n )\n } else if connector.connector_name == router_types::Connector::Paysafe {\n match payment_data.get_payment_method_data() {\n Some(domain::PaymentMethodData::Wallet(domain::WalletData::ApplePay(_))) => {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n (router_data, !is_error_in_response)\n }\n _ => (router_data, should_continue_payment),\n }\n } else {\n (router_data, should_continue_payment)\n }\n }\n Some(domain::PaymentMethodData::Card(_)) => {\n if connector.connector_name == router_types::Connector::Payme\n && !matches!(format!(\"{operation:?}\").as_str(), \"CompleteAuthorize\")\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else if connector.connector_name == router_types::Connector::Nmi\n && !matches!(format!(\"{operation:?}\").as_str(), \"CompleteAuthorize\")\n && router_data.auth_type == storage_enums::AuthenticationType::ThreeDs\n && !matches!(\n payment_data\n .get_payment_attempt()\n .external_three_ds_authentication_attempted,\n Some(true)\n )\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n (router_data, false)\n } else if connector.connector_name == router_types::Connector::Paysafe\n && router_data.auth_type == storage_enums::AuthenticationType::NoThreeDs\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else if (connector.connector_name == router_types::Connector::Cybersource\n || connector.connector_name == router_types::Connector::Barclaycard)\n && is_operation_complete_authorize(&operation)\n && router_data.auth_type == storage_enums::AuthenticationType::ThreeDs\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n // Should continue the flow only if no redirection_data is returned else a response with redirection form shall be returned\n let should_continue = matches!(\n router_data.response,\n Ok(router_types::PaymentsResponseData::TransactionResponse {\n ref redirection_data,\n ..\n }) if redirection_data.is_none()\n ) && router_data.status\n != common_enums::AttemptStatus::AuthenticationFailed;\n (router_data, should_continue)\n } else if router_data.auth_type == common_enums::AuthenticationType::ThreeDs\n && ((connector.connector_name == router_types::Connector::Nexixpay\n && is_operation_complete_authorize(&operation))\n || (((connector.connector_name == router_types::Connector::Nuvei && {\n #[cfg(feature = \"v1\")]\n {\n payment_data\n .get_payment_intent()\n .request_external_three_ds_authentication\n != Some(true)\n }\n #[cfg(feature = \"v2\")]\n {\n payment_data\n .get_payment_intent()\n .request_external_three_ds_authentication\n != Some(true).into()\n }\n }) || connector.connector_name == router_types::Connector::Shift4)\n && !is_operation_complete_authorize(&operation)))\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n (router_data, should_continue_payment)\n } else if connector.connector_name == router_types::Connector::Xendit\n && is_operation_confirm(&operation)\n {\n match payment_data.get_payment_intent().split_payments {\n Some(common_types::payments::SplitPaymentsRequest::XenditSplitPayment(\n common_types::payments::XenditSplitRequest::MultipleSplits(_),\n )) => {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n (router_data, !is_error_in_response)\n }\n _ => (router_data, should_continue_payment),\n }\n } else if connector.connector_name == router_types::Connector::Redsys\n && router_data.auth_type == common_enums::AuthenticationType::ThreeDs\n && is_operation_confirm(&operation)\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let should_continue = match router_data.response {\n Ok(router_types::PaymentsResponseData::TransactionResponse {\n ref connector_metadata,\n ..\n }) => {\n let three_ds_invoke_data: Option<\n api_models::payments::PaymentsConnectorThreeDsInvokeData,\n > = connector_metadata.clone().and_then(|metadata| {\n metadata\n .parse_value(\"PaymentsConnectorThreeDsInvokeData\")\n .ok() // \"ThreeDsInvokeData was not found; proceeding with the payment flow without triggering the ThreeDS invoke action\"\n });\n three_ds_invoke_data.is_none()\n }\n _ => false,\n };\n (router_data, should_continue)\n } else {\n (router_data, should_continue_payment)\n }\n }\n Some(domain::PaymentMethodData::GiftCard(gift_card_data)) => {\n if connector.connector_name == router_types::Connector::Adyen\n && matches!(gift_card_data.deref(), domain::GiftCardData::Givex(..))\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else {\n (router_data, should_continue_payment)\n }\n }\n Some(domain::PaymentMethodData::BankDebit(_)) => {\n if connector.connector_name == router_types::Connector::Gocardless\n || connector.connector_name == router_types::Connector::Nordea\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else {\n (router_data, should_continue_payment)\n }\n }\n _ => {\n // 3DS validation for paypal cards after verification (authorize call)\n if connector.connector_name == router_types::Connector::Paypal\n && payment_data.get_payment_attempt().get_payment_method()\n == Some(storage_enums::PaymentMethod::Card)\n && matches!(format!(\"{operation:?}\").as_str(), \"CompleteAuthorize\")\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else {\n (router_data, should_continue_payment)\n }\n }\n };\n\n Ok(router_data_and_should_continue_payment)\n}",
|
| 16 |
+
"after_code": "async fn complete_preprocessing_steps_if_required<F, Req, Q, D>(\n state: &SessionState,\n connector: &api::ConnectorData,\n payment_data: &D,\n mut router_data: RouterData<F, Req, router_types::PaymentsResponseData>,\n operation: &BoxedOperation<'_, F, Q, D>,\n should_continue_payment: bool,\n) -> RouterResult<(RouterData<F, Req, router_types::PaymentsResponseData>, bool)>\nwhere\n F: Send + Clone + Sync,\n D: OperationSessionGetters<F> + Send + Sync + Clone,\n Req: Send + Sync,\n RouterData<F, Req, router_types::PaymentsResponseData>: Feature<F, Req> + Send,\n dyn api::Connector:\n services::api::ConnectorIntegration<F, Req, router_types::PaymentsResponseData>,\n{\n //TODO: For ACH transfers, if preprocessing_step is not required for connectors encountered in future, add the check\n let router_data_and_should_continue_payment = match payment_data.get_payment_method_data() {\n Some(domain::PaymentMethodData::BankTransfer(_)) => (router_data, should_continue_payment),\n Some(domain::PaymentMethodData::Wallet(_)) => {\n if is_preprocessing_required_for_wallets(connector.connector_name.to_string()) {\n (\n router_data.preprocessing_steps(state, connector).await?,\n false,\n )\n } else if connector.connector_name == router_types::Connector::Paysafe {\n match payment_data.get_payment_method_data() {\n Some(domain::PaymentMethodData::Wallet(domain::WalletData::ApplePay(_))) => {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n (router_data, !is_error_in_response)\n }\n _ => (router_data, should_continue_payment),\n }\n } else {\n (router_data, should_continue_payment)\n }\n }\n Some(domain::PaymentMethodData::Card(_)) => {\n if connector.connector_name == router_types::Connector::Payme\n && !matches!(format!(\"{operation:?}\").as_str(), \"CompleteAuthorize\")\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else if connector.connector_name == router_types::Connector::Nmi\n && !matches!(format!(\"{operation:?}\").as_str(), \"CompleteAuthorize\")\n && router_data.auth_type == storage_enums::AuthenticationType::ThreeDs\n && !matches!(\n payment_data\n .get_payment_attempt()\n .external_three_ds_authentication_attempted,\n Some(true)\n )\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n (router_data, false)\n } else if connector.connector_name == router_types::Connector::Paysafe\n && router_data.auth_type == storage_enums::AuthenticationType::NoThreeDs\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else if (connector.connector_name == router_types::Connector::Cybersource\n || connector.connector_name == router_types::Connector::Barclaycard)\n && is_operation_complete_authorize(&operation)\n && router_data.auth_type == storage_enums::AuthenticationType::ThreeDs\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n // Should continue the flow only if no redirection_data is returned else a response with redirection form shall be returned\n let should_continue = matches!(\n router_data.response,\n Ok(router_types::PaymentsResponseData::TransactionResponse {\n ref redirection_data,\n ..\n }) if redirection_data.is_none()\n ) && router_data.status\n != common_enums::AttemptStatus::AuthenticationFailed;\n (router_data, should_continue)\n } else if router_data.auth_type == common_enums::AuthenticationType::ThreeDs\n && (((connector.connector_name == router_types::Connector::Nuvei && {\n #[cfg(feature = \"v1\")]\n {\n payment_data\n .get_payment_intent()\n .request_external_three_ds_authentication\n != Some(true)\n }\n #[cfg(feature = \"v2\")]\n {\n payment_data\n .get_payment_intent()\n .request_external_three_ds_authentication\n != Some(true).into()\n }\n }) || connector.connector_name == router_types::Connector::Shift4)\n && !is_operation_complete_authorize(&operation))\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n (router_data, should_continue_payment)\n } else if connector.connector_name == router_types::Connector::Xendit\n && is_operation_confirm(&operation)\n {\n match payment_data.get_payment_intent().split_payments {\n Some(common_types::payments::SplitPaymentsRequest::XenditSplitPayment(\n common_types::payments::XenditSplitRequest::MultipleSplits(_),\n )) => {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n (router_data, !is_error_in_response)\n }\n _ => (router_data, should_continue_payment),\n }\n } else if connector.connector_name == router_types::Connector::Redsys\n && router_data.auth_type == common_enums::AuthenticationType::ThreeDs\n && is_operation_confirm(&operation)\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let should_continue = match router_data.response {\n Ok(router_types::PaymentsResponseData::TransactionResponse {\n ref connector_metadata,\n ..\n }) => {\n let three_ds_invoke_data: Option<\n api_models::payments::PaymentsConnectorThreeDsInvokeData,\n > = connector_metadata.clone().and_then(|metadata| {\n metadata\n .parse_value(\"PaymentsConnectorThreeDsInvokeData\")\n .ok() // \"ThreeDsInvokeData was not found; proceeding with the payment flow without triggering the ThreeDS invoke action\"\n });\n three_ds_invoke_data.is_none()\n }\n _ => false,\n };\n (router_data, should_continue)\n } else if router_data.auth_type == common_enums::AuthenticationType::ThreeDs\n && connector.connector_name == router_types::Connector::Nexixpay\n && is_operation_complete_authorize(&operation)\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n (router_data, !is_error_in_response)\n } else {\n (router_data, should_continue_payment)\n }\n }\n Some(domain::PaymentMethodData::GiftCard(gift_card_data)) => {\n if connector.connector_name == router_types::Connector::Adyen\n && matches!(gift_card_data.deref(), domain::GiftCardData::Givex(..))\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else {\n (router_data, should_continue_payment)\n }\n }\n Some(domain::PaymentMethodData::BankDebit(_)) => {\n if connector.connector_name == router_types::Connector::Gocardless\n || connector.connector_name == router_types::Connector::Nordea\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else {\n (router_data, should_continue_payment)\n }\n }\n _ => {\n // 3DS validation for paypal cards after verification (authorize call)\n if connector.connector_name == router_types::Connector::Paypal\n && payment_data.get_payment_attempt().get_payment_method()\n == Some(storage_enums::PaymentMethod::Card)\n && matches!(format!(\"{operation:?}\").as_str(), \"CompleteAuthorize\")\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n // If is_error_in_response is true, should_continue_payment should be false, we should throw the error\n (router_data, !is_error_in_response)\n } else {\n (router_data, should_continue_payment)\n }\n }\n };\n\n Ok(router_data_and_should_continue_payment)\n}",
|
| 17 |
+
"diff_span": {
|
| 18 |
+
"before": " (router_data, should_continue)\n } else if router_data.auth_type == common_enums::AuthenticationType::ThreeDs\n && ((connector.connector_name == router_types::Connector::Nexixpay\n && is_operation_complete_authorize(&operation))\n || (((connector.connector_name == router_types::Connector::Nuvei && {\n #[cfg(feature = \"v1\")]\n {\n payment_data\n .get_payment_intent()\n .request_external_three_ds_authentication\n != Some(true)\n }\n #[cfg(feature = \"v2\")]\n {\n payment_data\n .get_payment_intent()\n .request_external_three_ds_authentication\n != Some(true).into()\n }\n }) || connector.connector_name == router_types::Connector::Shift4)\n && !is_operation_complete_authorize(&operation)))\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;",
|
| 19 |
+
"after": " (router_data, should_continue)\n } else if router_data.auth_type == common_enums::AuthenticationType::ThreeDs\n && (((connector.connector_name == router_types::Connector::Nuvei && {\n #[cfg(feature = \"v1\")]\n {\n payment_data\n .get_payment_intent()\n .request_external_three_ds_authentication\n != Some(true)\n }\n #[cfg(feature = \"v2\")]\n {\n payment_data\n .get_payment_intent()\n .request_external_three_ds_authentication\n != Some(true).into()\n }\n }) || connector.connector_name == router_types::Connector::Shift4)\n && !is_operation_complete_authorize(&operation))\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n (router_data, should_continue_payment)\n } else if connector.connector_name == router_types::Connector::Xendit\n && is_operation_confirm(&operation)\n {\n match payment_data.get_payment_intent().split_payments {\n Some(common_types::payments::SplitPaymentsRequest::XenditSplitPayment(\n common_types::payments::XenditSplitRequest::MultipleSplits(_),\n )) => {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n (router_data, !is_error_in_response)\n }\n _ => (router_data, should_continue_payment),\n }\n } else if connector.connector_name == router_types::Connector::Redsys\n && router_data.auth_type == common_enums::AuthenticationType::ThreeDs\n && is_operation_confirm(&operation)\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let should_continue = match router_data.response {\n Ok(router_types::PaymentsResponseData::TransactionResponse {\n ref connector_metadata,\n ..\n }) => {\n let three_ds_invoke_data: Option<\n api_models::payments::PaymentsConnectorThreeDsInvokeData,\n > = connector_metadata.clone().and_then(|metadata| {\n metadata\n .parse_value(\"PaymentsConnectorThreeDsInvokeData\")\n .ok() // \"ThreeDsInvokeData was not found; proceeding with the payment flow without triggering the ThreeDS invoke action\"\n });\n three_ds_invoke_data.is_none()\n }\n _ => false,\n };\n (router_data, should_continue)\n } else if router_data.auth_type == common_enums::AuthenticationType::ThreeDs\n && connector.connector_name == router_types::Connector::Nexixpay\n && is_operation_complete_authorize(&operation)\n {\n router_data = router_data.preprocessing_steps(state, connector).await?;\n let is_error_in_response = router_data.response.is_err();\n (router_data, !is_error_in_response)\n } else {\n (router_data, should_continue_payment)"
|
| 20 |
+
},
|
| 21 |
+
"commit_sha": "c2b86103b9a8fa3dd24d8f81abd491d83ec6cde0"
|
| 22 |
+
}
|
| 23 |
+
]
|
| 24 |
+
}
|
diffs/pr_10278/ccafbf6/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6743/28c22aa/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6743/34a5f6e/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6743/3d8fee7/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6799/e84bbac/diff.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "e84bbac225a92c5503492ecc28cc78572efcbd7c",
|
| 3 |
+
"pr_number": 6799,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/masking/src/cassandra.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": [
|
| 8 |
+
{
|
| 9 |
+
"id": "crates/masking/src/cassandra.rs::StrongSecret<T>::function::serialize",
|
| 10 |
+
"file": "crates/masking/src/cassandra.rs",
|
| 11 |
+
"kind": "function_item",
|
| 12 |
+
"status": "modified",
|
| 13 |
+
"code_changed": true,
|
| 14 |
+
"imports_changed": true,
|
| 15 |
+
"before_code": "fn serialize<'b>(\n &self,\n typ: &ColumnType,\n writer: CellWriter<'b>,\n ) -> Result<WrittenCellProof<'b>, SerializationError> {\n self.peek().serialize(typ, writer)\n }",
|
| 16 |
+
"after_code": "fn serialize<'b>(\n &self,\n typ: &ColumnType<'_>,\n writer: CellWriter<'b>,\n ) -> Result<WrittenCellProof<'b>, SerializationError> {\n self.peek().serialize(typ, writer)\n }",
|
| 17 |
+
"diff_span": {
|
| 18 |
+
"before": "fn serialize<'b>(\n &self,\n typ: &ColumnType,\n writer: CellWriter<'b>,\n ) -> Result<WrittenCellProof<'b>, SerializationError> {",
|
| 19 |
+
"after": "fn serialize<'b>(\n &self,\n typ: &ColumnType<'_>,\n writer: CellWriter<'b>,\n ) -> Result<WrittenCellProof<'b>, SerializationError> {"
|
| 20 |
+
},
|
| 21 |
+
"commit_sha": "e84bbac225a92c5503492ecc28cc78572efcbd7c",
|
| 22 |
+
"before_imports": [
|
| 23 |
+
"use scylla::{\n cql_to_rust::FromCqlVal,\n deserialize::DeserializeValue,\n frame::response::result::{ColumnType, CqlValue},\n serialize::{\n value::SerializeValue,\n writers::{CellWriter, WrittenCellProof},\n SerializationError,\n },\n};"
|
| 24 |
+
],
|
| 25 |
+
"after_imports": [
|
| 26 |
+
"use scylla::{\n deserialize::DeserializeValue,\n frame::response::result::ColumnType,\n serialize::{\n value::SerializeValue,\n writers::{CellWriter, WrittenCellProof},\n SerializationError,\n },\n};"
|
| 27 |
+
]
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
"id": "crates/masking/src/cassandra.rs::StrongSecret<T>::function::type_check",
|
| 31 |
+
"file": "crates/masking/src/cassandra.rs",
|
| 32 |
+
"kind": "function_item",
|
| 33 |
+
"status": "modified",
|
| 34 |
+
"code_changed": true,
|
| 35 |
+
"imports_changed": true,
|
| 36 |
+
"before_code": "fn type_check(typ: &ColumnType) -> Result<(), scylla::deserialize::TypeCheckError> {\n T::type_check(typ)\n }",
|
| 37 |
+
"after_code": "fn type_check(typ: &ColumnType<'_>) -> Result<(), scylla::deserialize::TypeCheckError> {\n T::type_check(typ)\n }",
|
| 38 |
+
"diff_span": {
|
| 39 |
+
"before": "fn type_check(typ: &ColumnType) -> Result<(), scylla::deserialize::TypeCheckError> {\n T::type_check(typ)\n }",
|
| 40 |
+
"after": "fn type_check(typ: &ColumnType<'_>) -> Result<(), scylla::deserialize::TypeCheckError> {\n T::type_check(typ)\n }"
|
| 41 |
+
},
|
| 42 |
+
"commit_sha": "e84bbac225a92c5503492ecc28cc78572efcbd7c",
|
| 43 |
+
"before_imports": [
|
| 44 |
+
"use scylla::{\n cql_to_rust::FromCqlVal,\n deserialize::DeserializeValue,\n frame::response::result::{ColumnType, CqlValue},\n serialize::{\n value::SerializeValue,\n writers::{CellWriter, WrittenCellProof},\n SerializationError,\n },\n};"
|
| 45 |
+
],
|
| 46 |
+
"after_imports": [
|
| 47 |
+
"use scylla::{\n deserialize::DeserializeValue,\n frame::response::result::ColumnType,\n serialize::{\n value::SerializeValue,\n writers::{CellWriter, WrittenCellProof},\n SerializationError,\n },\n};"
|
| 48 |
+
]
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"id": "crates/masking/src/cassandra.rs::StrongSecret<T>::function::deserialize",
|
| 52 |
+
"file": "crates/masking/src/cassandra.rs",
|
| 53 |
+
"kind": "function_item",
|
| 54 |
+
"status": "modified",
|
| 55 |
+
"code_changed": true,
|
| 56 |
+
"imports_changed": true,
|
| 57 |
+
"before_code": "fn deserialize(\n typ: &'frame ColumnType,\n v: Option<scylla::deserialize::FrameSlice<'frame>>,\n ) -> Result<Self, scylla::deserialize::DeserializationError> {\n Ok(Self::new(T::deserialize(typ, v)?))\n }",
|
| 58 |
+
"after_code": "fn deserialize(\n typ: &'metadata ColumnType<'metadata>,\n v: Option<scylla::deserialize::FrameSlice<'frame>>,\n ) -> Result<Self, scylla::deserialize::DeserializationError> {\n Ok(Self::new(T::deserialize(typ, v)?))\n }",
|
| 59 |
+
"diff_span": {
|
| 60 |
+
"before": "fn deserialize(\n typ: &'frame ColumnType,\n v: Option<scylla::deserialize::FrameSlice<'frame>>,\n ) -> Result<Self, scylla::deserialize::DeserializationError> {",
|
| 61 |
+
"after": "fn deserialize(\n typ: &'metadata ColumnType<'metadata>,\n v: Option<scylla::deserialize::FrameSlice<'frame>>,\n ) -> Result<Self, scylla::deserialize::DeserializationError> {"
|
| 62 |
+
},
|
| 63 |
+
"commit_sha": "e84bbac225a92c5503492ecc28cc78572efcbd7c",
|
| 64 |
+
"before_imports": [
|
| 65 |
+
"use scylla::{\n cql_to_rust::FromCqlVal,\n deserialize::DeserializeValue,\n frame::response::result::{ColumnType, CqlValue},\n serialize::{\n value::SerializeValue,\n writers::{CellWriter, WrittenCellProof},\n SerializationError,\n },\n};"
|
| 66 |
+
],
|
| 67 |
+
"after_imports": [
|
| 68 |
+
"use scylla::{\n deserialize::DeserializeValue,\n frame::response::result::ColumnType,\n serialize::{\n value::SerializeValue,\n writers::{CellWriter, WrittenCellProof},\n SerializationError,\n },\n};"
|
| 69 |
+
]
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"id": "crates/masking/src/cassandra.rs::impl::StrongSecret<T>",
|
| 73 |
+
"file": "crates/masking/src/cassandra.rs",
|
| 74 |
+
"kind": "impl_item",
|
| 75 |
+
"status": "modified",
|
| 76 |
+
"code_changed": true,
|
| 77 |
+
"imports_changed": true,
|
| 78 |
+
"before_code": "impl<T> FromCqlVal<CqlValue> for StrongSecret<T>\nwhere\n T: FromCqlVal<CqlValue> + zeroize::Zeroize + Clone,\n{\n fn from_cql(cql_val: CqlValue) -> Result<Self, scylla::cql_to_rust::FromCqlValError> {\n Ok(Self::new(T::from_cql(cql_val)?))\n }\n}",
|
| 79 |
+
"after_code": "impl<'frame, 'metadata, T> DeserializeValue<'frame, 'metadata> for StrongSecret<T>\nwhere\n T: DeserializeValue<'frame, 'metadata> + zeroize::Zeroize + Clone,\n{\n fn type_check(typ: &ColumnType<'_>) -> Result<(), scylla::deserialize::TypeCheckError> {\n T::type_check(typ)\n }\n\n fn deserialize(\n typ: &'metadata ColumnType<'metadata>,\n v: Option<scylla::deserialize::FrameSlice<'frame>>,\n ) -> Result<Self, scylla::deserialize::DeserializationError> {\n Ok(Self::new(T::deserialize(typ, v)?))\n }\n}",
|
| 80 |
+
"diff_span": {
|
| 81 |
+
"before": "impl<T> FromCqlVal<CqlValue> for StrongSecret<T>\nwhere\n T: FromCqlVal<CqlValue> + zeroize::Zeroize + Clone,\n{\n fn from_cql(cql_val: CqlValue) -> Result<Self, scylla::cql_to_rust::FromCqlValError> {\n Ok(Self::new(T::from_cql(cql_val)?))\n }\n}",
|
| 82 |
+
"after": "impl<'frame, 'metadata, T> DeserializeValue<'frame, 'metadata> for StrongSecret<T>\nwhere\n T: DeserializeValue<'frame, 'metadata> + zeroize::Zeroize + Clone,\n{\n fn type_check(typ: &ColumnType<'_>) -> Result<(), scylla::deserialize::TypeCheckError> {\n T::type_check(typ)\n }\n\n fn deserialize(\n typ: &'metadata ColumnType<'metadata>,\n v: Option<scylla::deserialize::FrameSlice<'frame>>,\n ) -> Result<Self, scylla::deserialize::DeserializationError> {\n Ok(Self::new(T::deserialize(typ, v)?))\n }\n}"
|
| 83 |
+
},
|
| 84 |
+
"commit_sha": "e84bbac225a92c5503492ecc28cc78572efcbd7c",
|
| 85 |
+
"before_imports": [
|
| 86 |
+
"use scylla::{\n cql_to_rust::FromCqlVal,\n deserialize::DeserializeValue,\n frame::response::result::{ColumnType, CqlValue},\n serialize::{\n value::SerializeValue,\n writers::{CellWriter, WrittenCellProof},\n SerializationError,\n },\n};"
|
| 87 |
+
],
|
| 88 |
+
"after_imports": [
|
| 89 |
+
"use scylla::{\n deserialize::DeserializeValue,\n frame::response::result::ColumnType,\n serialize::{\n value::SerializeValue,\n writers::{CellWriter, WrittenCellProof},\n SerializationError,\n },\n};"
|
| 90 |
+
]
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"id": "crates/masking/src/cassandra.rs::StrongSecret<T>::function::from_cql",
|
| 94 |
+
"file": "crates/masking/src/cassandra.rs",
|
| 95 |
+
"kind": "function_item",
|
| 96 |
+
"status": "removed",
|
| 97 |
+
"before_code": "fn from_cql(cql_val: CqlValue) -> Result<Self, scylla::cql_to_rust::FromCqlValError> {\n Ok(Self::new(T::from_cql(cql_val)?))\n }",
|
| 98 |
+
"after_code": null,
|
| 99 |
+
"diff_span": null,
|
| 100 |
+
"commit_sha": "e84bbac225a92c5503492ecc28cc78572efcbd7c"
|
| 101 |
+
}
|
| 102 |
+
]
|
| 103 |
+
}
|
diffs/pr_6836/1cef108/diff.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "1cef108959b5436f53e67fd8c80c914485292276",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/common_utils/src/id_type.rs",
|
| 6 |
+
"crates/common_utils/src/id_type/global_id.rs",
|
| 7 |
+
"crates/common_utils/src/id_type/global_id/customer.rs",
|
| 8 |
+
"crates/common_utils/src/id_type/global_id/payment.rs"
|
| 9 |
+
],
|
| 10 |
+
"diffs": [
|
| 11 |
+
{
|
| 12 |
+
"id": "crates/common_utils/src/id_type/global_id.rs::mod::payment_methods",
|
| 13 |
+
"file": "crates/common_utils/src/id_type/global_id.rs",
|
| 14 |
+
"kind": "mod_item",
|
| 15 |
+
"status": "modified",
|
| 16 |
+
"code_changed": true,
|
| 17 |
+
"imports_changed": false,
|
| 18 |
+
"before_code": "pub mod payment_methods;",
|
| 19 |
+
"after_code": "pub(super) mod payment_methods;",
|
| 20 |
+
"diff_span": {
|
| 21 |
+
"before": "pub mod payment_methods;",
|
| 22 |
+
"after": "pub(super) mod payment_methods;"
|
| 23 |
+
},
|
| 24 |
+
"commit_sha": "1cef108959b5436f53e67fd8c80c914485292276"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"id": "crates/common_utils/src/id_type/global_id.rs::mod::payment",
|
| 28 |
+
"file": "crates/common_utils/src/id_type/global_id.rs",
|
| 29 |
+
"kind": "mod_item",
|
| 30 |
+
"status": "modified",
|
| 31 |
+
"code_changed": true,
|
| 32 |
+
"imports_changed": false,
|
| 33 |
+
"before_code": "pub mod payment;",
|
| 34 |
+
"after_code": "pub(super) mod payment;",
|
| 35 |
+
"diff_span": {
|
| 36 |
+
"before": "pub mod payment;",
|
| 37 |
+
"after": "pub(super) mod payment;"
|
| 38 |
+
},
|
| 39 |
+
"commit_sha": "1cef108959b5436f53e67fd8c80c914485292276"
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"id": "crates/common_utils/src/id_type/global_id.rs::mod::refunds",
|
| 43 |
+
"file": "crates/common_utils/src/id_type/global_id.rs",
|
| 44 |
+
"kind": "mod_item",
|
| 45 |
+
"status": "modified",
|
| 46 |
+
"code_changed": true,
|
| 47 |
+
"imports_changed": false,
|
| 48 |
+
"before_code": "pub mod refunds;",
|
| 49 |
+
"after_code": "pub(super) mod refunds;",
|
| 50 |
+
"diff_span": {
|
| 51 |
+
"before": "pub mod refunds;",
|
| 52 |
+
"after": "pub(super) mod refunds;"
|
| 53 |
+
},
|
| 54 |
+
"commit_sha": "1cef108959b5436f53e67fd8c80c914485292276"
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"id": "crates/common_utils/src/id_type/global_id.rs::mod::customer",
|
| 58 |
+
"file": "crates/common_utils/src/id_type/global_id.rs",
|
| 59 |
+
"kind": "mod_item",
|
| 60 |
+
"status": "added",
|
| 61 |
+
"before_code": null,
|
| 62 |
+
"after_code": "pub(super) mod customer;",
|
| 63 |
+
"diff_span": null,
|
| 64 |
+
"commit_sha": "1cef108959b5436f53e67fd8c80c914485292276"
|
| 65 |
+
},
|
| 66 |
+
{
|
| 67 |
+
"id": "crates/common_utils/src/id_type/global_id/customer.rs::impl::GlobalCustomerId",
|
| 68 |
+
"file": "crates/common_utils/src/id_type/global_id/customer.rs",
|
| 69 |
+
"kind": "impl_item",
|
| 70 |
+
"status": "added",
|
| 71 |
+
"before_code": null,
|
| 72 |
+
"after_code": "impl GlobalCustomerId {\n /// Get string representation of the id\n pub fn get_string_repr(&self) -> &str {\n self.0.get_string_repr()\n }\n\n /// Generate a new GlobalCustomerId from a cell id\n pub fn generate(cell_id: &crate::id_type::CellId) -> Self {\n let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Customer);\n Self(global_id)\n }\n}",
|
| 73 |
+
"diff_span": null,
|
| 74 |
+
"commit_sha": "1cef108959b5436f53e67fd8c80c914485292276"
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"id": "crates/common_utils/src/id_type/global_id/customer.rs::GlobalCustomerId::function::generate",
|
| 78 |
+
"file": "crates/common_utils/src/id_type/global_id/customer.rs",
|
| 79 |
+
"kind": "function_item",
|
| 80 |
+
"status": "added",
|
| 81 |
+
"before_code": null,
|
| 82 |
+
"after_code": "pub fn generate(cell_id: &crate::id_type::CellId) -> Self {\n let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Customer);\n Self(global_id)\n }",
|
| 83 |
+
"diff_span": null,
|
| 84 |
+
"commit_sha": "1cef108959b5436f53e67fd8c80c914485292276"
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"id": "crates/common_utils/src/id_type/global_id/customer.rs::GlobalCustomerId::function::get_string_repr",
|
| 88 |
+
"file": "crates/common_utils/src/id_type/global_id/customer.rs",
|
| 89 |
+
"kind": "function_item",
|
| 90 |
+
"status": "added",
|
| 91 |
+
"before_code": null,
|
| 92 |
+
"after_code": "pub fn get_string_repr(&self) -> &str {\n self.0.get_string_repr()\n }",
|
| 93 |
+
"diff_span": null,
|
| 94 |
+
"commit_sha": "1cef108959b5436f53e67fd8c80c914485292276"
|
| 95 |
+
}
|
| 96 |
+
]
|
| 97 |
+
}
|
diffs/pr_6836/24e7cc5/diff.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "24e7cc52d8371d2bd85a20631cb3b268fb1a0f6c",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/router/src/routes/app.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": []
|
| 8 |
+
}
|
diffs/pr_6836/25111ec/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6836/2a72106/diff.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "2a721067517999bf16ca253e7bd4c8c8fcc942ed",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/openapi/src/openapi.rs",
|
| 6 |
+
"crates/openapi/src/openapi_v2.rs",
|
| 7 |
+
"crates/openapi/src/routes/customers.rs"
|
| 8 |
+
],
|
| 9 |
+
"diffs": []
|
| 10 |
+
}
|
diffs/pr_6836/2f30119/diff.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "2f30119c69a90e3cbfbed35da535b1be88518e97",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/api_models/src/customers.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": [
|
| 8 |
+
{
|
| 9 |
+
"id": "crates/api_models/src/customers.rs::struct::CustomerResponse",
|
| 10 |
+
"file": "crates/api_models/src/customers.rs",
|
| 11 |
+
"kind": "struct_item",
|
| 12 |
+
"status": "modified",
|
| 13 |
+
"code_changed": true,
|
| 14 |
+
"imports_changed": false,
|
| 15 |
+
"before_code": "pub struct CustomerResponse {\n /// The identifier for the customer object\n #[schema(value_type = String, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub merchant_reference_id: Option<id_type::CustomerId>,\n /// The customer's name\n #[schema(max_length = 255, value_type = Option<String>, example = \"Jon Test\")]\n pub name: crypto::OptionalEncryptableName,\n /// The customer's email address\n #[schema(value_type = Option<String> ,max_length = 255, example = \"JonTest@test.com\")]\n pub email: crypto::OptionalEncryptableEmail,\n /// The customer's phone number\n #[schema(value_type = Option<String>,max_length = 255, example = \"9123456789\")]\n pub phone: crypto::OptionalEncryptablePhone,\n /// The country code for the customer phone number\n #[schema(max_length = 255, example = \"+65\")]\n pub phone_country_code: Option<String>,\n /// An arbitrary string that you can attach to a customer object.\n #[schema(max_length = 255, example = \"First Customer\", value_type = Option<String>)]\n pub description: Option<Description>,\n /// The default billing address for the customer\n #[schema(value_type = Option<AddressDetails>)]\n pub default_billing_address: Option<payments::AddressDetails>,\n /// The default shipping address for the customer\n #[schema(value_type = Option<AddressDetails>)]\n pub default_shipping_address: Option<payments::AddressDetails>,\n /// A timestamp (ISO 8601 code) that determines when the customer was created\n #[schema(value_type = PrimitiveDateTime,example = \"2023-01-18T11:04:09.922Z\")]\n #[serde(with = \"custom_serde::iso8601\")]\n pub created_at: time::PrimitiveDateTime,\n /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500\n /// characters long. Metadata is useful for storing additional, structured information on an\n /// object.\n #[schema(value_type = Option<Object>,example = json!({ \"city\": \"NY\", \"unit\": \"245\" }))]\n pub metadata: Option<pii::SecretSerdeValue>,\n /// The identifier for the default payment method.\n #[schema(max_length = 64, example = \"pm_djh2837dwduh890123\")]\n pub default_payment_method_id: Option<String>,\n /// Global id\n pub id: String,\n}",
|
| 16 |
+
"after_code": "pub struct CustomerResponse {\n /// Global id\n pub id: String,\n /// The identifier for the customer object\n #[schema(value_type = String, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub merchant_reference_id: Option<id_type::CustomerId>,\n /// The customer's name\n #[schema(max_length = 255, value_type = Option<String>, example = \"Jon Test\")]\n pub name: crypto::OptionalEncryptableName,\n /// The customer's email address\n #[schema(value_type = Option<String> ,max_length = 255, example = \"JonTest@test.com\")]\n pub email: crypto::OptionalEncryptableEmail,\n /// The customer's phone number\n #[schema(value_type = Option<String>,max_length = 255, example = \"9123456789\")]\n pub phone: crypto::OptionalEncryptablePhone,\n /// The country code for the customer phone number\n #[schema(max_length = 255, example = \"+65\")]\n pub phone_country_code: Option<String>,\n /// An arbitrary string that you can attach to a customer object.\n #[schema(max_length = 255, example = \"First Customer\", value_type = Option<String>)]\n pub description: Option<Description>,\n /// The default billing address for the customer\n #[schema(value_type = Option<AddressDetails>)]\n pub default_billing_address: Option<payments::AddressDetails>,\n /// The default shipping address for the customer\n #[schema(value_type = Option<AddressDetails>)]\n pub default_shipping_address: Option<payments::AddressDetails>,\n /// A timestamp (ISO 8601 code) that determines when the customer was created\n #[schema(value_type = PrimitiveDateTime,example = \"2023-01-18T11:04:09.922Z\")]\n #[serde(with = \"custom_serde::iso8601\")]\n pub created_at: time::PrimitiveDateTime,\n /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500\n /// characters long. Metadata is useful for storing additional, structured information on an\n /// object.\n #[schema(value_type = Option<Object>,example = json!({ \"city\": \"NY\", \"unit\": \"245\" }))]\n pub metadata: Option<pii::SecretSerdeValue>,\n /// The identifier for the default payment method.\n #[schema(max_length = 64, example = \"pm_djh2837dwduh890123\")]\n pub default_payment_method_id: Option<String>,\n}",
|
| 17 |
+
"diff_span": {
|
| 18 |
+
"before": " #[schema(max_length = 64, example = \"pm_djh2837dwduh890123\")]\n pub default_payment_method_id: Option<String>,\n /// Global id\n pub id: String,\n}",
|
| 19 |
+
"after": "pub struct CustomerResponse {\n /// Global id\n pub id: String,\n /// The identifier for the customer object\n #[schema(value_type = String, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]"
|
| 20 |
+
},
|
| 21 |
+
"commit_sha": "2f30119c69a90e3cbfbed35da535b1be88518e97"
|
| 22 |
+
}
|
| 23 |
+
]
|
| 24 |
+
}
|
diffs/pr_6836/38cc82e/diff.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "38cc82e1357c70fd115d7d2db6a300626b4cf024",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/api_models/src/customers.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": []
|
| 8 |
+
}
|
diffs/pr_6836/3cbb5ba/diff.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "3cbb5baa813f18f3288eb632b6bab5992effbb1b",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/api_models/src/customers.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": [
|
| 8 |
+
{
|
| 9 |
+
"id": "crates/api_models/src/customers.rs::struct::CustomerDeleteResponse",
|
| 10 |
+
"file": "crates/api_models/src/customers.rs",
|
| 11 |
+
"kind": "struct_item",
|
| 12 |
+
"status": "modified",
|
| 13 |
+
"code_changed": true,
|
| 14 |
+
"imports_changed": false,
|
| 15 |
+
"before_code": "pub struct CustomerDeleteResponse {\n /// Global id\n pub id: id_type::GlobalCustomerId,\n /// The identifier for the customer object\n #[schema(value_type = String, max_length = 255, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub merchant_reference_id: Option<id_type::CustomerId>,\n /// Whether customer was deleted or not\n #[schema(example = false)]\n pub customer_deleted: bool,\n /// Whether address was deleted or not\n #[schema(example = false)]\n pub address_deleted: bool,\n /// Whether payment methods deleted or not\n #[schema(example = false)]\n pub payment_methods_deleted: bool,\n}",
|
| 16 |
+
"after_code": "pub struct CustomerDeleteResponse {\n /// Unique identifier for the customer\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub id: id_type::GlobalCustomerId,\n /// The identifier for the customer object\n #[schema(value_type = String, max_length = 255, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub merchant_reference_id: Option<id_type::CustomerId>,\n /// Whether customer was deleted or not\n #[schema(example = false)]\n pub customer_deleted: bool,\n /// Whether address was deleted or not\n #[schema(example = false)]\n pub address_deleted: bool,\n /// Whether payment methods deleted or not\n #[schema(example = false)]\n pub payment_methods_deleted: bool,\n}",
|
| 17 |
+
"diff_span": {
|
| 18 |
+
"before": "pub struct CustomerDeleteResponse {\n /// Global id\n pub id: id_type::GlobalCustomerId,\n /// The identifier for the customer object",
|
| 19 |
+
"after": "pub struct CustomerDeleteResponse {\n /// Unique identifier for the customer\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub id: id_type::GlobalCustomerId,\n /// The identifier for the customer object"
|
| 20 |
+
},
|
| 21 |
+
"commit_sha": "3cbb5baa813f18f3288eb632b6bab5992effbb1b"
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"id": "crates/api_models/src/customers.rs::struct::CustomerResponse",
|
| 25 |
+
"file": "crates/api_models/src/customers.rs",
|
| 26 |
+
"kind": "struct_item",
|
| 27 |
+
"status": "modified",
|
| 28 |
+
"code_changed": true,
|
| 29 |
+
"imports_changed": false,
|
| 30 |
+
"before_code": "pub struct CustomerResponse {\n /// Global id\n pub id: id_type::GlobalCustomerId,\n /// The identifier for the customer object\n #[schema(value_type = String, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub merchant_reference_id: Option<id_type::CustomerId>,\n /// The customer's name\n #[schema(max_length = 255, value_type = Option<String>, example = \"Jon Test\")]\n pub name: crypto::OptionalEncryptableName,\n /// The customer's email address\n #[schema(value_type = Option<String> ,max_length = 255, example = \"JonTest@test.com\")]\n pub email: crypto::OptionalEncryptableEmail,\n /// The customer's phone number\n #[schema(value_type = Option<String>,max_length = 255, example = \"9123456789\")]\n pub phone: crypto::OptionalEncryptablePhone,\n /// The country code for the customer phone number\n #[schema(max_length = 255, example = \"+65\")]\n pub phone_country_code: Option<String>,\n /// An arbitrary string that you can attach to a customer object.\n #[schema(max_length = 255, example = \"First Customer\", value_type = Option<String>)]\n pub description: Option<Description>,\n /// The default billing address for the customer\n #[schema(value_type = Option<AddressDetails>)]\n pub default_billing_address: Option<payments::AddressDetails>,\n /// The default shipping address for the customer\n #[schema(value_type = Option<AddressDetails>)]\n pub default_shipping_address: Option<payments::AddressDetails>,\n /// A timestamp (ISO 8601 code) that determines when the customer was created\n #[schema(value_type = PrimitiveDateTime,example = \"2023-01-18T11:04:09.922Z\")]\n #[serde(with = \"custom_serde::iso8601\")]\n pub created_at: time::PrimitiveDateTime,\n /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500\n /// characters long. Metadata is useful for storing additional, structured information on an\n /// object.\n #[schema(value_type = Option<Object>,example = json!({ \"city\": \"NY\", \"unit\": \"245\" }))]\n pub metadata: Option<pii::SecretSerdeValue>,\n /// The identifier for the default payment method.\n #[schema(max_length = 64, example = \"pm_djh2837dwduh890123\")]\n pub default_payment_method_id: Option<String>,\n}",
|
| 31 |
+
"after_code": "pub struct CustomerResponse {\n /// Unique identifier for the customer\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub id: id_type::GlobalCustomerId,\n /// The identifier for the customer object\n #[schema(value_type = String, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub merchant_reference_id: Option<id_type::CustomerId>,\n /// The customer's name\n #[schema(max_length = 255, value_type = Option<String>, example = \"Jon Test\")]\n pub name: crypto::OptionalEncryptableName,\n /// The customer's email address\n #[schema(value_type = Option<String> ,max_length = 255, example = \"JonTest@test.com\")]\n pub email: crypto::OptionalEncryptableEmail,\n /// The customer's phone number\n #[schema(value_type = Option<String>,max_length = 255, example = \"9123456789\")]\n pub phone: crypto::OptionalEncryptablePhone,\n /// The country code for the customer phone number\n #[schema(max_length = 255, example = \"+65\")]\n pub phone_country_code: Option<String>,\n /// An arbitrary string that you can attach to a customer object.\n #[schema(max_length = 255, example = \"First Customer\", value_type = Option<String>)]\n pub description: Option<Description>,\n /// The default billing address for the customer\n #[schema(value_type = Option<AddressDetails>)]\n pub default_billing_address: Option<payments::AddressDetails>,\n /// The default shipping address for the customer\n #[schema(value_type = Option<AddressDetails>)]\n pub default_shipping_address: Option<payments::AddressDetails>,\n /// A timestamp (ISO 8601 code) that determines when the customer was created\n #[schema(value_type = PrimitiveDateTime,example = \"2023-01-18T11:04:09.922Z\")]\n #[serde(with = \"custom_serde::iso8601\")]\n pub created_at: time::PrimitiveDateTime,\n /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500\n /// characters long. Metadata is useful for storing additional, structured information on an\n /// object.\n #[schema(value_type = Option<Object>,example = json!({ \"city\": \"NY\", \"unit\": \"245\" }))]\n pub metadata: Option<pii::SecretSerdeValue>,\n /// The identifier for the default payment method.\n #[schema(max_length = 64, example = \"pm_djh2837dwduh890123\")]\n pub default_payment_method_id: Option<String>,\n}",
|
| 32 |
+
"diff_span": {
|
| 33 |
+
"before": "pub struct CustomerResponse {\n /// Global id\n pub id: id_type::GlobalCustomerId,\n /// The identifier for the customer object",
|
| 34 |
+
"after": "pub struct CustomerResponse {\n /// Unique identifier for the customer\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub id: id_type::GlobalCustomerId,\n /// The identifier for the customer object"
|
| 35 |
+
},
|
| 36 |
+
"commit_sha": "3cbb5baa813f18f3288eb632b6bab5992effbb1b"
|
| 37 |
+
}
|
| 38 |
+
]
|
| 39 |
+
}
|
diffs/pr_6836/61d7290/diff.json
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/api_models/src/customers.rs",
|
| 6 |
+
"crates/api_models/src/events/customer.rs",
|
| 7 |
+
"crates/common_utils/src/id_type/customer.rs",
|
| 8 |
+
"crates/router/src/compatibility/stripe/customers.rs",
|
| 9 |
+
"crates/router/src/core/customers.rs",
|
| 10 |
+
"crates/router/src/core/mandate.rs",
|
| 11 |
+
"crates/router/src/routes/customers.rs",
|
| 12 |
+
"crates/router/src/routes/ephemeral_key.rs",
|
| 13 |
+
"crates/router/src/types/api/customers.rs"
|
| 14 |
+
],
|
| 15 |
+
"diffs": [
|
| 16 |
+
{
|
| 17 |
+
"id": "crates/router/src/types/api/customers.rs::CustomerResponse::function::get_api_event_type",
|
| 18 |
+
"file": "crates/router/src/types/api/customers.rs",
|
| 19 |
+
"kind": "function_item",
|
| 20 |
+
"status": "modified",
|
| 21 |
+
"code_changed": false,
|
| 22 |
+
"imports_changed": true,
|
| 23 |
+
"before_code": "fn get_api_event_type(&self) -> Option<common_utils::events::ApiEventsType> {\n self.0.get_api_event_type()\n }",
|
| 24 |
+
"after_code": "fn get_api_event_type(&self) -> Option<common_utils::events::ApiEventsType> {\n self.0.get_api_event_type()\n }",
|
| 25 |
+
"diff_span": {
|
| 26 |
+
"before": "",
|
| 27 |
+
"after": ""
|
| 28 |
+
},
|
| 29 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a",
|
| 30 |
+
"before_imports": [
|
| 31 |
+
"pub use api_models::customers::{\n CustomerDeleteResponse, CustomerId, CustomerListRequest, CustomerRequest,\n CustomerUpdateRequest, CustomerUpdateRequestInternal,\n};",
|
| 32 |
+
"use crate::{\n newtype,\n types::{domain, ForeignFrom},\n};"
|
| 33 |
+
],
|
| 34 |
+
"after_imports": [
|
| 35 |
+
"use crate::{\n newtype,\n types::{domain, ForeignFrom},\n};",
|
| 36 |
+
"pub use api_models::customers::{\n CustomerDeleteResponse, CustomerListRequest, CustomerRequest, CustomerUpdateRequest,\n CustomerUpdateRequestInternal,\n};"
|
| 37 |
+
]
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"id": "crates/router/src/routes/customers.rs::function::get_customer_mandates",
|
| 41 |
+
"file": "crates/router/src/routes/customers.rs",
|
| 42 |
+
"kind": "function_item",
|
| 43 |
+
"status": "modified",
|
| 44 |
+
"code_changed": true,
|
| 45 |
+
"imports_changed": false,
|
| 46 |
+
"before_code": "pub async fn get_customer_mandates(\n state: web::Data<AppState>,\n req: HttpRequest,\n path: web::Path<id_type::CustomerId>,\n) -> impl Responder {\n let flow = Flow::CustomersGetMandates;\n let customer_id = customers::CustomerId {\n customer_id: path.into_inner(),\n };\n\n Box::pin(api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, req, _| {\n crate::core::mandate::get_customer_mandates(\n state,\n auth.merchant_account,\n auth.key_store,\n req,\n )\n },\n auth::auth_type(\n &auth::HeaderAuth(auth::ApiKeyAuth),\n &auth::JWTAuth {\n permission: Permission::MerchantMandateRead,\n },\n req.headers(),\n ),\n api_locking::LockAction::NotApplicable,\n ))\n .await\n}",
|
| 47 |
+
"after_code": "pub async fn get_customer_mandates(\n state: web::Data<AppState>,\n req: HttpRequest,\n path: web::Path<id_type::CustomerId>,\n) -> impl Responder {\n let flow = Flow::CustomersGetMandates;\n let customer_id = path.into_inner();\n\n Box::pin(api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n crate::core::mandate::get_customer_mandates(\n state,\n auth.merchant_account,\n auth.key_store,\n customer_id,\n )\n },\n auth::auth_type(\n &auth::HeaderAuth(auth::ApiKeyAuth),\n &auth::JWTAuth {\n permission: Permission::MerchantMandateRead,\n },\n req.headers(),\n ),\n api_locking::LockAction::NotApplicable,\n ))\n .await\n}",
|
| 48 |
+
"diff_span": {
|
| 49 |
+
"before": ") -> impl Responder {\n let flow = Flow::CustomersGetMandates;\n let customer_id = customers::CustomerId {\n customer_id: path.into_inner(),\n };\n\n Box::pin(api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, req, _| {\n crate::core::mandate::get_customer_mandates(\n state,\n auth.merchant_account,\n auth.key_store,\n req,\n )\n },",
|
| 50 |
+
"after": ") -> impl Responder {\n let flow = Flow::CustomersGetMandates;\n let customer_id = path.into_inner();\n\n Box::pin(api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n crate::core::mandate::get_customer_mandates(\n state,\n auth.merchant_account,\n auth.key_store,\n customer_id,\n )\n },"
|
| 51 |
+
},
|
| 52 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"id": "crates/router/src/types/api/customers.rs::CustomerResponse::function::foreign_from",
|
| 56 |
+
"file": "crates/router/src/types/api/customers.rs",
|
| 57 |
+
"kind": "function_item",
|
| 58 |
+
"status": "modified",
|
| 59 |
+
"code_changed": false,
|
| 60 |
+
"imports_changed": true,
|
| 61 |
+
"before_code": "fn foreign_from(cust: domain::Customer) -> Self {\n customers::CustomerResponse {\n merchant_reference_id: cust.merchant_reference_id,\n name: cust.name,\n email: cust.email,\n phone: cust.phone,\n phone_country_code: cust.phone_country_code,\n description: cust.description,\n created_at: cust.created_at,\n metadata: cust.metadata,\n default_billing_address: None,\n default_shipping_address: None,\n default_payment_method_id: cust.default_payment_method_id,\n id: cust.id,\n }\n .into()\n }",
|
| 62 |
+
"after_code": "fn foreign_from(cust: domain::Customer) -> Self {\n customers::CustomerResponse {\n merchant_reference_id: cust.merchant_reference_id,\n name: cust.name,\n email: cust.email,\n phone: cust.phone,\n phone_country_code: cust.phone_country_code,\n description: cust.description,\n created_at: cust.created_at,\n metadata: cust.metadata,\n default_billing_address: None,\n default_shipping_address: None,\n default_payment_method_id: cust.default_payment_method_id,\n id: cust.id,\n }\n .into()\n }",
|
| 63 |
+
"diff_span": {
|
| 64 |
+
"before": "",
|
| 65 |
+
"after": ""
|
| 66 |
+
},
|
| 67 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a",
|
| 68 |
+
"before_imports": [
|
| 69 |
+
"use hyperswitch_domain_models::customer;",
|
| 70 |
+
"use api_models::customers;",
|
| 71 |
+
"pub use api_models::customers::{\n CustomerDeleteResponse, CustomerId, CustomerListRequest, CustomerRequest,\n CustomerUpdateRequest, CustomerUpdateRequestInternal,\n};",
|
| 72 |
+
"use crate::{\n newtype,\n types::{domain, ForeignFrom},\n};"
|
| 73 |
+
],
|
| 74 |
+
"after_imports": [
|
| 75 |
+
"use hyperswitch_domain_models::customer;",
|
| 76 |
+
"use api_models::customers;",
|
| 77 |
+
"use crate::{\n newtype,\n types::{domain, ForeignFrom},\n};",
|
| 78 |
+
"pub use api_models::customers::{\n CustomerDeleteResponse, CustomerListRequest, CustomerRequest, CustomerUpdateRequest,\n CustomerUpdateRequestInternal,\n};"
|
| 79 |
+
]
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"id": "crates/router/src/routes/ephemeral_key.rs::function::ephemeral_key_create",
|
| 83 |
+
"file": "crates/router/src/routes/ephemeral_key.rs",
|
| 84 |
+
"kind": "function_item",
|
| 85 |
+
"status": "modified",
|
| 86 |
+
"code_changed": true,
|
| 87 |
+
"imports_changed": true,
|
| 88 |
+
"before_code": "pub async fn ephemeral_key_create(\n state: web::Data<AppState>,\n req: HttpRequest,\n json_payload: web::Json<customers::CustomerId>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyCreate;\n let payload = json_payload.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n payload,\n |state, auth: auth::AuthenticationData, req, _| {\n helpers::make_ephemeral_key(\n state,\n req.get_merchant_reference_id(),\n auth.merchant_account.get_id().to_owned(),\n )\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n )\n .await\n}",
|
| 89 |
+
"after_code": "pub async fn ephemeral_key_create(\n state: web::Data<AppState>,\n req: HttpRequest,\n json_payload: web::Json<common_utils::id_type::CustomerId>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyCreate;\n let customer_id = json_payload.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n helpers::make_ephemeral_key(\n state,\n customer_id,\n auth.merchant_account.get_id().to_owned(),\n )\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n )\n .await\n}",
|
| 90 |
+
"diff_span": {
|
| 91 |
+
"before": " state: web::Data<AppState>,\n req: HttpRequest,\n json_payload: web::Json<customers::CustomerId>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyCreate;\n let payload = json_payload.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n payload,\n |state, auth: auth::AuthenticationData, req, _| {\n helpers::make_ephemeral_key(\n state,\n req.get_merchant_reference_id(),\n auth.merchant_account.get_id().to_owned(),\n )",
|
| 92 |
+
"after": " state: web::Data<AppState>,\n req: HttpRequest,\n json_payload: web::Json<common_utils::id_type::CustomerId>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyCreate;\n let customer_id = json_payload.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n helpers::make_ephemeral_key(\n state,\n customer_id,\n auth.merchant_account.get_id().to_owned(),\n )"
|
| 93 |
+
},
|
| 94 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a",
|
| 95 |
+
"before_imports": [
|
| 96 |
+
"use actix_web::{web, HttpRequest, HttpResponse};",
|
| 97 |
+
"use router_env::{instrument, tracing, Flow};",
|
| 98 |
+
"use super::AppState;"
|
| 99 |
+
],
|
| 100 |
+
"after_imports": [
|
| 101 |
+
"use actix_web::{web, HttpRequest, HttpResponse};",
|
| 102 |
+
"use router_env::{instrument, tracing, Flow};",
|
| 103 |
+
"use crate::{\n core::{api_locking, payments::helpers},\n services::{api, authentication as auth},\n};",
|
| 104 |
+
"use super::AppState;"
|
| 105 |
+
]
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"id": "crates/router/src/core/customers.rs::function::delete_customer",
|
| 109 |
+
"file": "crates/router/src/core/customers.rs",
|
| 110 |
+
"kind": "function_item",
|
| 111 |
+
"status": "modified",
|
| 112 |
+
"code_changed": true,
|
| 113 |
+
"imports_changed": false,
|
| 114 |
+
"before_code": "pub async fn delete_customer(\n state: SessionState,\n merchant_account: domain::MerchantAccount,\n req: customers::CustomerId,\n key_store: domain::MerchantKeyStore,\n) -> errors::CustomerResponse<customers::CustomerDeleteResponse> {\n let db = &*state.store;\n let key_manager_state = &(&state).into();\n req.fetch_domain_model_and_update_and_generate_delete_customer_response(\n db,\n &key_store,\n &merchant_account,\n key_manager_state,\n &state,\n )\n .await\n}",
|
| 115 |
+
"after_code": "pub async fn delete_customer(\n state: SessionState,\n merchant_account: domain::MerchantAccount,\n customer_id: id_type::CustomerId,\n key_store: domain::MerchantKeyStore,\n) -> errors::CustomerResponse<customers::CustomerDeleteResponse> {\n let db = &*state.store;\n let key_manager_state = &(&state).into();\n customer_id\n .fetch_domain_model_and_update_and_generate_delete_customer_response(\n db,\n &key_store,\n &merchant_account,\n key_manager_state,\n &state,\n )\n .await\n}",
|
| 116 |
+
"diff_span": {
|
| 117 |
+
"before": " state: SessionState,\n merchant_account: domain::MerchantAccount,\n req: customers::CustomerId,\n key_store: domain::MerchantKeyStore,\n) -> errors::CustomerResponse<customers::CustomerDeleteResponse> {\n let db = &*state.store;\n let key_manager_state = &(&state).into();\n req.fetch_domain_model_and_update_and_generate_delete_customer_response(\n db,\n &key_store,\n &merchant_account,\n key_manager_state,\n &state,\n )\n .await\n}",
|
| 118 |
+
"after": " state: SessionState,\n merchant_account: domain::MerchantAccount,\n customer_id: id_type::CustomerId,\n key_store: domain::MerchantKeyStore,\n) -> errors::CustomerResponse<customers::CustomerDeleteResponse> {\n let db = &*state.store;\n let key_manager_state = &(&state).into();\n customer_id\n .fetch_domain_model_and_update_and_generate_delete_customer_response(\n db,\n &key_store,\n &merchant_account,\n key_manager_state,\n &state,\n )\n .await\n}"
|
| 119 |
+
},
|
| 120 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
"id": "crates/router/src/compatibility/stripe/customers.rs::function::customer_delete",
|
| 124 |
+
"file": "crates/router/src/compatibility/stripe/customers.rs",
|
| 125 |
+
"kind": "function_item",
|
| 126 |
+
"status": "modified",
|
| 127 |
+
"code_changed": true,
|
| 128 |
+
"imports_changed": false,
|
| 129 |
+
"before_code": "pub async fn customer_delete(\n state: web::Data<routes::AppState>,\n req: HttpRequest,\n path: web::Path<id_type::CustomerId>,\n) -> HttpResponse {\n let payload = customer_types::CustomerId::new_customer_id_struct(path.into_inner());\n\n let flow = Flow::CustomersDelete;\n\n Box::pin(wrap::compatibility_api_wrap::<\n _,\n _,\n _,\n _,\n _,\n types::CustomerDeleteResponse,\n errors::StripeErrorCode,\n _,\n >(\n flow,\n state.into_inner(),\n &req,\n payload,\n |state, auth: auth::AuthenticationData, req, _| {\n customers::delete_customer(state, auth.merchant_account, req, auth.key_store)\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n ))\n .await\n}",
|
| 130 |
+
"after_code": "pub async fn customer_delete(\n state: web::Data<routes::AppState>,\n req: HttpRequest,\n path: web::Path<id_type::CustomerId>,\n) -> HttpResponse {\n let customer_id = path.into_inner();\n\n let flow = Flow::CustomersDelete;\n\n Box::pin(wrap::compatibility_api_wrap::<\n _,\n _,\n _,\n _,\n _,\n types::CustomerDeleteResponse,\n errors::StripeErrorCode,\n _,\n >(\n flow,\n state.into_inner(),\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n customers::delete_customer(state, auth.merchant_account, customer_id, auth.key_store)\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n ))\n .await\n}",
|
| 131 |
+
"diff_span": {
|
| 132 |
+
"before": " path: web::Path<id_type::CustomerId>,\n) -> HttpResponse {\n let payload = customer_types::CustomerId::new_customer_id_struct(path.into_inner());\n\n let flow = Flow::CustomersDelete;\n\n Box::pin(wrap::compatibility_api_wrap::<\n _,\n _,\n _,\n _,\n _,\n types::CustomerDeleteResponse,\n errors::StripeErrorCode,\n _,\n >(\n flow,\n state.into_inner(),\n &req,\n payload,\n |state, auth: auth::AuthenticationData, req, _| {\n customers::delete_customer(state, auth.merchant_account, req, auth.key_store)\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),",
|
| 133 |
+
"after": " path: web::Path<id_type::CustomerId>,\n) -> HttpResponse {\n let customer_id = path.into_inner();\n\n let flow = Flow::CustomersDelete;\n\n Box::pin(wrap::compatibility_api_wrap::<\n _,\n _,\n _,\n _,\n _,\n types::CustomerDeleteResponse,\n errors::StripeErrorCode,\n _,\n >(\n flow,\n state.into_inner(),\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n customers::delete_customer(state, auth.merchant_account, customer_id, auth.key_store)\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),"
|
| 134 |
+
},
|
| 135 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"id": "crates/router/src/compatibility/stripe/customers.rs::function::customer_retrieve",
|
| 139 |
+
"file": "crates/router/src/compatibility/stripe/customers.rs",
|
| 140 |
+
"kind": "function_item",
|
| 141 |
+
"status": "modified",
|
| 142 |
+
"code_changed": true,
|
| 143 |
+
"imports_changed": false,
|
| 144 |
+
"before_code": "pub async fn customer_retrieve(\n state: web::Data<routes::AppState>,\n req: HttpRequest,\n path: web::Path<id_type::CustomerId>,\n) -> HttpResponse {\n let payload = customer_types::CustomerId::new_customer_id_struct(path.into_inner());\n\n let flow = Flow::CustomersRetrieve;\n\n Box::pin(wrap::compatibility_api_wrap::<\n _,\n _,\n _,\n _,\n _,\n types::CustomerRetrieveResponse,\n errors::StripeErrorCode,\n _,\n >(\n flow,\n state.into_inner(),\n &req,\n payload,\n |state, auth: auth::AuthenticationData, req, _| {\n customers::retrieve_customer(state, auth.merchant_account, None, auth.key_store, req)\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n ))\n .await\n}",
|
| 145 |
+
"after_code": "pub async fn customer_retrieve(\n state: web::Data<routes::AppState>,\n req: HttpRequest,\n path: web::Path<id_type::CustomerId>,\n) -> HttpResponse {\n let customer_id = path.into_inner();\n\n let flow = Flow::CustomersRetrieve;\n\n Box::pin(wrap::compatibility_api_wrap::<\n _,\n _,\n _,\n _,\n _,\n types::CustomerRetrieveResponse,\n errors::StripeErrorCode,\n _,\n >(\n flow,\n state.into_inner(),\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n customers::retrieve_customer(\n state,\n auth.merchant_account,\n None,\n auth.key_store,\n customer_id,\n )\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n ))\n .await\n}",
|
| 146 |
+
"diff_span": {
|
| 147 |
+
"before": " path: web::Path<id_type::CustomerId>,\n) -> HttpResponse {\n let payload = customer_types::CustomerId::new_customer_id_struct(path.into_inner());\n\n let flow = Flow::CustomersRetrieve;\n\n Box::pin(wrap::compatibility_api_wrap::<\n _,\n _,\n _,\n _,\n _,\n types::CustomerRetrieveResponse,\n errors::StripeErrorCode,\n _,\n >(\n flow,\n state.into_inner(),\n &req,\n payload,\n |state, auth: auth::AuthenticationData, req, _| {\n customers::retrieve_customer(state, auth.merchant_account, None, auth.key_store, req)\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),",
|
| 148 |
+
"after": " path: web::Path<id_type::CustomerId>,\n) -> HttpResponse {\n let customer_id = path.into_inner();\n\n let flow = Flow::CustomersRetrieve;\n\n Box::pin(wrap::compatibility_api_wrap::<\n _,\n _,\n _,\n _,\n _,\n types::CustomerRetrieveResponse,\n errors::StripeErrorCode,\n _,\n >(\n flow,\n state.into_inner(),\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n customers::retrieve_customer(\n state,\n auth.merchant_account,\n None,\n auth.key_store,\n customer_id,\n )\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),"
|
| 149 |
+
},
|
| 150 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"id": "crates/router/src/routes/ephemeral_key.rs::function::ephemeral_key_delete",
|
| 154 |
+
"file": "crates/router/src/routes/ephemeral_key.rs",
|
| 155 |
+
"kind": "function_item",
|
| 156 |
+
"status": "modified",
|
| 157 |
+
"code_changed": false,
|
| 158 |
+
"imports_changed": true,
|
| 159 |
+
"before_code": "pub async fn ephemeral_key_delete(\n state: web::Data<AppState>,\n req: HttpRequest,\n path: web::Path<String>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyDelete;\n let payload = path.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n payload,\n |state, _: auth::AuthenticationData, req, _| helpers::delete_ephemeral_key(state, req),\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n )\n .await\n}",
|
| 160 |
+
"after_code": "pub async fn ephemeral_key_delete(\n state: web::Data<AppState>,\n req: HttpRequest,\n path: web::Path<String>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyDelete;\n let payload = path.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n payload,\n |state, _: auth::AuthenticationData, req, _| helpers::delete_ephemeral_key(state, req),\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n )\n .await\n}",
|
| 161 |
+
"diff_span": {
|
| 162 |
+
"before": "",
|
| 163 |
+
"after": ""
|
| 164 |
+
},
|
| 165 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a",
|
| 166 |
+
"before_imports": [
|
| 167 |
+
"use actix_web::{web, HttpRequest, HttpResponse};",
|
| 168 |
+
"use router_env::{instrument, tracing, Flow};",
|
| 169 |
+
"use super::AppState;"
|
| 170 |
+
],
|
| 171 |
+
"after_imports": [
|
| 172 |
+
"use actix_web::{web, HttpRequest, HttpResponse};",
|
| 173 |
+
"use router_env::{instrument, tracing, Flow};",
|
| 174 |
+
"use crate::{\n core::{api_locking, payments::helpers},\n services::{api, authentication as auth},\n};",
|
| 175 |
+
"use super::AppState;"
|
| 176 |
+
]
|
| 177 |
+
},
|
| 178 |
+
{
|
| 179 |
+
"id": "crates/router/src/core/mandate.rs::function::get_customer_mandates",
|
| 180 |
+
"file": "crates/router/src/core/mandate.rs",
|
| 181 |
+
"kind": "function_item",
|
| 182 |
+
"status": "modified",
|
| 183 |
+
"code_changed": true,
|
| 184 |
+
"imports_changed": false,
|
| 185 |
+
"before_code": "pub async fn get_customer_mandates(\n state: SessionState,\n merchant_account: domain::MerchantAccount,\n key_store: domain::MerchantKeyStore,\n req: customers::CustomerId,\n) -> RouterResponse<Vec<mandates::MandateResponse>> {\n let mandates = state\n .store\n .find_mandate_by_merchant_id_customer_id(\n merchant_account.get_id(),\n &req.get_merchant_reference_id(),\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable_lazy(|| {\n format!(\n \"Failed while finding mandate: merchant_id: {:?}, customer_id: {:?}\",\n merchant_account.get_id(),\n req.get_merchant_reference_id()\n )\n })?;\n\n if mandates.is_empty() {\n Err(report!(errors::ApiErrorResponse::MandateNotFound).attach_printable(\"No Mandate found\"))\n } else {\n let mut response_vec = Vec::with_capacity(mandates.len());\n for mandate in mandates {\n response_vec.push(\n mandates::MandateResponse::from_db_mandate(\n &state,\n key_store.clone(),\n mandate,\n merchant_account.storage_scheme,\n )\n .await?,\n );\n }\n Ok(services::ApplicationResponse::Json(response_vec))\n }\n}",
|
| 186 |
+
"after_code": "pub async fn get_customer_mandates(\n state: SessionState,\n merchant_account: domain::MerchantAccount,\n key_store: domain::MerchantKeyStore,\n customer_id: id_type::CustomerId,\n) -> RouterResponse<Vec<mandates::MandateResponse>> {\n let mandates = state\n .store\n .find_mandate_by_merchant_id_customer_id(merchant_account.get_id(), &customer_id)\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable_lazy(|| {\n format!(\n \"Failed while finding mandate: merchant_id: {:?}, customer_id: {:?}\",\n merchant_account.get_id(),\n customer_id,\n )\n })?;\n\n if mandates.is_empty() {\n Err(report!(errors::ApiErrorResponse::MandateNotFound).attach_printable(\"No Mandate found\"))\n } else {\n let mut response_vec = Vec::with_capacity(mandates.len());\n for mandate in mandates {\n response_vec.push(\n mandates::MandateResponse::from_db_mandate(\n &state,\n key_store.clone(),\n mandate,\n merchant_account.storage_scheme,\n )\n .await?,\n );\n }\n Ok(services::ApplicationResponse::Json(response_vec))\n }\n}",
|
| 187 |
+
"diff_span": {
|
| 188 |
+
"before": " merchant_account: domain::MerchantAccount,\n key_store: domain::MerchantKeyStore,\n req: customers::CustomerId,\n) -> RouterResponse<Vec<mandates::MandateResponse>> {\n let mandates = state\n .store\n .find_mandate_by_merchant_id_customer_id(\n merchant_account.get_id(),\n &req.get_merchant_reference_id(),\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable_lazy(|| {\n format!(\n \"Failed while finding mandate: merchant_id: {:?}, customer_id: {:?}\",\n merchant_account.get_id(),\n req.get_merchant_reference_id()\n )\n })?;",
|
| 189 |
+
"after": " merchant_account: domain::MerchantAccount,\n key_store: domain::MerchantKeyStore,\n customer_id: id_type::CustomerId,\n) -> RouterResponse<Vec<mandates::MandateResponse>> {\n let mandates = state\n .store\n .find_mandate_by_merchant_id_customer_id(merchant_account.get_id(), &customer_id)\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable_lazy(|| {\n format!(\n \"Failed while finding mandate: merchant_id: {:?}, customer_id: {:?}\",\n merchant_account.get_id(),\n customer_id,\n )\n })?;"
|
| 190 |
+
},
|
| 191 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 192 |
+
},
|
| 193 |
+
{
|
| 194 |
+
"id": "crates/router/src/routes/customers.rs::function::customers_delete",
|
| 195 |
+
"file": "crates/router/src/routes/customers.rs",
|
| 196 |
+
"kind": "function_item",
|
| 197 |
+
"status": "modified",
|
| 198 |
+
"code_changed": true,
|
| 199 |
+
"imports_changed": false,
|
| 200 |
+
"before_code": "pub async fn customers_delete(\n state: web::Data<AppState>,\n req: HttpRequest,\n path: web::Path<id_type::CustomerId>,\n) -> impl Responder {\n let flow = Flow::CustomersDelete;\n let payload = web::Json(customers::CustomerId {\n customer_id: path.into_inner(),\n })\n .into_inner();\n\n Box::pin(api::server_wrap(\n flow,\n state,\n &req,\n payload,\n |state, auth: auth::AuthenticationData, req, _| {\n delete_customer(state, auth.merchant_account, req, auth.key_store)\n },\n auth::auth_type(\n &auth::HeaderAuth(auth::ApiKeyAuth),\n &auth::JWTAuth {\n permission: Permission::MerchantCustomerWrite,\n },\n req.headers(),\n ),\n api_locking::LockAction::NotApplicable,\n ))\n .await\n}",
|
| 201 |
+
"after_code": "pub async fn customers_delete(\n state: web::Data<AppState>,\n req: HttpRequest,\n path: web::Path<id_type::CustomerId>,\n) -> impl Responder {\n let flow = Flow::CustomersDelete;\n let customer_id = path.into_inner();\n\n Box::pin(api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n delete_customer(state, auth.merchant_account, customer_id, auth.key_store)\n },\n auth::auth_type(\n &auth::HeaderAuth(auth::ApiKeyAuth),\n &auth::JWTAuth {\n permission: Permission::MerchantCustomerWrite,\n },\n req.headers(),\n ),\n api_locking::LockAction::NotApplicable,\n ))\n .await\n}",
|
| 202 |
+
"diff_span": {
|
| 203 |
+
"before": ") -> impl Responder {\n let flow = Flow::CustomersDelete;\n let payload = web::Json(customers::CustomerId {\n customer_id: path.into_inner(),\n })\n .into_inner();\n\n Box::pin(api::server_wrap(\n flow,\n state,\n &req,\n payload,\n |state, auth: auth::AuthenticationData, req, _| {\n delete_customer(state, auth.merchant_account, req, auth.key_store)\n },\n auth::auth_type(",
|
| 204 |
+
"after": ") -> impl Responder {\n let flow = Flow::CustomersDelete;\n let customer_id = path.into_inner();\n\n Box::pin(api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n delete_customer(state, auth.merchant_account, customer_id, auth.key_store)\n },\n auth::auth_type("
|
| 205 |
+
},
|
| 206 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"id": "crates/router/src/types/api/customers.rs::impl::CustomerResponse",
|
| 210 |
+
"file": "crates/router/src/types/api/customers.rs",
|
| 211 |
+
"kind": "impl_item",
|
| 212 |
+
"status": "modified",
|
| 213 |
+
"code_changed": false,
|
| 214 |
+
"imports_changed": true,
|
| 215 |
+
"before_code": "impl ForeignFrom<customer::Customer> for CustomerResponse {\n fn foreign_from(cust: domain::Customer) -> Self {\n customers::CustomerResponse {\n merchant_reference_id: cust.merchant_reference_id,\n name: cust.name,\n email: cust.email,\n phone: cust.phone,\n phone_country_code: cust.phone_country_code,\n description: cust.description,\n created_at: cust.created_at,\n metadata: cust.metadata,\n default_billing_address: None,\n default_shipping_address: None,\n default_payment_method_id: cust.default_payment_method_id,\n id: cust.id,\n }\n .into()\n }\n}",
|
| 216 |
+
"after_code": "impl ForeignFrom<customer::Customer> for CustomerResponse {\n fn foreign_from(cust: domain::Customer) -> Self {\n customers::CustomerResponse {\n merchant_reference_id: cust.merchant_reference_id,\n name: cust.name,\n email: cust.email,\n phone: cust.phone,\n phone_country_code: cust.phone_country_code,\n description: cust.description,\n created_at: cust.created_at,\n metadata: cust.metadata,\n default_billing_address: None,\n default_shipping_address: None,\n default_payment_method_id: cust.default_payment_method_id,\n id: cust.id,\n }\n .into()\n }\n}",
|
| 217 |
+
"diff_span": {
|
| 218 |
+
"before": "",
|
| 219 |
+
"after": ""
|
| 220 |
+
},
|
| 221 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a",
|
| 222 |
+
"before_imports": [
|
| 223 |
+
"use hyperswitch_domain_models::customer;",
|
| 224 |
+
"use api_models::customers;",
|
| 225 |
+
"pub use api_models::customers::{\n CustomerDeleteResponse, CustomerId, CustomerListRequest, CustomerRequest,\n CustomerUpdateRequest, CustomerUpdateRequestInternal,\n};",
|
| 226 |
+
"use crate::{\n newtype,\n types::{domain, ForeignFrom},\n};"
|
| 227 |
+
],
|
| 228 |
+
"after_imports": [
|
| 229 |
+
"use hyperswitch_domain_models::customer;",
|
| 230 |
+
"use api_models::customers;",
|
| 231 |
+
"use crate::{\n newtype,\n types::{domain, ForeignFrom},\n};",
|
| 232 |
+
"pub use api_models::customers::{\n CustomerDeleteResponse, CustomerListRequest, CustomerRequest, CustomerUpdateRequest,\n CustomerUpdateRequestInternal,\n};"
|
| 233 |
+
]
|
| 234 |
+
},
|
| 235 |
+
{
|
| 236 |
+
"id": "crates/router/src/core/customers.rs::impl::id_type::CustomerId",
|
| 237 |
+
"file": "crates/router/src/core/customers.rs",
|
| 238 |
+
"kind": "impl_item",
|
| 239 |
+
"status": "added",
|
| 240 |
+
"before_code": null,
|
| 241 |
+
"after_code": "impl CustomerDeleteBridge for id_type::CustomerId {\n async fn fetch_domain_model_and_update_and_generate_delete_customer_response<'a>(\n &'a self,\n db: &'a dyn StorageInterface,\n key_store: &'a domain::MerchantKeyStore,\n merchant_account: &'a domain::MerchantAccount,\n key_manager_state: &'a KeyManagerState,\n state: &'a SessionState,\n ) -> errors::CustomerResponse<customers::CustomerDeleteResponse> {\n let customer_orig = db\n .find_customer_by_customer_id_merchant_id(\n key_manager_state,\n self,\n merchant_account.get_id(),\n key_store,\n merchant_account.storage_scheme,\n )\n .await\n .switch()?;\n\n let customer_mandates = db\n .find_mandate_by_merchant_id_customer_id(merchant_account.get_id(), self)\n .await\n .switch()?;\n\n for mandate in customer_mandates.into_iter() {\n if mandate.mandate_status == enums::MandateStatus::Active {\n Err(errors::CustomersErrorResponse::MandateActive)?\n }\n }\n\n match db\n .find_payment_method_by_customer_id_merchant_id_list(\n key_manager_state,\n key_store,\n self,\n merchant_account.get_id(),\n None,\n )\n .await\n {\n // check this in review\n Ok(customer_payment_methods) => {\n for pm in customer_payment_methods.into_iter() {\n if pm.get_payment_method_type() == Some(enums::PaymentMethod::Card) {\n cards::delete_card_from_locker(\n state,\n self,\n merchant_account.get_id(),\n pm.locker_id.as_ref().unwrap_or(&pm.payment_method_id),\n )\n .await\n .switch()?;\n\n if let Some(network_token_ref_id) = pm.network_token_requestor_reference_id\n {\n network_tokenization::delete_network_token_from_locker_and_token_service(\n state,\n self,\n merchant_account.get_id(),\n pm.payment_method_id.clone(),\n pm.network_token_locker_id,\n network_token_ref_id,\n )\n .await\n .switch()?;\n }\n }\n\n db.delete_payment_method_by_merchant_id_payment_method_id(\n key_manager_state,\n key_store,\n merchant_account.get_id(),\n &pm.payment_method_id,\n )\n .await\n .switch()?;\n }\n }\n Err(error) => {\n if error.current_context().is_db_not_found() {\n Ok(())\n } else {\n Err(error)\n .change_context(errors::CustomersErrorResponse::InternalServerError)\n .attach_printable(\n \"failed find_payment_method_by_customer_id_merchant_id_list\",\n )\n }?\n }\n };\n\n let key = key_store.key.get_inner().peek();\n let identifier = Identifier::Merchant(key_store.merchant_id.clone());\n let redacted_encrypted_value: Encryptable<Secret<_>> = types::crypto_operation(\n key_manager_state,\n type_name!(storage::Address),\n types::CryptoOperation::Encrypt(REDACTED.to_string().into()),\n identifier.clone(),\n key,\n )\n .await\n .and_then(|val| val.try_into_operation())\n .switch()?;\n\n let redacted_encrypted_email = Encryptable::new(\n redacted_encrypted_value\n .clone()\n .into_inner()\n .switch_strategy(),\n redacted_encrypted_value.clone().into_encrypted(),\n );\n\n let update_address = storage::AddressUpdate::Update {\n city: Some(REDACTED.to_string()),\n country: None,\n line1: Some(redacted_encrypted_value.clone()),\n line2: Some(redacted_encrypted_value.clone()),\n line3: Some(redacted_encrypted_value.clone()),\n state: Some(redacted_encrypted_value.clone()),\n zip: Some(redacted_encrypted_value.clone()),\n first_name: Some(redacted_encrypted_value.clone()),\n last_name: Some(redacted_encrypted_value.clone()),\n phone_number: Some(redacted_encrypted_value.clone()),\n country_code: Some(REDACTED.to_string()),\n updated_by: merchant_account.storage_scheme.to_string(),\n email: Some(redacted_encrypted_email),\n };\n\n match db\n .update_address_by_merchant_id_customer_id(\n key_manager_state,\n self,\n merchant_account.get_id(),\n update_address,\n key_store,\n )\n .await\n {\n Ok(_) => Ok(()),\n Err(error) => {\n if error.current_context().is_db_not_found() {\n Ok(())\n } else {\n Err(error)\n .change_context(errors::CustomersErrorResponse::InternalServerError)\n .attach_printable(\"failed update_address_by_merchant_id_customer_id\")\n }\n }\n }?;\n\n let updated_customer = storage::CustomerUpdate::Update {\n name: Some(redacted_encrypted_value.clone()),\n email: Some(\n types::crypto_operation(\n key_manager_state,\n type_name!(storage::Customer),\n types::CryptoOperation::Encrypt(REDACTED.to_string().into()),\n identifier,\n key,\n )\n .await\n .and_then(|val| val.try_into_operation())\n .switch()?,\n ),\n phone: Box::new(Some(redacted_encrypted_value.clone())),\n description: Some(Description::from_str_unchecked(REDACTED)),\n phone_country_code: Some(REDACTED.to_string()),\n metadata: None,\n connector_customer: Box::new(None),\n address_id: None,\n };\n\n db.update_customer_by_customer_id_merchant_id(\n key_manager_state,\n self.clone(),\n merchant_account.get_id().to_owned(),\n customer_orig,\n updated_customer,\n key_store,\n merchant_account.storage_scheme,\n )\n .await\n .switch()?;\n\n let response = customers::CustomerDeleteResponse {\n customer_id: self.clone(),\n customer_deleted: true,\n address_deleted: true,\n payment_methods_deleted: true,\n };\n metrics::CUSTOMER_REDACTED.add(1, &[]);\n Ok(services::ApplicationResponse::Json(response))\n }\n}",
|
| 242 |
+
"diff_span": null,
|
| 243 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 244 |
+
},
|
| 245 |
+
{
|
| 246 |
+
"id": "crates/common_utils/src/id_type/customer.rs::impl::CustomerId",
|
| 247 |
+
"file": "crates/common_utils/src/id_type/customer.rs",
|
| 248 |
+
"kind": "impl_item",
|
| 249 |
+
"status": "added",
|
| 250 |
+
"before_code": null,
|
| 251 |
+
"after_code": "impl crate::events::ApiEventMetric for CustomerId {\n fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {\n Some(crate::events::ApiEventsType::Customer {\n customer_id: self.clone(),\n })\n }\n}",
|
| 252 |
+
"diff_span": null,
|
| 253 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 254 |
+
},
|
| 255 |
+
{
|
| 256 |
+
"id": "crates/router/src/core/customers.rs::id_type::CustomerId::function::fetch_domain_model_and_update_and_generate_delete_customer_response",
|
| 257 |
+
"file": "crates/router/src/core/customers.rs",
|
| 258 |
+
"kind": "function_item",
|
| 259 |
+
"status": "added",
|
| 260 |
+
"before_code": null,
|
| 261 |
+
"after_code": "async fn fetch_domain_model_and_update_and_generate_delete_customer_response<'a>(\n &'a self,\n db: &'a dyn StorageInterface,\n key_store: &'a domain::MerchantKeyStore,\n merchant_account: &'a domain::MerchantAccount,\n key_manager_state: &'a KeyManagerState,\n state: &'a SessionState,\n ) -> errors::CustomerResponse<customers::CustomerDeleteResponse> {\n let customer_orig = db\n .find_customer_by_customer_id_merchant_id(\n key_manager_state,\n self,\n merchant_account.get_id(),\n key_store,\n merchant_account.storage_scheme,\n )\n .await\n .switch()?;\n\n let customer_mandates = db\n .find_mandate_by_merchant_id_customer_id(merchant_account.get_id(), self)\n .await\n .switch()?;\n\n for mandate in customer_mandates.into_iter() {\n if mandate.mandate_status == enums::MandateStatus::Active {\n Err(errors::CustomersErrorResponse::MandateActive)?\n }\n }\n\n match db\n .find_payment_method_by_customer_id_merchant_id_list(\n key_manager_state,\n key_store,\n self,\n merchant_account.get_id(),\n None,\n )\n .await\n {\n // check this in review\n Ok(customer_payment_methods) => {\n for pm in customer_payment_methods.into_iter() {\n if pm.get_payment_method_type() == Some(enums::PaymentMethod::Card) {\n cards::delete_card_from_locker(\n state,\n self,\n merchant_account.get_id(),\n pm.locker_id.as_ref().unwrap_or(&pm.payment_method_id),\n )\n .await\n .switch()?;\n\n if let Some(network_token_ref_id) = pm.network_token_requestor_reference_id\n {\n network_tokenization::delete_network_token_from_locker_and_token_service(\n state,\n self,\n merchant_account.get_id(),\n pm.payment_method_id.clone(),\n pm.network_token_locker_id,\n network_token_ref_id,\n )\n .await\n .switch()?;\n }\n }\n\n db.delete_payment_method_by_merchant_id_payment_method_id(\n key_manager_state,\n key_store,\n merchant_account.get_id(),\n &pm.payment_method_id,\n )\n .await\n .switch()?;\n }\n }\n Err(error) => {\n if error.current_context().is_db_not_found() {\n Ok(())\n } else {\n Err(error)\n .change_context(errors::CustomersErrorResponse::InternalServerError)\n .attach_printable(\n \"failed find_payment_method_by_customer_id_merchant_id_list\",\n )\n }?\n }\n };\n\n let key = key_store.key.get_inner().peek();\n let identifier = Identifier::Merchant(key_store.merchant_id.clone());\n let redacted_encrypted_value: Encryptable<Secret<_>> = types::crypto_operation(\n key_manager_state,\n type_name!(storage::Address),\n types::CryptoOperation::Encrypt(REDACTED.to_string().into()),\n identifier.clone(),\n key,\n )\n .await\n .and_then(|val| val.try_into_operation())\n .switch()?;\n\n let redacted_encrypted_email = Encryptable::new(\n redacted_encrypted_value\n .clone()\n .into_inner()\n .switch_strategy(),\n redacted_encrypted_value.clone().into_encrypted(),\n );\n\n let update_address = storage::AddressUpdate::Update {\n city: Some(REDACTED.to_string()),\n country: None,\n line1: Some(redacted_encrypted_value.clone()),\n line2: Some(redacted_encrypted_value.clone()),\n line3: Some(redacted_encrypted_value.clone()),\n state: Some(redacted_encrypted_value.clone()),\n zip: Some(redacted_encrypted_value.clone()),\n first_name: Some(redacted_encrypted_value.clone()),\n last_name: Some(redacted_encrypted_value.clone()),\n phone_number: Some(redacted_encrypted_value.clone()),\n country_code: Some(REDACTED.to_string()),\n updated_by: merchant_account.storage_scheme.to_string(),\n email: Some(redacted_encrypted_email),\n };\n\n match db\n .update_address_by_merchant_id_customer_id(\n key_manager_state,\n self,\n merchant_account.get_id(),\n update_address,\n key_store,\n )\n .await\n {\n Ok(_) => Ok(()),\n Err(error) => {\n if error.current_context().is_db_not_found() {\n Ok(())\n } else {\n Err(error)\n .change_context(errors::CustomersErrorResponse::InternalServerError)\n .attach_printable(\"failed update_address_by_merchant_id_customer_id\")\n }\n }\n }?;\n\n let updated_customer = storage::CustomerUpdate::Update {\n name: Some(redacted_encrypted_value.clone()),\n email: Some(\n types::crypto_operation(\n key_manager_state,\n type_name!(storage::Customer),\n types::CryptoOperation::Encrypt(REDACTED.to_string().into()),\n identifier,\n key,\n )\n .await\n .and_then(|val| val.try_into_operation())\n .switch()?,\n ),\n phone: Box::new(Some(redacted_encrypted_value.clone())),\n description: Some(Description::from_str_unchecked(REDACTED)),\n phone_country_code: Some(REDACTED.to_string()),\n metadata: None,\n connector_customer: Box::new(None),\n address_id: None,\n };\n\n db.update_customer_by_customer_id_merchant_id(\n key_manager_state,\n self.clone(),\n merchant_account.get_id().to_owned(),\n customer_orig,\n updated_customer,\n key_store,\n merchant_account.storage_scheme,\n )\n .await\n .switch()?;\n\n let response = customers::CustomerDeleteResponse {\n customer_id: self.clone(),\n customer_deleted: true,\n address_deleted: true,\n payment_methods_deleted: true,\n };\n metrics::CUSTOMER_REDACTED.add(1, &[]);\n Ok(services::ApplicationResponse::Json(response))\n }",
|
| 262 |
+
"diff_span": null,
|
| 263 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 264 |
+
},
|
| 265 |
+
{
|
| 266 |
+
"id": "crates/common_utils/src/id_type/customer.rs::CustomerId::function::get_api_event_type",
|
| 267 |
+
"file": "crates/common_utils/src/id_type/customer.rs",
|
| 268 |
+
"kind": "function_item",
|
| 269 |
+
"status": "added",
|
| 270 |
+
"before_code": null,
|
| 271 |
+
"after_code": "fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {\n Some(crate::events::ApiEventsType::Customer {\n customer_id: self.clone(),\n })\n }",
|
| 272 |
+
"diff_span": null,
|
| 273 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 274 |
+
},
|
| 275 |
+
{
|
| 276 |
+
"id": "crates/api_models/src/customers.rs::impl::CustomerId",
|
| 277 |
+
"file": "crates/api_models/src/customers.rs",
|
| 278 |
+
"kind": "impl_item",
|
| 279 |
+
"status": "removed",
|
| 280 |
+
"before_code": "impl CustomerId {\n pub fn get_merchant_reference_id(&self) -> id_type::CustomerId {\n self.merchant_reference_id.clone()\n }\n\n pub fn new_customer_id_struct(cust: id_type::CustomerId) -> Self {\n Self {\n merchant_reference_id: cust,\n }\n }\n}",
|
| 281 |
+
"after_code": null,
|
| 282 |
+
"diff_span": null,
|
| 283 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 284 |
+
},
|
| 285 |
+
{
|
| 286 |
+
"id": "crates/router/src/core/customers.rs::impl::customers::CustomerId",
|
| 287 |
+
"file": "crates/router/src/core/customers.rs",
|
| 288 |
+
"kind": "impl_item",
|
| 289 |
+
"status": "removed",
|
| 290 |
+
"before_code": "impl CustomerDeleteBridge for customers::CustomerId {\n async fn fetch_domain_model_and_update_and_generate_delete_customer_response<'a>(\n &'a self,\n db: &'a dyn StorageInterface,\n key_store: &'a domain::MerchantKeyStore,\n merchant_account: &'a domain::MerchantAccount,\n key_manager_state: &'a KeyManagerState,\n state: &'a SessionState,\n ) -> errors::CustomerResponse<customers::CustomerDeleteResponse> {\n let customer_orig = db\n .find_customer_by_customer_id_merchant_id(\n key_manager_state,\n &self.customer_id,\n merchant_account.get_id(),\n key_store,\n merchant_account.storage_scheme,\n )\n .await\n .switch()?;\n\n let customer_mandates = db\n .find_mandate_by_merchant_id_customer_id(merchant_account.get_id(), &self.customer_id)\n .await\n .switch()?;\n\n for mandate in customer_mandates.into_iter() {\n if mandate.mandate_status == enums::MandateStatus::Active {\n Err(errors::CustomersErrorResponse::MandateActive)?\n }\n }\n\n match db\n .find_payment_method_by_customer_id_merchant_id_list(\n key_manager_state,\n key_store,\n &self.customer_id,\n merchant_account.get_id(),\n None,\n )\n .await\n {\n // check this in review\n Ok(customer_payment_methods) => {\n for pm in customer_payment_methods.into_iter() {\n if pm.get_payment_method_type() == Some(enums::PaymentMethod::Card) {\n cards::delete_card_from_locker(\n state,\n &self.customer_id,\n merchant_account.get_id(),\n pm.locker_id.as_ref().unwrap_or(&pm.payment_method_id),\n )\n .await\n .switch()?;\n\n if let Some(network_token_ref_id) = pm.network_token_requestor_reference_id\n {\n network_tokenization::delete_network_token_from_locker_and_token_service(\n state,\n &self.customer_id,\n merchant_account.get_id(),\n pm.payment_method_id.clone(),\n pm.network_token_locker_id,\n network_token_ref_id,\n )\n .await\n .switch()?;\n }\n }\n\n db.delete_payment_method_by_merchant_id_payment_method_id(\n key_manager_state,\n key_store,\n merchant_account.get_id(),\n &pm.payment_method_id,\n )\n .await\n .switch()?;\n }\n }\n Err(error) => {\n if error.current_context().is_db_not_found() {\n Ok(())\n } else {\n Err(error)\n .change_context(errors::CustomersErrorResponse::InternalServerError)\n .attach_printable(\n \"failed find_payment_method_by_customer_id_merchant_id_list\",\n )\n }?\n }\n };\n\n let key = key_store.key.get_inner().peek();\n let identifier = Identifier::Merchant(key_store.merchant_id.clone());\n let redacted_encrypted_value: Encryptable<Secret<_>> = types::crypto_operation(\n key_manager_state,\n type_name!(storage::Address),\n types::CryptoOperation::Encrypt(REDACTED.to_string().into()),\n identifier.clone(),\n key,\n )\n .await\n .and_then(|val| val.try_into_operation())\n .switch()?;\n\n let redacted_encrypted_email = Encryptable::new(\n redacted_encrypted_value\n .clone()\n .into_inner()\n .switch_strategy(),\n redacted_encrypted_value.clone().into_encrypted(),\n );\n\n let update_address = storage::AddressUpdate::Update {\n city: Some(REDACTED.to_string()),\n country: None,\n line1: Some(redacted_encrypted_value.clone()),\n line2: Some(redacted_encrypted_value.clone()),\n line3: Some(redacted_encrypted_value.clone()),\n state: Some(redacted_encrypted_value.clone()),\n zip: Some(redacted_encrypted_value.clone()),\n first_name: Some(redacted_encrypted_value.clone()),\n last_name: Some(redacted_encrypted_value.clone()),\n phone_number: Some(redacted_encrypted_value.clone()),\n country_code: Some(REDACTED.to_string()),\n updated_by: merchant_account.storage_scheme.to_string(),\n email: Some(redacted_encrypted_email),\n };\n\n match db\n .update_address_by_merchant_id_customer_id(\n key_manager_state,\n &self.customer_id,\n merchant_account.get_id(),\n update_address,\n key_store,\n )\n .await\n {\n Ok(_) => Ok(()),\n Err(error) => {\n if error.current_context().is_db_not_found() {\n Ok(())\n } else {\n Err(error)\n .change_context(errors::CustomersErrorResponse::InternalServerError)\n .attach_printable(\"failed update_address_by_merchant_id_customer_id\")\n }\n }\n }?;\n\n let updated_customer = storage::CustomerUpdate::Update {\n name: Some(redacted_encrypted_value.clone()),\n email: Some(\n types::crypto_operation(\n key_manager_state,\n type_name!(storage::Customer),\n types::CryptoOperation::Encrypt(REDACTED.to_string().into()),\n identifier,\n key,\n )\n .await\n .and_then(|val| val.try_into_operation())\n .switch()?,\n ),\n phone: Box::new(Some(redacted_encrypted_value.clone())),\n description: Some(Description::from_str_unchecked(REDACTED)),\n phone_country_code: Some(REDACTED.to_string()),\n metadata: None,\n connector_customer: Box::new(None),\n address_id: None,\n };\n\n db.update_customer_by_customer_id_merchant_id(\n key_manager_state,\n self.customer_id.clone(),\n merchant_account.get_id().to_owned(),\n customer_orig,\n updated_customer,\n key_store,\n merchant_account.storage_scheme,\n )\n .await\n .switch()?;\n\n let response = customers::CustomerDeleteResponse {\n customer_id: self.customer_id.clone(),\n customer_deleted: true,\n address_deleted: true,\n payment_methods_deleted: true,\n };\n metrics::CUSTOMER_REDACTED.add(1, &[]);\n Ok(services::ApplicationResponse::Json(response))\n }\n}",
|
| 291 |
+
"after_code": null,
|
| 292 |
+
"diff_span": null,
|
| 293 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 294 |
+
},
|
| 295 |
+
{
|
| 296 |
+
"id": "crates/api_models/src/events/customer.rs::impl::CustomerId",
|
| 297 |
+
"file": "crates/api_models/src/events/customer.rs",
|
| 298 |
+
"kind": "impl_item",
|
| 299 |
+
"status": "removed",
|
| 300 |
+
"before_code": "impl ApiEventMetric for CustomerId {\n fn get_api_event_type(&self) -> Option<ApiEventsType> {\n Some(ApiEventsType::Customer {\n customer_id: self.get_merchant_reference_id().clone(),\n })\n }\n}",
|
| 301 |
+
"after_code": null,
|
| 302 |
+
"diff_span": null,
|
| 303 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 304 |
+
},
|
| 305 |
+
{
|
| 306 |
+
"id": "crates/api_models/src/events/customer.rs::CustomerId::function::get_api_event_type",
|
| 307 |
+
"file": "crates/api_models/src/events/customer.rs",
|
| 308 |
+
"kind": "function_item",
|
| 309 |
+
"status": "removed",
|
| 310 |
+
"before_code": "fn get_api_event_type(&self) -> Option<ApiEventsType> {\n Some(ApiEventsType::Customer {\n customer_id: self.get_merchant_reference_id().clone(),\n })\n }",
|
| 311 |
+
"after_code": null,
|
| 312 |
+
"diff_span": null,
|
| 313 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 314 |
+
},
|
| 315 |
+
{
|
| 316 |
+
"id": "crates/api_models/src/customers.rs::CustomerId::function::new_customer_id_struct",
|
| 317 |
+
"file": "crates/api_models/src/customers.rs",
|
| 318 |
+
"kind": "function_item",
|
| 319 |
+
"status": "removed",
|
| 320 |
+
"before_code": "pub fn new_customer_id_struct(cust: id_type::CustomerId) -> Self {\n Self {\n merchant_reference_id: cust,\n }\n }",
|
| 321 |
+
"after_code": null,
|
| 322 |
+
"diff_span": null,
|
| 323 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 324 |
+
},
|
| 325 |
+
{
|
| 326 |
+
"id": "crates/router/src/core/customers.rs::customers::CustomerId::function::fetch_domain_model_and_update_and_generate_delete_customer_response",
|
| 327 |
+
"file": "crates/router/src/core/customers.rs",
|
| 328 |
+
"kind": "function_item",
|
| 329 |
+
"status": "removed",
|
| 330 |
+
"before_code": "async fn fetch_domain_model_and_update_and_generate_delete_customer_response<'a>(\n &'a self,\n db: &'a dyn StorageInterface,\n key_store: &'a domain::MerchantKeyStore,\n merchant_account: &'a domain::MerchantAccount,\n key_manager_state: &'a KeyManagerState,\n state: &'a SessionState,\n ) -> errors::CustomerResponse<customers::CustomerDeleteResponse> {\n let customer_orig = db\n .find_customer_by_customer_id_merchant_id(\n key_manager_state,\n &self.customer_id,\n merchant_account.get_id(),\n key_store,\n merchant_account.storage_scheme,\n )\n .await\n .switch()?;\n\n let customer_mandates = db\n .find_mandate_by_merchant_id_customer_id(merchant_account.get_id(), &self.customer_id)\n .await\n .switch()?;\n\n for mandate in customer_mandates.into_iter() {\n if mandate.mandate_status == enums::MandateStatus::Active {\n Err(errors::CustomersErrorResponse::MandateActive)?\n }\n }\n\n match db\n .find_payment_method_by_customer_id_merchant_id_list(\n key_manager_state,\n key_store,\n &self.customer_id,\n merchant_account.get_id(),\n None,\n )\n .await\n {\n // check this in review\n Ok(customer_payment_methods) => {\n for pm in customer_payment_methods.into_iter() {\n if pm.get_payment_method_type() == Some(enums::PaymentMethod::Card) {\n cards::delete_card_from_locker(\n state,\n &self.customer_id,\n merchant_account.get_id(),\n pm.locker_id.as_ref().unwrap_or(&pm.payment_method_id),\n )\n .await\n .switch()?;\n\n if let Some(network_token_ref_id) = pm.network_token_requestor_reference_id\n {\n network_tokenization::delete_network_token_from_locker_and_token_service(\n state,\n &self.customer_id,\n merchant_account.get_id(),\n pm.payment_method_id.clone(),\n pm.network_token_locker_id,\n network_token_ref_id,\n )\n .await\n .switch()?;\n }\n }\n\n db.delete_payment_method_by_merchant_id_payment_method_id(\n key_manager_state,\n key_store,\n merchant_account.get_id(),\n &pm.payment_method_id,\n )\n .await\n .switch()?;\n }\n }\n Err(error) => {\n if error.current_context().is_db_not_found() {\n Ok(())\n } else {\n Err(error)\n .change_context(errors::CustomersErrorResponse::InternalServerError)\n .attach_printable(\n \"failed find_payment_method_by_customer_id_merchant_id_list\",\n )\n }?\n }\n };\n\n let key = key_store.key.get_inner().peek();\n let identifier = Identifier::Merchant(key_store.merchant_id.clone());\n let redacted_encrypted_value: Encryptable<Secret<_>> = types::crypto_operation(\n key_manager_state,\n type_name!(storage::Address),\n types::CryptoOperation::Encrypt(REDACTED.to_string().into()),\n identifier.clone(),\n key,\n )\n .await\n .and_then(|val| val.try_into_operation())\n .switch()?;\n\n let redacted_encrypted_email = Encryptable::new(\n redacted_encrypted_value\n .clone()\n .into_inner()\n .switch_strategy(),\n redacted_encrypted_value.clone().into_encrypted(),\n );\n\n let update_address = storage::AddressUpdate::Update {\n city: Some(REDACTED.to_string()),\n country: None,\n line1: Some(redacted_encrypted_value.clone()),\n line2: Some(redacted_encrypted_value.clone()),\n line3: Some(redacted_encrypted_value.clone()),\n state: Some(redacted_encrypted_value.clone()),\n zip: Some(redacted_encrypted_value.clone()),\n first_name: Some(redacted_encrypted_value.clone()),\n last_name: Some(redacted_encrypted_value.clone()),\n phone_number: Some(redacted_encrypted_value.clone()),\n country_code: Some(REDACTED.to_string()),\n updated_by: merchant_account.storage_scheme.to_string(),\n email: Some(redacted_encrypted_email),\n };\n\n match db\n .update_address_by_merchant_id_customer_id(\n key_manager_state,\n &self.customer_id,\n merchant_account.get_id(),\n update_address,\n key_store,\n )\n .await\n {\n Ok(_) => Ok(()),\n Err(error) => {\n if error.current_context().is_db_not_found() {\n Ok(())\n } else {\n Err(error)\n .change_context(errors::CustomersErrorResponse::InternalServerError)\n .attach_printable(\"failed update_address_by_merchant_id_customer_id\")\n }\n }\n }?;\n\n let updated_customer = storage::CustomerUpdate::Update {\n name: Some(redacted_encrypted_value.clone()),\n email: Some(\n types::crypto_operation(\n key_manager_state,\n type_name!(storage::Customer),\n types::CryptoOperation::Encrypt(REDACTED.to_string().into()),\n identifier,\n key,\n )\n .await\n .and_then(|val| val.try_into_operation())\n .switch()?,\n ),\n phone: Box::new(Some(redacted_encrypted_value.clone())),\n description: Some(Description::from_str_unchecked(REDACTED)),\n phone_country_code: Some(REDACTED.to_string()),\n metadata: None,\n connector_customer: Box::new(None),\n address_id: None,\n };\n\n db.update_customer_by_customer_id_merchant_id(\n key_manager_state,\n self.customer_id.clone(),\n merchant_account.get_id().to_owned(),\n customer_orig,\n updated_customer,\n key_store,\n merchant_account.storage_scheme,\n )\n .await\n .switch()?;\n\n let response = customers::CustomerDeleteResponse {\n customer_id: self.customer_id.clone(),\n customer_deleted: true,\n address_deleted: true,\n payment_methods_deleted: true,\n };\n metrics::CUSTOMER_REDACTED.add(1, &[]);\n Ok(services::ApplicationResponse::Json(response))\n }",
|
| 331 |
+
"after_code": null,
|
| 332 |
+
"diff_span": null,
|
| 333 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 334 |
+
},
|
| 335 |
+
{
|
| 336 |
+
"id": "crates/api_models/src/customers.rs::CustomerId::function::get_merchant_reference_id",
|
| 337 |
+
"file": "crates/api_models/src/customers.rs",
|
| 338 |
+
"kind": "function_item",
|
| 339 |
+
"status": "removed",
|
| 340 |
+
"before_code": "pub fn get_merchant_reference_id(&self) -> id_type::CustomerId {\n self.merchant_reference_id.clone()\n }",
|
| 341 |
+
"after_code": null,
|
| 342 |
+
"diff_span": null,
|
| 343 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 344 |
+
},
|
| 345 |
+
{
|
| 346 |
+
"id": "crates/api_models/src/customers.rs::struct::CustomerId",
|
| 347 |
+
"file": "crates/api_models/src/customers.rs",
|
| 348 |
+
"kind": "struct_item",
|
| 349 |
+
"status": "removed",
|
| 350 |
+
"before_code": "pub struct CustomerId {\n pub merchant_reference_id: id_type::CustomerId,\n}",
|
| 351 |
+
"after_code": null,
|
| 352 |
+
"diff_span": null,
|
| 353 |
+
"commit_sha": "61d72906a8114a720b985f1dc50b2b087d22554a"
|
| 354 |
+
}
|
| 355 |
+
]
|
| 356 |
+
}
|
diffs/pr_6836/b3a0297/diff.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "b3a029767505b8dff53e38844bb5c1c559570f43",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/api_models/src/payment_methods.rs",
|
| 6 |
+
"crates/api_models/src/payments.rs"
|
| 7 |
+
],
|
| 8 |
+
"diffs": [
|
| 9 |
+
{
|
| 10 |
+
"id": "crates/api_models/src/payments.rs::struct::PaymentsIntentResponse",
|
| 11 |
+
"file": "crates/api_models/src/payments.rs",
|
| 12 |
+
"kind": "struct_item",
|
| 13 |
+
"status": "modified",
|
| 14 |
+
"code_changed": true,
|
| 15 |
+
"imports_changed": false,
|
| 16 |
+
"before_code": "pub struct PaymentsIntentResponse {\n /// Global Payment Id for the payment\n #[schema(value_type = String)]\n pub id: id_type::GlobalPaymentId,\n\n /// The status of the payment\n #[schema(value_type = IntentStatus, example = \"succeeded\")]\n pub status: common_enums::IntentStatus,\n\n /// The amount details for the payment\n pub amount_details: AmountDetailsResponse,\n\n /// It's a token used for client side verification.\n #[schema(value_type = String, example = \"pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo\")]\n pub client_secret: common_utils::types::ClientSecret,\n\n /// The identifier for the profile. This is inferred from the `x-profile-id` header\n #[schema(value_type = String)]\n pub profile_id: id_type::ProfileId,\n\n /// Unique identifier for the payment. This ensures idempotency for multiple payments\n /// that have been done by a single merchant.\n #[schema(\n value_type = Option<String>,\n min_length = 30,\n max_length = 30,\n example = \"pay_mbabizu24mvu3mela5njyhpit4\"\n )]\n pub merchant_reference_id: Option<id_type::PaymentReferenceId>,\n\n /// The routing algorithm id to be used for the payment\n #[schema(value_type = Option<String>)]\n pub routing_algorithm_id: Option<id_type::RoutingId>,\n\n #[schema(value_type = CaptureMethod, example = \"automatic\")]\n pub capture_method: api_enums::CaptureMethod,\n\n #[schema(value_type = AuthenticationType, example = \"no_three_ds\", default = \"no_three_ds\")]\n pub authentication_type: api_enums::AuthenticationType,\n\n /// The billing details of the payment. This address will be used for invoicing.\n #[schema(value_type = Option<Address>)]\n pub billing: Option<Address>,\n\n /// The shipping address for the payment\n #[schema(value_type = Option<Address>)]\n pub shipping: Option<Address>,\n\n /// The identifier for the customer\n #[schema(value_type = Option<String>, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: Option<id_type::GlobalCustomerId>,\n\n /// Set to `present` to indicate that the customer is in your checkout flow during this payment, and therefore is able to authenticate. This parameter should be `absent` when merchant's doing merchant initiated payments and customer is not present while doing the payment.\n #[schema(example = \"present\", value_type = PresenceOfCustomerDuringPayment)]\n pub customer_present: common_enums::PresenceOfCustomerDuringPayment,\n\n /// A description for the payment\n #[schema(example = \"It's my first payment request\", value_type = Option<String>)]\n pub description: Option<common_utils::types::Description>,\n\n /// The URL to which you want the user to be redirected after the completion of the payment operation\n #[schema(value_type = Option<String>, example = \"https://hyperswitch.io\")]\n pub return_url: Option<common_utils::types::Url>,\n\n #[schema(value_type = FutureUsage, example = \"off_session\")]\n pub setup_future_usage: api_enums::FutureUsage,\n\n /// Apply MIT exemption for a payment\n #[schema(value_type = MitExemptionRequest)]\n pub apply_mit_exemption: common_enums::MitExemptionRequest,\n\n /// For non-card charges, you can use this value as the complete description that appears on your customers\u2019 statements. Must contain at least one letter, maximum 22 characters.\n #[schema(max_length = 22, example = \"Hyperswitch Router\", value_type = Option<String>)]\n pub statement_descriptor: Option<common_utils::types::StatementDescriptor>,\n\n /// Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount\n #[schema(value_type = Option<Vec<OrderDetailsWithAmount>>, example = r#\"[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]\"#)]\n pub order_details: Option<Vec<OrderDetailsWithAmount>>,\n\n /// Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent\n #[schema(value_type = Option<Vec<PaymentMethodType>>)]\n pub allowed_payment_method_types: Option<Vec<api_enums::PaymentMethodType>>,\n\n /// Metadata is useful for storing additional, unstructured information on an object.\n #[schema(value_type = Option<Object>, example = r#\"{ \"udf1\": \"some-value\", \"udf2\": \"some-value\" }\"#)]\n pub metadata: Option<pii::SecretSerdeValue>,\n\n /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.\n #[schema(value_type = Option<ConnectorMetadata>)]\n pub connector_metadata: Option<pii::SecretSerdeValue>,\n\n /// Additional data that might be required by hyperswitch based on the requested features by the merchants.\n #[schema(value_type = Option<FeatureMetadata>)]\n pub feature_metadata: Option<FeatureMetadata>,\n\n /// Whether to generate the payment link for this payment or not (if applicable)\n #[schema(value_type = EnablePaymentLinkRequest)]\n pub payment_link_enabled: common_enums::EnablePaymentLinkRequest,\n\n /// Configure a custom payment link for the particular payment\n #[schema(value_type = Option<PaymentLinkConfigRequest>)]\n pub payment_link_config: Option<admin::PaymentLinkConfigRequest>,\n\n ///Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.\n #[schema(value_type = RequestIncrementalAuthorization)]\n pub request_incremental_authorization: common_enums::RequestIncrementalAuthorization,\n\n ///Will be used to expire client secret after certain amount of time to be supplied in seconds\n #[serde(with = \"common_utils::custom_serde::iso8601\")]\n pub expires_on: PrimitiveDateTime,\n\n /// Additional data related to some frm(Fraud Risk Management) connectors\n #[schema(value_type = Option<Object>, example = r#\"{ \"coverage_request\" : \"fraud\", \"fulfillment_method\" : \"delivery\" }\"#)]\n pub frm_metadata: Option<pii::SecretSerdeValue>,\n\n /// Whether to perform external authentication (if applicable)\n #[schema(value_type = External3dsAuthenticationRequest)]\n pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest,\n}",
|
| 17 |
+
"after_code": "pub struct PaymentsIntentResponse {\n /// Global Payment Id for the payment\n #[schema(value_type = String)]\n pub id: id_type::GlobalPaymentId,\n\n /// The status of the payment\n #[schema(value_type = IntentStatus, example = \"succeeded\")]\n pub status: common_enums::IntentStatus,\n\n /// The amount details for the payment\n pub amount_details: AmountDetailsResponse,\n\n /// It's a token used for client side verification.\n #[schema(value_type = String, example = \"pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo\")]\n pub client_secret: common_utils::types::ClientSecret,\n\n /// The identifier for the profile. This is inferred from the `x-profile-id` header\n #[schema(value_type = String)]\n pub profile_id: id_type::ProfileId,\n\n /// Unique identifier for the payment. This ensures idempotency for multiple payments\n /// that have been done by a single merchant.\n #[schema(\n value_type = Option<String>,\n min_length = 30,\n max_length = 30,\n example = \"pay_mbabizu24mvu3mela5njyhpit4\"\n )]\n pub merchant_reference_id: Option<id_type::PaymentReferenceId>,\n\n /// The routing algorithm id to be used for the payment\n #[schema(value_type = Option<String>)]\n pub routing_algorithm_id: Option<id_type::RoutingId>,\n\n #[schema(value_type = CaptureMethod, example = \"automatic\")]\n pub capture_method: api_enums::CaptureMethod,\n\n #[schema(value_type = AuthenticationType, example = \"no_three_ds\", default = \"no_three_ds\")]\n pub authentication_type: api_enums::AuthenticationType,\n\n /// The billing details of the payment. This address will be used for invoicing.\n #[schema(value_type = Option<Address>)]\n pub billing: Option<Address>,\n\n /// The shipping address for the payment\n #[schema(value_type = Option<Address>)]\n pub shipping: Option<Address>,\n\n /// The identifier for the customer\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: Option<id_type::GlobalCustomerId>,\n\n /// Set to `present` to indicate that the customer is in your checkout flow during this payment, and therefore is able to authenticate. This parameter should be `absent` when merchant's doing merchant initiated payments and customer is not present while doing the payment.\n #[schema(example = \"present\", value_type = PresenceOfCustomerDuringPayment)]\n pub customer_present: common_enums::PresenceOfCustomerDuringPayment,\n\n /// A description for the payment\n #[schema(example = \"It's my first payment request\", value_type = Option<String>)]\n pub description: Option<common_utils::types::Description>,\n\n /// The URL to which you want the user to be redirected after the completion of the payment operation\n #[schema(value_type = Option<String>, example = \"https://hyperswitch.io\")]\n pub return_url: Option<common_utils::types::Url>,\n\n #[schema(value_type = FutureUsage, example = \"off_session\")]\n pub setup_future_usage: api_enums::FutureUsage,\n\n /// Apply MIT exemption for a payment\n #[schema(value_type = MitExemptionRequest)]\n pub apply_mit_exemption: common_enums::MitExemptionRequest,\n\n /// For non-card charges, you can use this value as the complete description that appears on your customers\u2019 statements. Must contain at least one letter, maximum 22 characters.\n #[schema(max_length = 22, example = \"Hyperswitch Router\", value_type = Option<String>)]\n pub statement_descriptor: Option<common_utils::types::StatementDescriptor>,\n\n /// Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount\n #[schema(value_type = Option<Vec<OrderDetailsWithAmount>>, example = r#\"[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]\"#)]\n pub order_details: Option<Vec<OrderDetailsWithAmount>>,\n\n /// Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent\n #[schema(value_type = Option<Vec<PaymentMethodType>>)]\n pub allowed_payment_method_types: Option<Vec<api_enums::PaymentMethodType>>,\n\n /// Metadata is useful for storing additional, unstructured information on an object.\n #[schema(value_type = Option<Object>, example = r#\"{ \"udf1\": \"some-value\", \"udf2\": \"some-value\" }\"#)]\n pub metadata: Option<pii::SecretSerdeValue>,\n\n /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.\n #[schema(value_type = Option<ConnectorMetadata>)]\n pub connector_metadata: Option<pii::SecretSerdeValue>,\n\n /// Additional data that might be required by hyperswitch based on the requested features by the merchants.\n #[schema(value_type = Option<FeatureMetadata>)]\n pub feature_metadata: Option<FeatureMetadata>,\n\n /// Whether to generate the payment link for this payment or not (if applicable)\n #[schema(value_type = EnablePaymentLinkRequest)]\n pub payment_link_enabled: common_enums::EnablePaymentLinkRequest,\n\n /// Configure a custom payment link for the particular payment\n #[schema(value_type = Option<PaymentLinkConfigRequest>)]\n pub payment_link_config: Option<admin::PaymentLinkConfigRequest>,\n\n ///Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.\n #[schema(value_type = RequestIncrementalAuthorization)]\n pub request_incremental_authorization: common_enums::RequestIncrementalAuthorization,\n\n ///Will be used to expire client secret after certain amount of time to be supplied in seconds\n #[serde(with = \"common_utils::custom_serde::iso8601\")]\n pub expires_on: PrimitiveDateTime,\n\n /// Additional data related to some frm(Fraud Risk Management) connectors\n #[schema(value_type = Option<Object>, example = r#\"{ \"coverage_request\" : \"fraud\", \"fulfillment_method\" : \"delivery\" }\"#)]\n pub frm_metadata: Option<pii::SecretSerdeValue>,\n\n /// Whether to perform external authentication (if applicable)\n #[schema(value_type = External3dsAuthenticationRequest)]\n pub request_external_three_ds_authentication: common_enums::External3dsAuthenticationRequest,\n}",
|
| 18 |
+
"diff_span": {
|
| 19 |
+
"before": "\n /// The identifier for the customer\n #[schema(value_type = Option<String>, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: Option<id_type::GlobalCustomerId>,\n",
|
| 20 |
+
"after": "\n /// The identifier for the customer\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: Option<id_type::GlobalCustomerId>,\n"
|
| 21 |
+
},
|
| 22 |
+
"commit_sha": "b3a029767505b8dff53e38844bb5c1c559570f43"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"id": "crates/api_models/src/payment_methods.rs::struct::PaymentMethodCreate",
|
| 26 |
+
"file": "crates/api_models/src/payment_methods.rs",
|
| 27 |
+
"kind": "struct_item",
|
| 28 |
+
"status": "modified",
|
| 29 |
+
"code_changed": true,
|
| 30 |
+
"imports_changed": false,
|
| 31 |
+
"before_code": "pub struct PaymentMethodCreate {\n /// The type of payment method use for the payment.\n #[schema(value_type = PaymentMethod,example = \"card\")]\n pub payment_method_type: api_enums::PaymentMethod,\n\n /// This is a sub-category of payment method.\n #[schema(value_type = PaymentMethodType,example = \"credit\")]\n pub payment_method_subtype: api_enums::PaymentMethodType,\n\n /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\n #[schema(value_type = Option<Object>,example = json!({ \"city\": \"NY\", \"unit\": \"245\" }))]\n pub metadata: Option<pii::SecretSerdeValue>,\n\n /// The unique identifier of the customer.\n #[schema(value_type = String, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: id_type::GlobalCustomerId,\n\n /// Payment method data to be passed\n pub payment_method_data: PaymentMethodCreateData,\n\n /// The billing details of the payment method\n #[schema(value_type = Option<Address>)]\n pub billing: Option<payments::Address>,\n}",
|
| 32 |
+
"after_code": "pub struct PaymentMethodCreate {\n /// The type of payment method use for the payment.\n #[schema(value_type = PaymentMethod,example = \"card\")]\n pub payment_method_type: api_enums::PaymentMethod,\n\n /// This is a sub-category of payment method.\n #[schema(value_type = PaymentMethodType,example = \"credit\")]\n pub payment_method_subtype: api_enums::PaymentMethodType,\n\n /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\n #[schema(value_type = Option<Object>,example = json!({ \"city\": \"NY\", \"unit\": \"245\" }))]\n pub metadata: Option<pii::SecretSerdeValue>,\n\n /// The unique identifier of the customer.\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: id_type::GlobalCustomerId,\n\n /// Payment method data to be passed\n pub payment_method_data: PaymentMethodCreateData,\n\n /// The billing details of the payment method\n #[schema(value_type = Option<Address>)]\n pub billing: Option<payments::Address>,\n}",
|
| 33 |
+
"diff_span": {
|
| 34 |
+
"before": "\n /// The unique identifier of the customer.\n #[schema(value_type = String, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: id_type::GlobalCustomerId,\n",
|
| 35 |
+
"after": "\n /// The unique identifier of the customer.\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: id_type::GlobalCustomerId,\n"
|
| 36 |
+
},
|
| 37 |
+
"commit_sha": "b3a029767505b8dff53e38844bb5c1c559570f43"
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"id": "crates/api_models/src/payment_methods.rs::struct::PaymentMethodIntentCreate",
|
| 41 |
+
"file": "crates/api_models/src/payment_methods.rs",
|
| 42 |
+
"kind": "struct_item",
|
| 43 |
+
"status": "modified",
|
| 44 |
+
"code_changed": true,
|
| 45 |
+
"imports_changed": false,
|
| 46 |
+
"before_code": "pub struct PaymentMethodIntentCreate {\n /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\n #[schema(value_type = Option<Object>,example = json!({ \"city\": \"NY\", \"unit\": \"245\" }))]\n pub metadata: Option<pii::SecretSerdeValue>,\n\n /// The billing details of the payment method\n #[schema(value_type = Option<Address>)]\n pub billing: Option<payments::Address>,\n\n /// The unique identifier of the customer.\n #[schema(value_type = String, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: id_type::GlobalCustomerId,\n}",
|
| 47 |
+
"after_code": "pub struct PaymentMethodIntentCreate {\n /// You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.\n #[schema(value_type = Option<Object>,example = json!({ \"city\": \"NY\", \"unit\": \"245\" }))]\n pub metadata: Option<pii::SecretSerdeValue>,\n\n /// The billing details of the payment method\n #[schema(value_type = Option<Address>)]\n pub billing: Option<payments::Address>,\n\n /// The unique identifier of the customer.\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: id_type::GlobalCustomerId,\n}",
|
| 48 |
+
"diff_span": {
|
| 49 |
+
"before": "\n /// The unique identifier of the customer.\n #[schema(value_type = String, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: id_type::GlobalCustomerId,\n}",
|
| 50 |
+
"after": "\n /// The unique identifier of the customer.\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: id_type::GlobalCustomerId,\n}"
|
| 51 |
+
},
|
| 52 |
+
"commit_sha": "b3a029767505b8dff53e38844bb5c1c559570f43"
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"id": "crates/api_models/src/payment_methods.rs::struct::PaymentMethodResponse",
|
| 56 |
+
"file": "crates/api_models/src/payment_methods.rs",
|
| 57 |
+
"kind": "struct_item",
|
| 58 |
+
"status": "modified",
|
| 59 |
+
"code_changed": true,
|
| 60 |
+
"imports_changed": false,
|
| 61 |
+
"before_code": "pub struct PaymentMethodResponse {\n /// Unique identifier for a merchant\n #[schema(value_type = String, example = \"merchant_1671528864\")]\n pub merchant_id: id_type::MerchantId,\n\n /// The unique identifier of the customer.\n #[schema(value_type = Option<String>, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: id_type::GlobalCustomerId,\n\n /// The unique identifier of the Payment method\n #[schema(example = \"card_rGK4Vi5iSW70MY7J2mIg\")]\n pub payment_method_id: String,\n\n /// The type of payment method use for the payment.\n #[schema(value_type = PaymentMethod, example = \"card\")]\n pub payment_method_type: Option<api_enums::PaymentMethod>,\n\n /// This is a sub-category of payment method.\n #[schema(value_type = Option<PaymentMethodType>, example = \"credit\")]\n pub payment_method_subtype: Option<api_enums::PaymentMethodType>,\n\n /// Indicates whether the payment method is eligible for recurring payments\n #[schema(example = true)]\n pub recurring_enabled: bool,\n\n /// A timestamp (ISO 8601 code) that determines when the payment method was created\n #[schema(value_type = Option<PrimitiveDateTime>, example = \"2023-01-18T11:04:09.922Z\")]\n #[serde(default, with = \"common_utils::custom_serde::iso8601::option\")]\n pub created: Option<time::PrimitiveDateTime>,\n\n #[schema(value_type = Option<PrimitiveDateTime>, example = \"2024-02-24T11:04:09.922Z\")]\n #[serde(default, with = \"common_utils::custom_serde::iso8601::option\")]\n pub last_used_at: Option<time::PrimitiveDateTime>,\n\n /// For Client based calls\n pub client_secret: Option<String>,\n\n pub payment_method_data: Option<PaymentMethodResponseData>,\n}",
|
| 62 |
+
"after_code": "pub struct PaymentMethodResponse {\n /// Unique identifier for a merchant\n #[schema(value_type = String, example = \"merchant_1671528864\")]\n pub merchant_id: id_type::MerchantId,\n\n /// The unique identifier of the customer.\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: id_type::GlobalCustomerId,\n\n /// The unique identifier of the Payment method\n #[schema(example = \"card_rGK4Vi5iSW70MY7J2mIg\")]\n pub payment_method_id: String,\n\n /// The type of payment method use for the payment.\n #[schema(value_type = PaymentMethod, example = \"card\")]\n pub payment_method_type: Option<api_enums::PaymentMethod>,\n\n /// This is a sub-category of payment method.\n #[schema(value_type = Option<PaymentMethodType>, example = \"credit\")]\n pub payment_method_subtype: Option<api_enums::PaymentMethodType>,\n\n /// Indicates whether the payment method is eligible for recurring payments\n #[schema(example = true)]\n pub recurring_enabled: bool,\n\n /// A timestamp (ISO 8601 code) that determines when the payment method was created\n #[schema(value_type = Option<PrimitiveDateTime>, example = \"2023-01-18T11:04:09.922Z\")]\n #[serde(default, with = \"common_utils::custom_serde::iso8601::option\")]\n pub created: Option<time::PrimitiveDateTime>,\n\n #[schema(value_type = Option<PrimitiveDateTime>, example = \"2024-02-24T11:04:09.922Z\")]\n #[serde(default, with = \"common_utils::custom_serde::iso8601::option\")]\n pub last_used_at: Option<time::PrimitiveDateTime>,\n\n /// For Client based calls\n pub client_secret: Option<String>,\n\n pub payment_method_data: Option<PaymentMethodResponseData>,\n}",
|
| 63 |
+
"diff_span": {
|
| 64 |
+
"before": "\n /// The unique identifier of the customer.\n #[schema(value_type = Option<String>, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: id_type::GlobalCustomerId,\n",
|
| 65 |
+
"after": "\n /// The unique identifier of the customer.\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: id_type::GlobalCustomerId,\n"
|
| 66 |
+
},
|
| 67 |
+
"commit_sha": "b3a029767505b8dff53e38844bb5c1c559570f43"
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"id": "crates/api_models/src/payments.rs::struct::PaymentsCreateIntentRequest",
|
| 71 |
+
"file": "crates/api_models/src/payments.rs",
|
| 72 |
+
"kind": "struct_item",
|
| 73 |
+
"status": "modified",
|
| 74 |
+
"code_changed": true,
|
| 75 |
+
"imports_changed": false,
|
| 76 |
+
"before_code": "pub struct PaymentsCreateIntentRequest {\n /// The amount details for the payment\n pub amount_details: AmountDetails,\n\n /// Unique identifier for the payment. This ensures idempotency for multiple payments\n /// that have been done by a single merchant.\n #[schema(\n value_type = Option<String>,\n min_length = 30,\n max_length = 30,\n example = \"pay_mbabizu24mvu3mela5njyhpit4\"\n )]\n pub merchant_reference_id: Option<id_type::PaymentReferenceId>,\n\n /// The routing algorithm id to be used for the payment\n #[schema(value_type = Option<String>)]\n pub routing_algorithm_id: Option<id_type::RoutingId>,\n\n #[schema(value_type = Option<CaptureMethod>, example = \"automatic\")]\n pub capture_method: Option<api_enums::CaptureMethod>,\n\n #[schema(value_type = Option<AuthenticationType>, example = \"no_three_ds\", default = \"no_three_ds\")]\n pub authentication_type: Option<api_enums::AuthenticationType>,\n\n /// The billing details of the payment. This address will be used for invoicing.\n pub billing: Option<Address>,\n\n /// The shipping address for the payment\n pub shipping: Option<Address>,\n\n /// The identifier for the customer\n #[schema(value_type = Option<String>, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: Option<id_type::GlobalCustomerId>,\n\n /// Set to `present` to indicate that the customer is in your checkout flow during this payment, and therefore is able to authenticate. This parameter should be `absent` when merchant's doing merchant initiated payments and customer is not present while doing the payment.\n #[schema(example = \"present\", value_type = Option<PresenceOfCustomerDuringPayment>)]\n pub customer_present: Option<common_enums::PresenceOfCustomerDuringPayment>,\n\n /// A description for the payment\n #[schema(example = \"It's my first payment request\", value_type = Option<String>)]\n pub description: Option<common_utils::types::Description>,\n\n /// The URL to which you want the user to be redirected after the completion of the payment operation\n #[schema(value_type = Option<String>, example = \"https://hyperswitch.io\")]\n pub return_url: Option<common_utils::types::Url>,\n\n #[schema(value_type = Option<FutureUsage>, example = \"off_session\")]\n pub setup_future_usage: Option<api_enums::FutureUsage>,\n\n /// Apply MIT exemption for a payment\n #[schema(value_type = Option<MitExemptionRequest>)]\n pub apply_mit_exemption: Option<common_enums::MitExemptionRequest>,\n\n /// For non-card charges, you can use this value as the complete description that appears on your customers\u2019 statements. Must contain at least one letter, maximum 22 characters.\n #[schema(max_length = 22, example = \"Hyperswitch Router\", value_type = Option<String>)]\n pub statement_descriptor: Option<common_utils::types::StatementDescriptor>,\n\n /// Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount\n #[schema(value_type = Option<Vec<OrderDetailsWithAmount>>, example = r#\"[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]\"#)]\n pub order_details: Option<Vec<OrderDetailsWithAmount>>,\n\n /// Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent\n #[schema(value_type = Option<Vec<PaymentMethodType>>)]\n pub allowed_payment_method_types: Option<Vec<api_enums::PaymentMethodType>>,\n\n /// Metadata is useful for storing additional, unstructured information on an object.\n #[schema(value_type = Option<Object>, example = r#\"{ \"udf1\": \"some-value\", \"udf2\": \"some-value\" }\"#)]\n pub metadata: Option<pii::SecretSerdeValue>,\n\n /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.\n pub connector_metadata: Option<ConnectorMetadata>,\n\n /// Additional data that might be required by hyperswitch based on the requested features by the merchants.\n pub feature_metadata: Option<FeatureMetadata>,\n\n /// Whether to generate the payment link for this payment or not (if applicable)\n #[schema(value_type = Option<EnablePaymentLinkRequest>)]\n pub payment_link_enabled: Option<common_enums::EnablePaymentLinkRequest>,\n\n /// Configure a custom payment link for the particular payment\n #[schema(value_type = Option<PaymentLinkConfigRequest>)]\n pub payment_link_config: Option<admin::PaymentLinkConfigRequest>,\n\n ///Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.\n #[schema(value_type = Option<RequestIncrementalAuthorization>)]\n pub request_incremental_authorization: Option<common_enums::RequestIncrementalAuthorization>,\n\n ///Will be used to expire client secret after certain amount of time to be supplied in seconds, if not sent it will be taken from profile config\n ///(900) for 15 mins\n #[schema(example = 900)]\n pub session_expiry: Option<u32>,\n\n /// Additional data related to some frm(Fraud Risk Management) connectors\n #[schema(value_type = Option<Object>, example = r#\"{ \"coverage_request\" : \"fraud\", \"fulfillment_method\" : \"delivery\" }\"#)]\n pub frm_metadata: Option<pii::SecretSerdeValue>,\n\n /// Whether to perform external authentication (if applicable)\n #[schema(value_type = Option<External3dsAuthenticationRequest>)]\n pub request_external_three_ds_authentication:\n Option<common_enums::External3dsAuthenticationRequest>,\n}",
|
| 77 |
+
"after_code": "pub struct PaymentsCreateIntentRequest {\n /// The amount details for the payment\n pub amount_details: AmountDetails,\n\n /// Unique identifier for the payment. This ensures idempotency for multiple payments\n /// that have been done by a single merchant.\n #[schema(\n value_type = Option<String>,\n min_length = 30,\n max_length = 30,\n example = \"pay_mbabizu24mvu3mela5njyhpit4\"\n )]\n pub merchant_reference_id: Option<id_type::PaymentReferenceId>,\n\n /// The routing algorithm id to be used for the payment\n #[schema(value_type = Option<String>)]\n pub routing_algorithm_id: Option<id_type::RoutingId>,\n\n #[schema(value_type = Option<CaptureMethod>, example = \"automatic\")]\n pub capture_method: Option<api_enums::CaptureMethod>,\n\n #[schema(value_type = Option<AuthenticationType>, example = \"no_three_ds\", default = \"no_three_ds\")]\n pub authentication_type: Option<api_enums::AuthenticationType>,\n\n /// The billing details of the payment. This address will be used for invoicing.\n pub billing: Option<Address>,\n\n /// The shipping address for the payment\n pub shipping: Option<Address>,\n\n /// The identifier for the customer\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: Option<id_type::GlobalCustomerId>,\n\n /// Set to `present` to indicate that the customer is in your checkout flow during this payment, and therefore is able to authenticate. This parameter should be `absent` when merchant's doing merchant initiated payments and customer is not present while doing the payment.\n #[schema(example = \"present\", value_type = Option<PresenceOfCustomerDuringPayment>)]\n pub customer_present: Option<common_enums::PresenceOfCustomerDuringPayment>,\n\n /// A description for the payment\n #[schema(example = \"It's my first payment request\", value_type = Option<String>)]\n pub description: Option<common_utils::types::Description>,\n\n /// The URL to which you want the user to be redirected after the completion of the payment operation\n #[schema(value_type = Option<String>, example = \"https://hyperswitch.io\")]\n pub return_url: Option<common_utils::types::Url>,\n\n #[schema(value_type = Option<FutureUsage>, example = \"off_session\")]\n pub setup_future_usage: Option<api_enums::FutureUsage>,\n\n /// Apply MIT exemption for a payment\n #[schema(value_type = Option<MitExemptionRequest>)]\n pub apply_mit_exemption: Option<common_enums::MitExemptionRequest>,\n\n /// For non-card charges, you can use this value as the complete description that appears on your customers\u2019 statements. Must contain at least one letter, maximum 22 characters.\n #[schema(max_length = 22, example = \"Hyperswitch Router\", value_type = Option<String>)]\n pub statement_descriptor: Option<common_utils::types::StatementDescriptor>,\n\n /// Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount\n #[schema(value_type = Option<Vec<OrderDetailsWithAmount>>, example = r#\"[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]\"#)]\n pub order_details: Option<Vec<OrderDetailsWithAmount>>,\n\n /// Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent\n #[schema(value_type = Option<Vec<PaymentMethodType>>)]\n pub allowed_payment_method_types: Option<Vec<api_enums::PaymentMethodType>>,\n\n /// Metadata is useful for storing additional, unstructured information on an object.\n #[schema(value_type = Option<Object>, example = r#\"{ \"udf1\": \"some-value\", \"udf2\": \"some-value\" }\"#)]\n pub metadata: Option<pii::SecretSerdeValue>,\n\n /// Some connectors like Apple pay, Airwallex and Noon might require some additional information, find specific details in the child attributes below.\n pub connector_metadata: Option<ConnectorMetadata>,\n\n /// Additional data that might be required by hyperswitch based on the requested features by the merchants.\n pub feature_metadata: Option<FeatureMetadata>,\n\n /// Whether to generate the payment link for this payment or not (if applicable)\n #[schema(value_type = Option<EnablePaymentLinkRequest>)]\n pub payment_link_enabled: Option<common_enums::EnablePaymentLinkRequest>,\n\n /// Configure a custom payment link for the particular payment\n #[schema(value_type = Option<PaymentLinkConfigRequest>)]\n pub payment_link_config: Option<admin::PaymentLinkConfigRequest>,\n\n ///Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.\n #[schema(value_type = Option<RequestIncrementalAuthorization>)]\n pub request_incremental_authorization: Option<common_enums::RequestIncrementalAuthorization>,\n\n ///Will be used to expire client secret after certain amount of time to be supplied in seconds, if not sent it will be taken from profile config\n ///(900) for 15 mins\n #[schema(example = 900)]\n pub session_expiry: Option<u32>,\n\n /// Additional data related to some frm(Fraud Risk Management) connectors\n #[schema(value_type = Option<Object>, example = r#\"{ \"coverage_request\" : \"fraud\", \"fulfillment_method\" : \"delivery\" }\"#)]\n pub frm_metadata: Option<pii::SecretSerdeValue>,\n\n /// Whether to perform external authentication (if applicable)\n #[schema(value_type = Option<External3dsAuthenticationRequest>)]\n pub request_external_three_ds_authentication:\n Option<common_enums::External3dsAuthenticationRequest>,\n}",
|
| 78 |
+
"diff_span": {
|
| 79 |
+
"before": "\n /// The identifier for the customer\n #[schema(value_type = Option<String>, max_length = 64, min_length = 1, example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\")]\n pub customer_id: Option<id_type::GlobalCustomerId>,\n",
|
| 80 |
+
"after": "\n /// The identifier for the customer\n #[schema(\n min_length = 32,\n max_length = 64,\n example = \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n value_type = String\n )]\n pub customer_id: Option<id_type::GlobalCustomerId>,\n"
|
| 81 |
+
},
|
| 82 |
+
"commit_sha": "b3a029767505b8dff53e38844bb5c1c559570f43"
|
| 83 |
+
}
|
| 84 |
+
]
|
| 85 |
+
}
|
diffs/pr_6836/bcade37/diff.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "bcade3783fb617fac2b1819ced467cf0ef39a053",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/api_models/src/ephemeral_key.rs",
|
| 6 |
+
"crates/router/src/routes/ephemeral_key.rs"
|
| 7 |
+
],
|
| 8 |
+
"diffs": [
|
| 9 |
+
{
|
| 10 |
+
"id": "crates/router/src/routes/ephemeral_key.rs::function::ephemeral_key_create",
|
| 11 |
+
"file": "crates/router/src/routes/ephemeral_key.rs",
|
| 12 |
+
"kind": "function_item",
|
| 13 |
+
"status": "modified",
|
| 14 |
+
"code_changed": true,
|
| 15 |
+
"imports_changed": false,
|
| 16 |
+
"before_code": "pub async fn ephemeral_key_create(\n state: web::Data<AppState>,\n req: HttpRequest,\n json_payload: web::Json<common_utils::id_type::CustomerId>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyCreate;\n let customer_id = json_payload.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n helpers::make_ephemeral_key(\n state,\n customer_id,\n auth.merchant_account.get_id().to_owned(),\n )\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n )\n .await\n}",
|
| 17 |
+
"after_code": "pub async fn ephemeral_key_create(\n state: web::Data<AppState>,\n req: HttpRequest,\n json_payload: web::Json<api_models::ephemeral_key::EphemeralKeyCreateRequest>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyCreate;\n let payload = json_payload.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n payload,\n |state, auth: auth::AuthenticationData, payload, _| {\n helpers::make_ephemeral_key(\n state,\n payload.customer_id,\n auth.merchant_account.get_id().to_owned(),\n )\n },\n &auth::HeaderAuth(auth::ApiKeyAuth),\n api_locking::LockAction::NotApplicable,\n )\n .await\n}",
|
| 18 |
+
"diff_span": {
|
| 19 |
+
"before": " state: web::Data<AppState>,\n req: HttpRequest,\n json_payload: web::Json<common_utils::id_type::CustomerId>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyCreate;\n let customer_id = json_payload.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n customer_id,\n |state, auth: auth::AuthenticationData, customer_id, _| {\n helpers::make_ephemeral_key(\n state,\n customer_id,\n auth.merchant_account.get_id().to_owned(),\n )",
|
| 20 |
+
"after": " state: web::Data<AppState>,\n req: HttpRequest,\n json_payload: web::Json<api_models::ephemeral_key::EphemeralKeyCreateRequest>,\n) -> HttpResponse {\n let flow = Flow::EphemeralKeyCreate;\n let payload = json_payload.into_inner();\n api::server_wrap(\n flow,\n state,\n &req,\n payload,\n |state, auth: auth::AuthenticationData, payload, _| {\n helpers::make_ephemeral_key(\n state,\n payload.customer_id,\n auth.merchant_account.get_id().to_owned(),\n )"
|
| 21 |
+
},
|
| 22 |
+
"commit_sha": "bcade3783fb617fac2b1819ced467cf0ef39a053"
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"id": "crates/api_models/src/ephemeral_key.rs::EphemeralKeyCreateRequest::function::get_api_event_type",
|
| 26 |
+
"file": "crates/api_models/src/ephemeral_key.rs",
|
| 27 |
+
"kind": "function_item",
|
| 28 |
+
"status": "added",
|
| 29 |
+
"before_code": null,
|
| 30 |
+
"after_code": "fn get_api_event_type(&self) -> Option<common_utils::events::ApiEventsType> {\n Some(common_utils::events::ApiEventsType::Miscellaneous)\n }",
|
| 31 |
+
"diff_span": null,
|
| 32 |
+
"commit_sha": "bcade3783fb617fac2b1819ced467cf0ef39a053"
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"id": "crates/api_models/src/ephemeral_key.rs::impl::EphemeralKeyCreateRequest",
|
| 36 |
+
"file": "crates/api_models/src/ephemeral_key.rs",
|
| 37 |
+
"kind": "impl_item",
|
| 38 |
+
"status": "added",
|
| 39 |
+
"before_code": null,
|
| 40 |
+
"after_code": "impl common_utils::events::ApiEventMetric for EphemeralKeyCreateRequest {\n fn get_api_event_type(&self) -> Option<common_utils::events::ApiEventsType> {\n Some(common_utils::events::ApiEventsType::Miscellaneous)\n }\n}",
|
| 41 |
+
"diff_span": null,
|
| 42 |
+
"commit_sha": "bcade3783fb617fac2b1819ced467cf0ef39a053"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"id": "crates/api_models/src/ephemeral_key.rs::struct::EphemeralKeyCreateRequest",
|
| 46 |
+
"file": "crates/api_models/src/ephemeral_key.rs",
|
| 47 |
+
"kind": "struct_item",
|
| 48 |
+
"status": "added",
|
| 49 |
+
"before_code": null,
|
| 50 |
+
"after_code": "pub struct EphemeralKeyCreateRequest {\n /// Customer ID for which an ephemeral key must be created\n #[schema(\n min_length = 1,\n max_length = 64,\n value_type = String,\n example = \"cus_y3oqhf46pyzuxjbcn2giaqnb44\"\n )]\n pub customer_id: id_type::CustomerId,\n}",
|
| 51 |
+
"diff_span": null,
|
| 52 |
+
"commit_sha": "bcade3783fb617fac2b1819ced467cf0ef39a053"
|
| 53 |
+
}
|
| 54 |
+
]
|
| 55 |
+
}
|
diffs/pr_6836/c12d8ef/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "c12d8eff454736b9e2d49e9f4cab64bf790ec6a3",
|
| 3 |
+
"pr_number": 6836,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6836/e581f1d/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6859/0e7922b/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "0e7922b5cf45f2c688ac42b2afd0cedd84b8232b",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/249e82b/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "249e82b7c0dd72390259277a0c2cbd12b74a2663",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/2e791d5/diff.json
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "2e791d5289a5eaf011722af0413bc64967acca19",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/common_types/src/payments.rs",
|
| 6 |
+
"crates/router/src/core/payments.rs",
|
| 7 |
+
"crates/router/src/core/payments/helpers.rs",
|
| 8 |
+
"crates/router/src/core/payments/operations.rs",
|
| 9 |
+
"crates/router/src/core/payments/operations/payment_confirm.rs"
|
| 10 |
+
],
|
| 11 |
+
"diffs": [
|
| 12 |
+
{
|
| 13 |
+
"id": "crates/router/src/core/payments/operations.rs::Domain::function::call_unified_authentication_service_if_eligible",
|
| 14 |
+
"file": "crates/router/src/core/payments/operations.rs",
|
| 15 |
+
"kind": "function_item",
|
| 16 |
+
"status": "modified",
|
| 17 |
+
"code_changed": true,
|
| 18 |
+
"imports_changed": false,
|
| 19 |
+
"before_code": "async fn call_unified_authentication_service_if_eligible<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _should_continue_confirm_transaction: &mut bool,\n _connector_call_type: &ConnectorCallType,\n _merchant_account: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n _authentication_product_ids: &common_types::payments::AuthenticationConnectorAccountMap,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }",
|
| 20 |
+
"after_code": "async fn call_unified_authentication_service_if_eligible<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _should_continue_confirm_transaction: &mut bool,\n _connector_call_type: &ConnectorCallType,\n _merchant_account: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }",
|
| 21 |
+
"diff_span": {
|
| 22 |
+
"before": " _merchant_account: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n _authentication_product_ids: &common_types::payments::AuthenticationConnectorAccountMap,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())",
|
| 23 |
+
"after": ""
|
| 24 |
+
},
|
| 25 |
+
"commit_sha": "2e791d5289a5eaf011722af0413bc64967acca19"
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"id": "crates/router/src/core/payments/operations.rs::trait::Domain",
|
| 29 |
+
"file": "crates/router/src/core/payments/operations.rs",
|
| 30 |
+
"kind": "trait_item",
|
| 31 |
+
"status": "modified",
|
| 32 |
+
"code_changed": true,
|
| 33 |
+
"imports_changed": false,
|
| 34 |
+
"before_code": "pub trait Domain<F: Clone, R, D>: Send + Sync {\n #[cfg(feature = \"v1\")]\n /// This will fetch customer details, (this operation is flow specific)\n async fn get_or_create_customer_details<'a>(\n &'a self,\n state: &SessionState,\n payment_data: &mut D,\n request: Option<CustomerDetails>,\n merchant_key_store: &domain::MerchantKeyStore,\n storage_scheme: enums::MerchantStorageScheme,\n ) -> CustomResult<(BoxedOperation<'a, F, R, D>, Option<domain::Customer>), errors::StorageError>;\n\n #[cfg(feature = \"v2\")]\n /// This will fetch customer details, (this operation is flow specific)\n async fn get_customer_details<'a>(\n &'a self,\n state: &SessionState,\n payment_data: &mut D,\n merchant_key_store: &domain::MerchantKeyStore,\n storage_scheme: enums::MerchantStorageScheme,\n ) -> CustomResult<(BoxedOperation<'a, F, R, D>, Option<domain::Customer>), errors::StorageError>;\n\n #[allow(clippy::too_many_arguments)]\n async fn make_pm_data<'a>(\n &'a self,\n state: &'a SessionState,\n payment_data: &mut D,\n storage_scheme: enums::MerchantStorageScheme,\n merchant_key_store: &domain::MerchantKeyStore,\n customer: &Option<domain::Customer>,\n business_profile: &domain::Profile,\n ) -> RouterResult<(\n BoxedOperation<'a, F, R, D>,\n Option<domain::PaymentMethodData>,\n Option<String>,\n )>;\n\n async fn add_task_to_process_tracker<'a>(\n &'a self,\n _db: &'a SessionState,\n _payment_attempt: &storage::PaymentAttempt,\n _requeue: bool,\n _schedule_time: Option<time::PrimitiveDateTime>,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[cfg(feature = \"v1\")]\n async fn get_connector<'a>(\n &'a self,\n merchant_account: &domain::MerchantAccount,\n state: &SessionState,\n request: &R,\n payment_intent: &storage::PaymentIntent,\n mechant_key_store: &domain::MerchantKeyStore,\n ) -> CustomResult<api::ConnectorChoice, errors::ApiErrorResponse>;\n\n #[cfg(feature = \"v2\")]\n async fn perform_routing<'a>(\n &'a self,\n merchant_account: &domain::MerchantAccount,\n business_profile: &domain::Profile,\n state: &SessionState,\n // TODO: do not take the whole payment data here\n payment_data: &mut D,\n mechant_key_store: &domain::MerchantKeyStore,\n ) -> CustomResult<ConnectorCallType, errors::ApiErrorResponse>;\n\n async fn populate_payment_data<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _merchant_account: &domain::MerchantAccount,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[allow(clippy::too_many_arguments)]\n async fn call_external_three_ds_authentication_if_eligible<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _should_continue_confirm_transaction: &mut bool,\n _connector_call_type: &ConnectorCallType,\n _merchant_account: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n _mandate_type: Option<api_models::payments::MandateTransactionType>,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[allow(clippy::too_many_arguments)]\n async fn call_unified_authentication_service_if_eligible<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _should_continue_confirm_transaction: &mut bool,\n _connector_call_type: &ConnectorCallType,\n _merchant_account: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n _authentication_product_ids: &common_types::payments::AuthenticationConnectorAccountMap,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[allow(clippy::too_many_arguments)]\n async fn payments_dynamic_tax_calculation<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _connector_call_type: &ConnectorCallType,\n _business_profile: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n _merchant_account: &domain::MerchantAccount,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[instrument(skip_all)]\n async fn guard_payment_against_blocklist<'a>(\n &'a self,\n _state: &SessionState,\n _merchant_account: &domain::MerchantAccount,\n _key_store: &domain::MerchantKeyStore,\n _payment_data: &mut D,\n ) -> CustomResult<bool, errors::ApiErrorResponse> {\n Ok(false)\n }\n\n async fn store_extended_card_info_temporarily<'a>(\n &'a self,\n _state: &SessionState,\n _payment_id: &common_utils::id_type::PaymentId,\n _business_profile: &domain::Profile,\n _payment_method_data: Option<&domain::PaymentMethodData>,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n // #[cfg(feature = \"v2\")]\n // async fn call_connector<'a, RouterDataReq>(\n // &'a self,\n // _state: &SessionState,\n // _req_state: ReqState,\n // _merchant_account: &domain::MerchantAccount,\n // _key_store: &domain::MerchantKeyStore,\n // _business_profile: &domain::Profile,\n // _payment_method_data: Option<&domain::PaymentMethodData>,\n // _connector: api::ConnectorData,\n // _customer: &Option<domain::Customer>,\n // _payment_data: &mut D,\n // _call_connector_action: common_enums::CallConnectorAction,\n // ) -> CustomResult<\n // hyperswitch_domain_models::router_data::RouterData<F, RouterDataReq, PaymentsResponseData>,\n // errors::ApiErrorResponse,\n // > {\n // // TODO: raise an error here\n // todo!();\n // }\n}",
|
| 35 |
+
"after_code": "pub trait Domain<F: Clone, R, D>: Send + Sync {\n #[cfg(feature = \"v1\")]\n /// This will fetch customer details, (this operation is flow specific)\n async fn get_or_create_customer_details<'a>(\n &'a self,\n state: &SessionState,\n payment_data: &mut D,\n request: Option<CustomerDetails>,\n merchant_key_store: &domain::MerchantKeyStore,\n storage_scheme: enums::MerchantStorageScheme,\n ) -> CustomResult<(BoxedOperation<'a, F, R, D>, Option<domain::Customer>), errors::StorageError>;\n\n #[cfg(feature = \"v2\")]\n /// This will fetch customer details, (this operation is flow specific)\n async fn get_customer_details<'a>(\n &'a self,\n state: &SessionState,\n payment_data: &mut D,\n merchant_key_store: &domain::MerchantKeyStore,\n storage_scheme: enums::MerchantStorageScheme,\n ) -> CustomResult<(BoxedOperation<'a, F, R, D>, Option<domain::Customer>), errors::StorageError>;\n\n #[allow(clippy::too_many_arguments)]\n async fn make_pm_data<'a>(\n &'a self,\n state: &'a SessionState,\n payment_data: &mut D,\n storage_scheme: enums::MerchantStorageScheme,\n merchant_key_store: &domain::MerchantKeyStore,\n customer: &Option<domain::Customer>,\n business_profile: &domain::Profile,\n ) -> RouterResult<(\n BoxedOperation<'a, F, R, D>,\n Option<domain::PaymentMethodData>,\n Option<String>,\n )>;\n\n async fn add_task_to_process_tracker<'a>(\n &'a self,\n _db: &'a SessionState,\n _payment_attempt: &storage::PaymentAttempt,\n _requeue: bool,\n _schedule_time: Option<time::PrimitiveDateTime>,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[cfg(feature = \"v1\")]\n async fn get_connector<'a>(\n &'a self,\n merchant_account: &domain::MerchantAccount,\n state: &SessionState,\n request: &R,\n payment_intent: &storage::PaymentIntent,\n mechant_key_store: &domain::MerchantKeyStore,\n ) -> CustomResult<api::ConnectorChoice, errors::ApiErrorResponse>;\n\n #[cfg(feature = \"v2\")]\n async fn perform_routing<'a>(\n &'a self,\n merchant_account: &domain::MerchantAccount,\n business_profile: &domain::Profile,\n state: &SessionState,\n // TODO: do not take the whole payment data here\n payment_data: &mut D,\n mechant_key_store: &domain::MerchantKeyStore,\n ) -> CustomResult<ConnectorCallType, errors::ApiErrorResponse>;\n\n async fn populate_payment_data<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _merchant_account: &domain::MerchantAccount,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[allow(clippy::too_many_arguments)]\n async fn call_external_three_ds_authentication_if_eligible<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _should_continue_confirm_transaction: &mut bool,\n _connector_call_type: &ConnectorCallType,\n _merchant_account: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n _mandate_type: Option<api_models::payments::MandateTransactionType>,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[allow(clippy::too_many_arguments)]\n async fn call_unified_authentication_service_if_eligible<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _should_continue_confirm_transaction: &mut bool,\n _connector_call_type: &ConnectorCallType,\n _merchant_account: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[allow(clippy::too_many_arguments)]\n async fn payments_dynamic_tax_calculation<'a>(\n &'a self,\n _state: &SessionState,\n _payment_data: &mut D,\n _connector_call_type: &ConnectorCallType,\n _business_profile: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n _merchant_account: &domain::MerchantAccount,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n #[instrument(skip_all)]\n async fn guard_payment_against_blocklist<'a>(\n &'a self,\n _state: &SessionState,\n _merchant_account: &domain::MerchantAccount,\n _key_store: &domain::MerchantKeyStore,\n _payment_data: &mut D,\n ) -> CustomResult<bool, errors::ApiErrorResponse> {\n Ok(false)\n }\n\n async fn store_extended_card_info_temporarily<'a>(\n &'a self,\n _state: &SessionState,\n _payment_id: &common_utils::id_type::PaymentId,\n _business_profile: &domain::Profile,\n _payment_method_data: Option<&domain::PaymentMethodData>,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())\n }\n\n // #[cfg(feature = \"v2\")]\n // async fn call_connector<'a, RouterDataReq>(\n // &'a self,\n // _state: &SessionState,\n // _req_state: ReqState,\n // _merchant_account: &domain::MerchantAccount,\n // _key_store: &domain::MerchantKeyStore,\n // _business_profile: &domain::Profile,\n // _payment_method_data: Option<&domain::PaymentMethodData>,\n // _connector: api::ConnectorData,\n // _customer: &Option<domain::Customer>,\n // _payment_data: &mut D,\n // _call_connector_action: common_enums::CallConnectorAction,\n // ) -> CustomResult<\n // hyperswitch_domain_models::router_data::RouterData<F, RouterDataReq, PaymentsResponseData>,\n // errors::ApiErrorResponse,\n // > {\n // // TODO: raise an error here\n // todo!();\n // }\n}",
|
| 36 |
+
"diff_span": {
|
| 37 |
+
"before": " _merchant_account: &domain::Profile,\n _key_store: &domain::MerchantKeyStore,\n _authentication_product_ids: &common_types::payments::AuthenticationConnectorAccountMap,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n Ok(())",
|
| 38 |
+
"after": ""
|
| 39 |
+
},
|
| 40 |
+
"commit_sha": "2e791d5289a5eaf011722af0413bc64967acca19"
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"id": "crates/router/src/core/payments.rs::function::payments_operation_core",
|
| 44 |
+
"file": "crates/router/src/core/payments.rs",
|
| 45 |
+
"kind": "function_item",
|
| 46 |
+
"status": "modified",
|
| 47 |
+
"code_changed": true,
|
| 48 |
+
"imports_changed": false,
|
| 49 |
+
"before_code": "pub async fn payments_operation_core<F, Req, Op, FData, D>(\n state: &SessionState,\n req_state: ReqState,\n merchant_account: domain::MerchantAccount,\n profile_id_from_auth_layer: Option<id_type::ProfileId>,\n key_store: domain::MerchantKeyStore,\n operation: Op,\n req: Req,\n call_connector_action: CallConnectorAction,\n auth_flow: services::AuthFlow,\n eligible_connectors: Option<Vec<common_enums::RoutableConnectors>>,\n header_payload: HeaderPayload,\n) -> RouterResult<(D, Req, Option<domain::Customer>, Option<u16>, Option<u128>)>\nwhere\n F: Send + Clone + Sync,\n Req: Authenticate + Clone,\n Op: Operation<F, Req, Data = D> + Send + Sync,\n D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone,\n\n // To create connector flow specific interface data\n D: ConstructFlowSpecificData<F, FData, router_types::PaymentsResponseData>,\n RouterData<F, FData, router_types::PaymentsResponseData>: Feature<F, FData>,\n\n // To construct connector flow specific api\n dyn api::Connector:\n services::api::ConnectorIntegration<F, FData, router_types::PaymentsResponseData>,\n\n // To perform router related operation for PaymentResponse\n PaymentResponse: Operation<F, FData, Data = D>,\n FData: Send + Sync + Clone,\n{\n let operation: BoxedOperation<'_, F, Req, D> = Box::new(operation);\n\n tracing::Span::current().record(\"merchant_id\", merchant_account.get_id().get_string_repr());\n let (operation, validate_result) = operation\n .to_validate_request()?\n .validate_request(&req, &merchant_account)?;\n\n tracing::Span::current().record(\"payment_id\", format!(\"{}\", validate_result.payment_id));\n // get profile from headers\n let operations::GetTrackerResponse {\n operation,\n customer_details,\n mut payment_data,\n business_profile,\n mandate_type,\n } = operation\n .to_get_tracker()?\n .get_trackers(\n state,\n &validate_result.payment_id,\n &req,\n &merchant_account,\n &key_store,\n auth_flow,\n &header_payload,\n )\n .await?;\n core_utils::validate_profile_id_from_auth_layer(\n profile_id_from_auth_layer,\n &payment_data.get_payment_intent().clone(),\n )?;\n\n let (operation, customer) = operation\n .to_domain()?\n // get_customer_details\n .get_or_create_customer_details(\n state,\n &mut payment_data,\n customer_details,\n &key_store,\n merchant_account.storage_scheme,\n )\n .await\n .to_not_found_response(errors::ApiErrorResponse::CustomerNotFound)\n .attach_printable(\"Failed while fetching/creating customer\")?;\n\n let authentication_type =\n call_decision_manager(state, &merchant_account, &business_profile, &payment_data).await?;\n\n payment_data.set_authentication_type_in_attempt(authentication_type);\n\n let connector = get_connector_choice(\n &operation,\n state,\n &req,\n &merchant_account,\n &business_profile,\n &key_store,\n &mut payment_data,\n eligible_connectors,\n mandate_type,\n )\n .await?;\n\n let should_add_task_to_process_tracker = should_add_task_to_process_tracker(&payment_data);\n\n let locale = header_payload.locale.clone();\n\n payment_data = tokenize_in_router_when_confirm_false_or_external_authentication(\n state,\n &operation,\n &mut payment_data,\n &validate_result,\n &key_store,\n &customer,\n &business_profile,\n )\n .await?;\n\n let mut connector_http_status_code = None;\n let mut external_latency = None;\n if let Some(connector_details) = connector {\n // Fetch and check FRM configs\n #[cfg(feature = \"frm\")]\n let mut frm_info = None;\n #[allow(unused_variables, unused_mut)]\n let mut should_continue_transaction: bool = true;\n #[cfg(feature = \"frm\")]\n let mut should_continue_capture: bool = true;\n #[cfg(feature = \"frm\")]\n let frm_configs = if state.conf.frm.enabled {\n Box::pin(frm_core::call_frm_before_connector_call(\n &operation,\n &merchant_account,\n &mut payment_data,\n state,\n &mut frm_info,\n &customer,\n &mut should_continue_transaction,\n &mut should_continue_capture,\n key_store.clone(),\n ))\n .await?\n } else {\n None\n };\n #[cfg(feature = \"frm\")]\n logger::debug!(\n \"frm_configs: {:?}\\nshould_continue_transaction: {:?}\\nshould_continue_capture: {:?}\",\n frm_configs,\n should_continue_transaction,\n should_continue_capture,\n );\n\n if helpers::is_merchant_eligible_authenthention_service(merchant_account.get_id(), state)\n .await?\n {\n let authentication_product_ids = business_profile\n .authentication_product_ids\n .clone()\n .ok_or(errors::ApiErrorResponse::PreconditionFailed {\n message: \"authentication_product_ids is not configured in business profile\"\n .to_string(),\n })?;\n operation\n .to_domain()?\n .call_unified_authentication_service_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n &authentication_product_ids,\n )\n .await?;\n } else {\n logger::info!(\n \"skipping authentication service call since the merchant is not eligible.\"\n );\n\n operation\n .to_domain()?\n .call_external_three_ds_authentication_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n mandate_type,\n )\n .await?;\n };\n\n operation\n .to_domain()?\n .payments_dynamic_tax_calculation(\n state,\n &mut payment_data,\n &connector_details,\n &business_profile,\n &key_store,\n &merchant_account,\n )\n .await?;\n\n if should_continue_transaction {\n #[cfg(feature = \"frm\")]\n match (\n should_continue_capture,\n payment_data.get_payment_attempt().capture_method,\n ) {\n (\n false,\n Some(storage_enums::CaptureMethod::Automatic)\n | Some(storage_enums::CaptureMethod::SequentialAutomatic),\n )\n | (false, Some(storage_enums::CaptureMethod::Scheduled)) => {\n if let Some(info) = &mut frm_info {\n if let Some(frm_data) = &mut info.frm_data {\n frm_data.fraud_check.payment_capture_method =\n payment_data.get_payment_attempt().capture_method;\n }\n }\n payment_data\n .set_capture_method_in_attempt(storage_enums::CaptureMethod::Manual);\n logger::debug!(\"payment_id : {:?} capture method has been changed to manual, since it has configured Post FRM flow\",payment_data.get_payment_attempt().payment_id);\n }\n _ => (),\n };\n payment_data = match connector_details {\n ConnectorCallType::PreDetermined(connector) => {\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n let routable_connectors =\n convert_connector_data_to_routable_connectors(&[connector.clone()])\n .map_err(|e| logger::error!(routable_connector_error=?e))\n .unwrap_or_default();\n let schedule_time = if should_add_task_to_process_tracker {\n payment_sync::get_sync_process_schedule_time(\n &*state.store,\n connector.connector.id(),\n merchant_account.get_id(),\n 0,\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed while getting process schedule time\")?\n } else {\n None\n };\n let (router_data, mca) = call_connector_service(\n state,\n req_state.clone(),\n &merchant_account,\n &key_store,\n connector.clone(),\n &operation,\n &mut payment_data,\n &customer,\n call_connector_action.clone(),\n &validate_result,\n schedule_time,\n header_payload.clone(),\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n false,\n )\n .await?;\n\n let op_ref = &operation;\n let should_trigger_post_processing_flows = is_operation_confirm(&operation);\n\n let operation = Box::new(PaymentResponse);\n\n connector_http_status_code = router_data.connector_http_status_code;\n external_latency = router_data.external_latency;\n //add connector http status code metrics\n add_connector_http_status_code_metrics(connector_http_status_code);\n\n operation\n .to_post_update_tracker()?\n .save_pm_and_mandate(\n state,\n &router_data,\n &merchant_account,\n &key_store,\n &mut payment_data,\n &business_profile,\n )\n .await?;\n\n let mut payment_data = operation\n .to_post_update_tracker()?\n .update_tracker(\n state,\n payment_data,\n router_data,\n &key_store,\n merchant_account.storage_scheme,\n &locale,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n routable_connectors,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n &business_profile,\n )\n .await?;\n\n if should_trigger_post_processing_flows {\n complete_postprocessing_steps_if_required(\n state,\n &merchant_account,\n &key_store,\n &customer,\n &mca,\n &connector,\n &mut payment_data,\n op_ref,\n Some(header_payload.clone()),\n )\n .await?;\n }\n\n payment_data\n }\n\n ConnectorCallType::Retryable(connectors) => {\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n let routable_connectors =\n convert_connector_data_to_routable_connectors(&connectors)\n .map_err(|e| logger::error!(routable_connector_error=?e))\n .unwrap_or_default();\n\n let mut connectors = connectors.into_iter();\n\n let connector_data = get_connector_data(&mut connectors)?;\n\n let schedule_time = if should_add_task_to_process_tracker {\n payment_sync::get_sync_process_schedule_time(\n &*state.store,\n connector_data.connector.id(),\n merchant_account.get_id(),\n 0,\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed while getting process schedule time\")?\n } else {\n None\n };\n let (router_data, mca) = call_connector_service(\n state,\n req_state.clone(),\n &merchant_account,\n &key_store,\n connector_data.clone(),\n &operation,\n &mut payment_data,\n &customer,\n call_connector_action.clone(),\n &validate_result,\n schedule_time,\n header_payload.clone(),\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n false,\n )\n .await?;\n\n #[cfg(all(feature = \"retry\", feature = \"v1\"))]\n let mut router_data = router_data;\n #[cfg(all(feature = \"retry\", feature = \"v1\"))]\n {\n use crate::core::payments::retry::{self, GsmValidation};\n let config_bool = retry::config_should_call_gsm(\n &*state.store,\n merchant_account.get_id(),\n &business_profile,\n )\n .await;\n\n if config_bool && router_data.should_call_gsm() {\n router_data = retry::do_gsm_actions(\n state,\n req_state.clone(),\n &mut payment_data,\n connectors,\n connector_data.clone(),\n router_data,\n &merchant_account,\n &key_store,\n &operation,\n &customer,\n &validate_result,\n schedule_time,\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n )\n .await?;\n };\n }\n\n let op_ref = &operation;\n let should_trigger_post_processing_flows = is_operation_confirm(&operation);\n\n let operation = Box::new(PaymentResponse);\n connector_http_status_code = router_data.connector_http_status_code;\n external_latency = router_data.external_latency;\n //add connector http status code metrics\n add_connector_http_status_code_metrics(connector_http_status_code);\n\n operation\n .to_post_update_tracker()?\n .save_pm_and_mandate(\n state,\n &router_data,\n &merchant_account,\n &key_store,\n &mut payment_data,\n &business_profile,\n )\n .await?;\n\n let mut payment_data = operation\n .to_post_update_tracker()?\n .update_tracker(\n state,\n payment_data,\n router_data,\n &key_store,\n merchant_account.storage_scheme,\n &locale,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n routable_connectors,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n &business_profile,\n )\n .await?;\n\n if should_trigger_post_processing_flows {\n complete_postprocessing_steps_if_required(\n state,\n &merchant_account,\n &key_store,\n &customer,\n &mca,\n &connector_data,\n &mut payment_data,\n op_ref,\n Some(header_payload.clone()),\n )\n .await?;\n }\n\n payment_data\n }\n\n ConnectorCallType::SessionMultiple(connectors) => {\n let session_surcharge_details =\n call_surcharge_decision_management_for_session_flow(\n state,\n &merchant_account,\n &business_profile,\n payment_data.get_payment_attempt(),\n payment_data.get_payment_intent(),\n payment_data.get_billing_address(),\n &connectors,\n )\n .await?;\n Box::pin(call_multiple_connectors_service(\n state,\n &merchant_account,\n &key_store,\n connectors,\n &operation,\n payment_data,\n &customer,\n session_surcharge_details,\n &business_profile,\n header_payload.clone(),\n ))\n .await?\n }\n };\n\n #[cfg(feature = \"frm\")]\n if let Some(fraud_info) = &mut frm_info {\n #[cfg(feature = \"v1\")]\n Box::pin(frm_core::post_payment_frm_core(\n state,\n req_state,\n &merchant_account,\n &mut payment_data,\n fraud_info,\n frm_configs\n .clone()\n .ok_or(errors::ApiErrorResponse::MissingRequiredField {\n field_name: \"frm_configs\",\n })\n .attach_printable(\"Frm configs label not found\")?,\n &customer,\n key_store.clone(),\n &mut should_continue_capture,\n ))\n .await?;\n }\n } else {\n (_, payment_data) = operation\n .to_update_tracker()?\n .update_trackers(\n state,\n req_state,\n payment_data.clone(),\n customer.clone(),\n validate_result.storage_scheme,\n None,\n &key_store,\n #[cfg(feature = \"frm\")]\n frm_info.and_then(|info| info.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n header_payload.clone(),\n )\n .await?;\n }\n\n let payment_intent_status = payment_data.get_payment_intent().status;\n\n payment_data\n .get_payment_attempt()\n .payment_token\n .as_ref()\n .zip(payment_data.get_payment_attempt().payment_method)\n .map(ParentPaymentMethodToken::create_key_for_token)\n .async_map(|key_for_hyperswitch_token| async move {\n if key_for_hyperswitch_token\n .should_delete_payment_method_token(payment_intent_status)\n {\n let _ = key_for_hyperswitch_token.delete(state).await;\n }\n })\n .await;\n } else {\n (_, payment_data) = operation\n .to_update_tracker()?\n .update_trackers(\n state,\n req_state,\n payment_data.clone(),\n customer.clone(),\n validate_result.storage_scheme,\n None,\n &key_store,\n None,\n header_payload.clone(),\n )\n .await?;\n }\n\n let cloned_payment_data = payment_data.clone();\n let cloned_customer = customer.clone();\n\n #[cfg(feature = \"v1\")]\n operation\n .to_domain()?\n .store_extended_card_info_temporarily(\n state,\n payment_data.get_payment_intent().get_id(),\n &business_profile,\n payment_data.get_payment_method_data(),\n )\n .await?;\n\n utils::trigger_payments_webhook(\n merchant_account,\n business_profile,\n &key_store,\n cloned_payment_data,\n cloned_customer,\n state,\n operation,\n )\n .await\n .map_err(|error| logger::warn!(payments_outgoing_webhook_error=?error))\n .ok();\n\n Ok((\n payment_data,\n req,\n customer,\n connector_http_status_code,\n external_latency,\n ))\n}",
|
| 50 |
+
"after_code": "pub async fn payments_operation_core<F, Req, Op, FData, D>(\n state: &SessionState,\n req_state: ReqState,\n merchant_account: domain::MerchantAccount,\n profile_id_from_auth_layer: Option<id_type::ProfileId>,\n key_store: domain::MerchantKeyStore,\n operation: Op,\n req: Req,\n call_connector_action: CallConnectorAction,\n auth_flow: services::AuthFlow,\n eligible_connectors: Option<Vec<common_enums::RoutableConnectors>>,\n header_payload: HeaderPayload,\n) -> RouterResult<(D, Req, Option<domain::Customer>, Option<u16>, Option<u128>)>\nwhere\n F: Send + Clone + Sync,\n Req: Authenticate + Clone,\n Op: Operation<F, Req, Data = D> + Send + Sync,\n D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone,\n\n // To create connector flow specific interface data\n D: ConstructFlowSpecificData<F, FData, router_types::PaymentsResponseData>,\n RouterData<F, FData, router_types::PaymentsResponseData>: Feature<F, FData>,\n\n // To construct connector flow specific api\n dyn api::Connector:\n services::api::ConnectorIntegration<F, FData, router_types::PaymentsResponseData>,\n\n // To perform router related operation for PaymentResponse\n PaymentResponse: Operation<F, FData, Data = D>,\n FData: Send + Sync + Clone,\n{\n let operation: BoxedOperation<'_, F, Req, D> = Box::new(operation);\n\n tracing::Span::current().record(\"merchant_id\", merchant_account.get_id().get_string_repr());\n let (operation, validate_result) = operation\n .to_validate_request()?\n .validate_request(&req, &merchant_account)?;\n\n tracing::Span::current().record(\"payment_id\", format!(\"{}\", validate_result.payment_id));\n // get profile from headers\n let operations::GetTrackerResponse {\n operation,\n customer_details,\n mut payment_data,\n business_profile,\n mandate_type,\n } = operation\n .to_get_tracker()?\n .get_trackers(\n state,\n &validate_result.payment_id,\n &req,\n &merchant_account,\n &key_store,\n auth_flow,\n &header_payload,\n )\n .await?;\n core_utils::validate_profile_id_from_auth_layer(\n profile_id_from_auth_layer,\n &payment_data.get_payment_intent().clone(),\n )?;\n\n let (operation, customer) = operation\n .to_domain()?\n // get_customer_details\n .get_or_create_customer_details(\n state,\n &mut payment_data,\n customer_details,\n &key_store,\n merchant_account.storage_scheme,\n )\n .await\n .to_not_found_response(errors::ApiErrorResponse::CustomerNotFound)\n .attach_printable(\"Failed while fetching/creating customer\")?;\n\n let authentication_type =\n call_decision_manager(state, &merchant_account, &business_profile, &payment_data).await?;\n\n payment_data.set_authentication_type_in_attempt(authentication_type);\n\n let connector = get_connector_choice(\n &operation,\n state,\n &req,\n &merchant_account,\n &business_profile,\n &key_store,\n &mut payment_data,\n eligible_connectors,\n mandate_type,\n )\n .await?;\n\n let should_add_task_to_process_tracker = should_add_task_to_process_tracker(&payment_data);\n\n let locale = header_payload.locale.clone();\n\n payment_data = tokenize_in_router_when_confirm_false_or_external_authentication(\n state,\n &operation,\n &mut payment_data,\n &validate_result,\n &key_store,\n &customer,\n &business_profile,\n )\n .await?;\n\n let mut connector_http_status_code = None;\n let mut external_latency = None;\n if let Some(connector_details) = connector {\n // Fetch and check FRM configs\n #[cfg(feature = \"frm\")]\n let mut frm_info = None;\n #[allow(unused_variables, unused_mut)]\n let mut should_continue_transaction: bool = true;\n #[cfg(feature = \"frm\")]\n let mut should_continue_capture: bool = true;\n #[cfg(feature = \"frm\")]\n let frm_configs = if state.conf.frm.enabled {\n Box::pin(frm_core::call_frm_before_connector_call(\n &operation,\n &merchant_account,\n &mut payment_data,\n state,\n &mut frm_info,\n &customer,\n &mut should_continue_transaction,\n &mut should_continue_capture,\n key_store.clone(),\n ))\n .await?\n } else {\n None\n };\n #[cfg(feature = \"frm\")]\n logger::debug!(\n \"frm_configs: {:?}\\nshould_continue_transaction: {:?}\\nshould_continue_capture: {:?}\",\n frm_configs,\n should_continue_transaction,\n should_continue_capture,\n );\n\n if helpers::is_merchant_eligible_authenthention_service(merchant_account.get_id(), state)\n .await?\n {\n operation\n .to_domain()?\n .call_unified_authentication_service_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n )\n .await?;\n } else {\n logger::info!(\n \"skipping authentication service call since the merchant is not eligible.\"\n );\n\n operation\n .to_domain()?\n .call_external_three_ds_authentication_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n mandate_type,\n )\n .await?;\n };\n\n operation\n .to_domain()?\n .payments_dynamic_tax_calculation(\n state,\n &mut payment_data,\n &connector_details,\n &business_profile,\n &key_store,\n &merchant_account,\n )\n .await?;\n\n if should_continue_transaction {\n #[cfg(feature = \"frm\")]\n match (\n should_continue_capture,\n payment_data.get_payment_attempt().capture_method,\n ) {\n (\n false,\n Some(storage_enums::CaptureMethod::Automatic)\n | Some(storage_enums::CaptureMethod::SequentialAutomatic),\n )\n | (false, Some(storage_enums::CaptureMethod::Scheduled)) => {\n if let Some(info) = &mut frm_info {\n if let Some(frm_data) = &mut info.frm_data {\n frm_data.fraud_check.payment_capture_method =\n payment_data.get_payment_attempt().capture_method;\n }\n }\n payment_data\n .set_capture_method_in_attempt(storage_enums::CaptureMethod::Manual);\n logger::debug!(\"payment_id : {:?} capture method has been changed to manual, since it has configured Post FRM flow\",payment_data.get_payment_attempt().payment_id);\n }\n _ => (),\n };\n payment_data = match connector_details {\n ConnectorCallType::PreDetermined(connector) => {\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n let routable_connectors =\n convert_connector_data_to_routable_connectors(&[connector.clone()])\n .map_err(|e| logger::error!(routable_connector_error=?e))\n .unwrap_or_default();\n let schedule_time = if should_add_task_to_process_tracker {\n payment_sync::get_sync_process_schedule_time(\n &*state.store,\n connector.connector.id(),\n merchant_account.get_id(),\n 0,\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed while getting process schedule time\")?\n } else {\n None\n };\n let (router_data, mca) = call_connector_service(\n state,\n req_state.clone(),\n &merchant_account,\n &key_store,\n connector.clone(),\n &operation,\n &mut payment_data,\n &customer,\n call_connector_action.clone(),\n &validate_result,\n schedule_time,\n header_payload.clone(),\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n false,\n )\n .await?;\n\n let op_ref = &operation;\n let should_trigger_post_processing_flows = is_operation_confirm(&operation);\n\n let operation = Box::new(PaymentResponse);\n\n connector_http_status_code = router_data.connector_http_status_code;\n external_latency = router_data.external_latency;\n //add connector http status code metrics\n add_connector_http_status_code_metrics(connector_http_status_code);\n\n operation\n .to_post_update_tracker()?\n .save_pm_and_mandate(\n state,\n &router_data,\n &merchant_account,\n &key_store,\n &mut payment_data,\n &business_profile,\n )\n .await?;\n\n let mut payment_data = operation\n .to_post_update_tracker()?\n .update_tracker(\n state,\n payment_data,\n router_data,\n &key_store,\n merchant_account.storage_scheme,\n &locale,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n routable_connectors,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n &business_profile,\n )\n .await?;\n\n if should_trigger_post_processing_flows {\n complete_postprocessing_steps_if_required(\n state,\n &merchant_account,\n &key_store,\n &customer,\n &mca,\n &connector,\n &mut payment_data,\n op_ref,\n Some(header_payload.clone()),\n )\n .await?;\n }\n\n payment_data\n }\n\n ConnectorCallType::Retryable(connectors) => {\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n let routable_connectors =\n convert_connector_data_to_routable_connectors(&connectors)\n .map_err(|e| logger::error!(routable_connector_error=?e))\n .unwrap_or_default();\n\n let mut connectors = connectors.into_iter();\n\n let connector_data = get_connector_data(&mut connectors)?;\n\n let schedule_time = if should_add_task_to_process_tracker {\n payment_sync::get_sync_process_schedule_time(\n &*state.store,\n connector_data.connector.id(),\n merchant_account.get_id(),\n 0,\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed while getting process schedule time\")?\n } else {\n None\n };\n let (router_data, mca) = call_connector_service(\n state,\n req_state.clone(),\n &merchant_account,\n &key_store,\n connector_data.clone(),\n &operation,\n &mut payment_data,\n &customer,\n call_connector_action.clone(),\n &validate_result,\n schedule_time,\n header_payload.clone(),\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n false,\n )\n .await?;\n\n #[cfg(all(feature = \"retry\", feature = \"v1\"))]\n let mut router_data = router_data;\n #[cfg(all(feature = \"retry\", feature = \"v1\"))]\n {\n use crate::core::payments::retry::{self, GsmValidation};\n let config_bool = retry::config_should_call_gsm(\n &*state.store,\n merchant_account.get_id(),\n &business_profile,\n )\n .await;\n\n if config_bool && router_data.should_call_gsm() {\n router_data = retry::do_gsm_actions(\n state,\n req_state.clone(),\n &mut payment_data,\n connectors,\n connector_data.clone(),\n router_data,\n &merchant_account,\n &key_store,\n &operation,\n &customer,\n &validate_result,\n schedule_time,\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n )\n .await?;\n };\n }\n\n let op_ref = &operation;\n let should_trigger_post_processing_flows = is_operation_confirm(&operation);\n\n let operation = Box::new(PaymentResponse);\n connector_http_status_code = router_data.connector_http_status_code;\n external_latency = router_data.external_latency;\n //add connector http status code metrics\n add_connector_http_status_code_metrics(connector_http_status_code);\n\n operation\n .to_post_update_tracker()?\n .save_pm_and_mandate(\n state,\n &router_data,\n &merchant_account,\n &key_store,\n &mut payment_data,\n &business_profile,\n )\n .await?;\n\n let mut payment_data = operation\n .to_post_update_tracker()?\n .update_tracker(\n state,\n payment_data,\n router_data,\n &key_store,\n merchant_account.storage_scheme,\n &locale,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n routable_connectors,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n &business_profile,\n )\n .await?;\n\n if should_trigger_post_processing_flows {\n complete_postprocessing_steps_if_required(\n state,\n &merchant_account,\n &key_store,\n &customer,\n &mca,\n &connector_data,\n &mut payment_data,\n op_ref,\n Some(header_payload.clone()),\n )\n .await?;\n }\n\n payment_data\n }\n\n ConnectorCallType::SessionMultiple(connectors) => {\n let session_surcharge_details =\n call_surcharge_decision_management_for_session_flow(\n state,\n &merchant_account,\n &business_profile,\n payment_data.get_payment_attempt(),\n payment_data.get_payment_intent(),\n payment_data.get_billing_address(),\n &connectors,\n )\n .await?;\n Box::pin(call_multiple_connectors_service(\n state,\n &merchant_account,\n &key_store,\n connectors,\n &operation,\n payment_data,\n &customer,\n session_surcharge_details,\n &business_profile,\n header_payload.clone(),\n ))\n .await?\n }\n };\n\n #[cfg(feature = \"frm\")]\n if let Some(fraud_info) = &mut frm_info {\n #[cfg(feature = \"v1\")]\n Box::pin(frm_core::post_payment_frm_core(\n state,\n req_state,\n &merchant_account,\n &mut payment_data,\n fraud_info,\n frm_configs\n .clone()\n .ok_or(errors::ApiErrorResponse::MissingRequiredField {\n field_name: \"frm_configs\",\n })\n .attach_printable(\"Frm configs label not found\")?,\n &customer,\n key_store.clone(),\n &mut should_continue_capture,\n ))\n .await?;\n }\n } else {\n (_, payment_data) = operation\n .to_update_tracker()?\n .update_trackers(\n state,\n req_state,\n payment_data.clone(),\n customer.clone(),\n validate_result.storage_scheme,\n None,\n &key_store,\n #[cfg(feature = \"frm\")]\n frm_info.and_then(|info| info.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n header_payload.clone(),\n )\n .await?;\n }\n\n let payment_intent_status = payment_data.get_payment_intent().status;\n\n payment_data\n .get_payment_attempt()\n .payment_token\n .as_ref()\n .zip(payment_data.get_payment_attempt().payment_method)\n .map(ParentPaymentMethodToken::create_key_for_token)\n .async_map(|key_for_hyperswitch_token| async move {\n if key_for_hyperswitch_token\n .should_delete_payment_method_token(payment_intent_status)\n {\n let _ = key_for_hyperswitch_token.delete(state).await;\n }\n })\n .await;\n } else {\n (_, payment_data) = operation\n .to_update_tracker()?\n .update_trackers(\n state,\n req_state,\n payment_data.clone(),\n customer.clone(),\n validate_result.storage_scheme,\n None,\n &key_store,\n None,\n header_payload.clone(),\n )\n .await?;\n }\n\n let cloned_payment_data = payment_data.clone();\n let cloned_customer = customer.clone();\n\n #[cfg(feature = \"v1\")]\n operation\n .to_domain()?\n .store_extended_card_info_temporarily(\n state,\n payment_data.get_payment_intent().get_id(),\n &business_profile,\n payment_data.get_payment_method_data(),\n )\n .await?;\n\n utils::trigger_payments_webhook(\n merchant_account,\n business_profile,\n &key_store,\n cloned_payment_data,\n cloned_customer,\n state,\n operation,\n )\n .await\n .map_err(|error| logger::warn!(payments_outgoing_webhook_error=?error))\n .ok();\n\n Ok((\n payment_data,\n req,\n customer,\n connector_http_status_code,\n external_latency,\n ))\n}",
|
| 51 |
+
"diff_span": {
|
| 52 |
+
"before": " .await?\n {\n let authentication_product_ids = business_profile\n .authentication_product_ids\n .clone()\n .ok_or(errors::ApiErrorResponse::PreconditionFailed {\n message: \"authentication_product_ids is not configured in business profile\"\n .to_string(),\n })?;\n operation\n .to_domain()?\n .call_unified_authentication_service_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n &authentication_product_ids,\n )\n .await?;",
|
| 53 |
+
"after": ""
|
| 54 |
+
},
|
| 55 |
+
"commit_sha": "2e791d5289a5eaf011722af0413bc64967acca19"
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"id": "crates/router/src/core/payments/helpers.rs::function::is_merchant_eligible_authenthention_service",
|
| 59 |
+
"file": "crates/router/src/core/payments/helpers.rs",
|
| 60 |
+
"kind": "function_item",
|
| 61 |
+
"status": "modified",
|
| 62 |
+
"code_changed": true,
|
| 63 |
+
"imports_changed": true,
|
| 64 |
+
"before_code": "pub async fn is_merchant_eligible_authenthention_service(\n merchant_id: &id_type::MerchantId,\n state: &SessionState,\n) -> RouterResult<bool> {\n let merchants_eligible_for_authentication_service = state\n .store\n .as_ref()\n .find_config_by_key(consts::AUTHENTICATION_SERVICE_ELIGIBLE_CONFIG)\n .await\n .to_not_found_response(errors::ApiErrorResponse::ConfigNotFound)?;\n\n let auth_eligible_array: Vec<String> =\n serde_json::from_str(&merchants_eligible_for_authentication_service.config)\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"unable to parse authentication service config\")?;\n\n Ok(auth_eligible_array.contains(&merchant_id.get_string_repr().to_owned()))\n}",
|
| 65 |
+
"after_code": "pub async fn is_merchant_eligible_authenthention_service(\n merchant_id: &id_type::MerchantId,\n state: &SessionState,\n) -> RouterResult<bool> {\n let merchants_eligible_for_authentication_service = state\n .store\n .as_ref()\n .find_config_by_key_unwrap_or(\n consts::AUTHENTICATION_SERVICE_ELIGIBLE_CONFIG,\n Some(\"[]\".to_string()),\n )\n .await;\n\n let auth_eligible_array: Vec<String> = match merchants_eligible_for_authentication_service {\n Ok(config) => serde_json::from_str(&config.config)\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"unable to parse authentication service config\")?,\n Err(err) => {\n if !err.current_context().is_db_not_found() {\n logger::error!(\n \"Error fetching authentication service enabled merchant config {:?}\",\n err\n );\n }\n Vec::new()\n }\n };\n\n Ok(auth_eligible_array.contains(&merchant_id.get_string_repr().to_owned()))\n}",
|
| 66 |
+
"diff_span": {
|
| 67 |
+
"before": " .store\n .as_ref()\n .find_config_by_key(consts::AUTHENTICATION_SERVICE_ELIGIBLE_CONFIG)\n .await\n .to_not_found_response(errors::ApiErrorResponse::ConfigNotFound)?;\n\n let auth_eligible_array: Vec<String> =\n serde_json::from_str(&merchants_eligible_for_authentication_service.config)\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"unable to parse authentication service config\")?;\n\n Ok(auth_eligible_array.contains(&merchant_id.get_string_repr().to_owned()))",
|
| 68 |
+
"after": " .store\n .as_ref()\n .find_config_by_key_unwrap_or(\n consts::AUTHENTICATION_SERVICE_ELIGIBLE_CONFIG,\n Some(\"[]\".to_string()),\n )\n .await;\n\n let auth_eligible_array: Vec<String> = match merchants_eligible_for_authentication_service {\n Ok(config) => serde_json::from_str(&config.config)\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"unable to parse authentication service config\")?,\n Err(err) => {\n if !err.current_context().is_db_not_found() {\n logger::error!(\n \"Error fetching authentication service enabled merchant config {:?}\",\n err\n );\n }\n Vec::new()\n }\n };\n\n Ok(auth_eligible_array.contains(&merchant_id.get_string_repr().to_owned()))"
|
| 69 |
+
},
|
| 70 |
+
"commit_sha": "2e791d5289a5eaf011722af0413bc64967acca19",
|
| 71 |
+
"before_imports": [
|
| 72 |
+
"use openssl::{\n derive::Deriver,\n pkey::PKey,\n symm::{decrypt_aead, Cipher},\n};",
|
| 73 |
+
"use api_models::{\n mandates::RecurringDetails,\n payments::{additional_info as payment_additional_types, RequestSurchargeDetails},\n};",
|
| 74 |
+
"use super::{\n operations::{BoxedOperation, Operation, PaymentResponse},\n CustomerDetails, PaymentData,\n};",
|
| 75 |
+
"use crate::{\n configs::settings::{ConnectorRequestReferenceIdConfig, TempLockerEnableConfig},\n connector,\n consts::{self, BASE64_ENGINE},\n core::{\n authentication,\n errors::{self, CustomResult, RouterResult, StorageErrorExt},\n mandate::helpers::MandateGenericData,\n payment_methods::{\n self,\n cards::{self},\n network_tokenization, vault,\n },\n payments,\n pm_auth::retrieve_payment_method_from_auth_service,\n },\n db::StorageInterface,\n routes::{metrics, payment_methods as payment_methods_handler, SessionState},\n services,\n types::{\n api::{self, admin, enums as api_enums, MandateValidationFieldsExt},\n domain::{self, types},\n storage::{self, enums as storage_enums, ephemeral_key, CardTokenData},\n transformers::{ForeignFrom, ForeignTryFrom},\n AdditionalMerchantData, AdditionalPaymentMethodConnectorResponse, ErrorResponse,\n MandateReference, MerchantAccountData, MerchantRecipientData, PaymentsResponseData,\n RecipientIdType, RecurringMandatePaymentData, RouterData,\n },\n utils::{\n self,\n crypto::{self, SignMessage},\n OptionExt, StringExt,\n },\n};",
|
| 76 |
+
"use common_utils::{\n crypto::Encryptable,\n ext_traits::{AsyncExt, ByteSliceExt, Encode, ValueExt},\n fp_utils, generate_id,\n id_type::{self},\n new_type::{MaskedIban, MaskedSortCode},\n pii, type_name,\n types::{\n keymanager::{Identifier, KeyManagerState, ToEncryptable},\n MinorUnit,\n },\n};"
|
| 77 |
+
],
|
| 78 |
+
"after_imports": [
|
| 79 |
+
"use openssl::{\n derive::Deriver,\n pkey::PKey,\n symm::{decrypt_aead, Cipher},\n};",
|
| 80 |
+
"use api_models::{\n mandates::RecurringDetails,\n payments::{additional_info as payment_additional_types, RequestSurchargeDetails},\n};",
|
| 81 |
+
"use super::{\n operations::{BoxedOperation, Operation, PaymentResponse},\n CustomerDetails, PaymentData,\n};",
|
| 82 |
+
"use router_env::{instrument, logger, tracing};",
|
| 83 |
+
"use crate::{\n configs::settings::{ConnectorRequestReferenceIdConfig, TempLockerEnableConfig},\n connector,\n consts::{self, BASE64_ENGINE},\n core::{\n authentication,\n errors::{self, CustomResult, RouterResult, StorageErrorExt},\n mandate::helpers::MandateGenericData,\n payment_methods::{\n self,\n cards::{self},\n network_tokenization, vault,\n },\n payments,\n pm_auth::retrieve_payment_method_from_auth_service,\n },\n db::StorageInterface,\n routes::{metrics, payment_methods as payment_methods_handler, SessionState},\n services,\n types::{\n api::{self, admin, enums as api_enums, MandateValidationFieldsExt},\n domain::{self, types},\n storage::{self, enums as storage_enums, ephemeral_key, CardTokenData},\n transformers::{ForeignFrom, ForeignTryFrom},\n AdditionalMerchantData, AdditionalPaymentMethodConnectorResponse, ErrorResponse,\n MandateReference, MerchantAccountData, MerchantRecipientData, PaymentsResponseData,\n RecipientIdType, RecurringMandatePaymentData, RouterData,\n },\n utils::{\n self,\n crypto::{self, SignMessage},\n OptionExt, StringExt,\n },\n};",
|
| 84 |
+
"use common_utils::{\n crypto::Encryptable,\n ext_traits::{AsyncExt, ByteSliceExt, Encode, ValueExt},\n fp_utils, generate_id,\n id_type::{self},\n new_type::{MaskedIban, MaskedSortCode},\n pii, type_name,\n types::{\n keymanager::{Identifier, KeyManagerState, ToEncryptable},\n MinorUnit,\n },\n};"
|
| 85 |
+
]
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"id": "crates/router/src/core/payments/operations/payment_confirm.rs::PaymentConfirm::function::call_unified_authentication_service_if_eligible",
|
| 89 |
+
"file": "crates/router/src/core/payments/operations/payment_confirm.rs",
|
| 90 |
+
"kind": "function_item",
|
| 91 |
+
"status": "modified",
|
| 92 |
+
"code_changed": true,
|
| 93 |
+
"imports_changed": false,
|
| 94 |
+
"before_code": "async fn call_unified_authentication_service_if_eligible<'a>(\n &'a self,\n state: &SessionState,\n payment_data: &mut PaymentData<F>,\n _should_continue_confirm_transaction: &mut bool,\n _connector_call_type: &ConnectorCallType,\n business_profile: &domain::Profile,\n key_store: &domain::MerchantKeyStore,\n authentication_product_ids: &common_types::payments::AuthenticationConnectorAccountMap,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n if let Some(payment_method) = payment_data.payment_attempt.payment_method {\n if payment_method == storage_enums::PaymentMethod::Card\n && business_profile.is_click_to_pay_enabled\n {\n let click_to_pay_mca_id = authentication_product_ids\n .get_click_to_pay_connector_account_id()\n .change_context(errors::ApiErrorResponse::MissingRequiredField {\n field_name: \"authentication_product_ids\",\n })?;\n\n let key_manager_state = &(state).into();\n let merchant_id = &business_profile.merchant_id;\n\n let connector_mca = state\n .store\n .find_by_merchant_connector_account_merchant_id_merchant_connector_id(\n key_manager_state,\n merchant_id,\n &click_to_pay_mca_id,\n key_store,\n )\n .await\n .to_not_found_response(\n errors::ApiErrorResponse::MerchantConnectorAccountNotFound {\n id: click_to_pay_mca_id.get_string_repr().to_string(),\n },\n )?;\n\n let authentication_id =\n common_utils::generate_id_with_default_len(consts::AUTHENTICATION_ID_PREFIX);\n\n let payment_method = payment_data.payment_attempt.payment_method.ok_or(\n errors::ApiErrorResponse::MissingRequiredField {\n field_name: \"payment_method\",\n },\n )?;\n\n ClickToPay::pre_authentication(\n state,\n key_store,\n business_profile,\n payment_data,\n &connector_mca,\n &connector_mca.connector_name,\n &authentication_id,\n payment_method,\n )\n .await?;\n\n payment_data.payment_attempt.authentication_id = Some(authentication_id.clone());\n\n let response = ClickToPay::post_authentication(\n state,\n key_store,\n business_profile,\n payment_data,\n &connector_mca,\n &connector_mca.connector_name,\n payment_method,\n )\n .await?;\n\n let (network_token, authentication_status) = match response.response.clone() {\n Ok(unified_authentication_service::UasAuthenticationResponseData::PostAuthentication {\n authentication_details,\n }) => {\n (Some(\n hyperswitch_domain_models::payment_method_data::NetworkTokenData {\n token_number: authentication_details.token_details.payment_token,\n token_exp_month: authentication_details\n .token_details\n .token_expiration_month,\n token_exp_year: authentication_details\n .token_details\n .token_expiration_year,\n token_cryptogram: authentication_details\n .dynamic_data_details\n .and_then(|data| data.dynamic_data_value),\n card_issuer: None,\n card_network: None,\n card_type: None,\n card_issuing_country: None,\n bank_code: None,\n nick_name: None,\n eci: authentication_details.eci,\n }),common_enums::AuthenticationStatus::Success)\n },\n Ok(unified_authentication_service::UasAuthenticationResponseData::PreAuthentication {}) => (None, common_enums::AuthenticationStatus::Started),\n Err(_) => (None, common_enums::AuthenticationStatus::Failed)\n };\n\n payment_data.payment_attempt.payment_method =\n Some(common_enums::PaymentMethod::Card);\n\n payment_data.payment_method_data = network_token\n .clone()\n .map(domain::PaymentMethodData::NetworkToken);\n\n uas_utils::create_new_authentication(\n state,\n payment_data.payment_attempt.merchant_id.clone(),\n connector_mca.connector_name.to_string(),\n business_profile.get_id().clone(),\n Some(payment_data.payment_intent.get_id().clone()),\n click_to_pay_mca_id.to_owned(),\n &authentication_id,\n payment_data.service_details.clone(),\n authentication_status,\n )\n .await?;\n }\n }\n logger::info!(\"skipping unified authentication service call since payment conditions {:?}, {:?} are not satisfied\", payment_data.payment_attempt.payment_method, business_profile.is_click_to_pay_enabled);\n Ok(())\n }",
|
| 95 |
+
"after_code": "async fn call_unified_authentication_service_if_eligible<'a>(\n &'a self,\n state: &SessionState,\n payment_data: &mut PaymentData<F>,\n _should_continue_confirm_transaction: &mut bool,\n _connector_call_type: &ConnectorCallType,\n business_profile: &domain::Profile,\n key_store: &domain::MerchantKeyStore,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n let authentication_product_ids = business_profile\n .authentication_product_ids\n .clone()\n .ok_or(errors::ApiErrorResponse::PreconditionFailed {\n message: \"authentication_product_ids is not configured in business profile\"\n .to_string(),\n })?;\n\n if let Some(payment_method) = payment_data.payment_attempt.payment_method {\n if payment_method == storage_enums::PaymentMethod::Card\n && business_profile.is_click_to_pay_enabled\n {\n let click_to_pay_mca_id = authentication_product_ids\n .get_click_to_pay_connector_account_id()\n .change_context(errors::ApiErrorResponse::MissingRequiredField {\n field_name: \"authentication_product_ids\",\n })?;\n\n let key_manager_state = &(state).into();\n let merchant_id = &business_profile.merchant_id;\n\n let connector_mca = state\n .store\n .find_by_merchant_connector_account_merchant_id_merchant_connector_id(\n key_manager_state,\n merchant_id,\n &click_to_pay_mca_id,\n key_store,\n )\n .await\n .to_not_found_response(\n errors::ApiErrorResponse::MerchantConnectorAccountNotFound {\n id: click_to_pay_mca_id.get_string_repr().to_string(),\n },\n )?;\n\n let authentication_id =\n common_utils::generate_id_with_default_len(consts::AUTHENTICATION_ID_PREFIX);\n\n let payment_method = payment_data.payment_attempt.payment_method.ok_or(\n errors::ApiErrorResponse::MissingRequiredField {\n field_name: \"payment_method\",\n },\n )?;\n\n ClickToPay::pre_authentication(\n state,\n key_store,\n business_profile,\n payment_data,\n &connector_mca,\n &connector_mca.connector_name,\n &authentication_id,\n payment_method,\n )\n .await?;\n\n payment_data.payment_attempt.authentication_id = Some(authentication_id.clone());\n\n let response = ClickToPay::post_authentication(\n state,\n key_store,\n business_profile,\n payment_data,\n &connector_mca,\n &connector_mca.connector_name,\n payment_method,\n )\n .await?;\n\n let (network_token, authentication_status) = match response.response.clone() {\n Ok(unified_authentication_service::UasAuthenticationResponseData::PostAuthentication {\n authentication_details,\n }) => {\n (Some(\n hyperswitch_domain_models::payment_method_data::NetworkTokenData {\n token_number: authentication_details.token_details.payment_token,\n token_exp_month: authentication_details\n .token_details\n .token_expiration_month,\n token_exp_year: authentication_details\n .token_details\n .token_expiration_year,\n token_cryptogram: authentication_details\n .dynamic_data_details\n .and_then(|data| data.dynamic_data_value),\n card_issuer: None,\n card_network: None,\n card_type: None,\n card_issuing_country: None,\n bank_code: None,\n nick_name: None,\n eci: authentication_details.eci,\n }),common_enums::AuthenticationStatus::Success)\n },\n Ok(unified_authentication_service::UasAuthenticationResponseData::PreAuthentication {}) => (None, common_enums::AuthenticationStatus::Started),\n Err(_) => (None, common_enums::AuthenticationStatus::Failed)\n };\n\n payment_data.payment_attempt.payment_method =\n Some(common_enums::PaymentMethod::Card);\n\n payment_data.payment_method_data = network_token\n .clone()\n .map(domain::PaymentMethodData::NetworkToken);\n\n uas_utils::create_new_authentication(\n state,\n payment_data.payment_attempt.merchant_id.clone(),\n connector_mca.connector_name.to_string(),\n business_profile.get_id().clone(),\n Some(payment_data.payment_intent.get_id().clone()),\n click_to_pay_mca_id.to_owned(),\n &authentication_id,\n payment_data.service_details.clone(),\n authentication_status,\n )\n .await?;\n }\n }\n logger::info!(\"skipping unified authentication service call since payment conditions {:?}, {:?} are not satisfied\", payment_data.payment_attempt.payment_method, business_profile.is_click_to_pay_enabled);\n Ok(())\n }",
|
| 96 |
+
"diff_span": {
|
| 97 |
+
"before": " business_profile: &domain::Profile,\n key_store: &domain::MerchantKeyStore,\n authentication_product_ids: &common_types::payments::AuthenticationConnectorAccountMap,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n if let Some(payment_method) = payment_data.payment_attempt.payment_method {",
|
| 98 |
+
"after": " key_store: &domain::MerchantKeyStore,\n ) -> CustomResult<(), errors::ApiErrorResponse> {\n let authentication_product_ids = business_profile\n .authentication_product_ids\n .clone()\n .ok_or(errors::ApiErrorResponse::PreconditionFailed {\n message: \"authentication_product_ids is not configured in business profile\"\n .to_string(),\n })?;\n\n if let Some(payment_method) = payment_data.payment_attempt.payment_method {\n if payment_method == storage_enums::PaymentMethod::Card"
|
| 99 |
+
},
|
| 100 |
+
"commit_sha": "2e791d5289a5eaf011722af0413bc64967acca19"
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"id": "crates/common_types/src/payments.rs::AuthenticationConnectorAccountMap::function::get_click_to_pay_connector_account_id",
|
| 104 |
+
"file": "crates/common_types/src/payments.rs",
|
| 105 |
+
"kind": "function_item",
|
| 106 |
+
"status": "modified",
|
| 107 |
+
"code_changed": true,
|
| 108 |
+
"imports_changed": false,
|
| 109 |
+
"before_code": "pub fn get_click_to_pay_connector_account_id(\n &self,\n ) -> Result<common_utils::id_type::MerchantConnectorAccountId, errors::ValidationError> {\n self.inner()\n .get(&enums::AuthenticationProduct::ClickToPay)\n .ok_or(errors::ValidationError::MissingRequiredField {\n field_name: \"authentication_product_id\".to_string(),\n })\n .cloned()\n }",
|
| 110 |
+
"after_code": "pub fn get_click_to_pay_connector_account_id(\n &self,\n ) -> Result<common_utils::id_type::MerchantConnectorAccountId, errors::ValidationError> {\n self.0\n .get(&enums::AuthenticationProduct::ClickToPay)\n .ok_or(errors::ValidationError::MissingRequiredField {\n field_name: \"authentication_product_id.click_to_pay\".to_string(),\n })\n .cloned()\n }",
|
| 111 |
+
"diff_span": {
|
| 112 |
+
"before": " &self,\n ) -> Result<common_utils::id_type::MerchantConnectorAccountId, errors::ValidationError> {\n self.inner()\n .get(&enums::AuthenticationProduct::ClickToPay)\n .ok_or(errors::ValidationError::MissingRequiredField {\n field_name: \"authentication_product_id\".to_string(),\n })\n .cloned()",
|
| 113 |
+
"after": " &self,\n ) -> Result<common_utils::id_type::MerchantConnectorAccountId, errors::ValidationError> {\n self.0\n .get(&enums::AuthenticationProduct::ClickToPay)\n .ok_or(errors::ValidationError::MissingRequiredField {\n field_name: \"authentication_product_id.click_to_pay\".to_string(),\n })\n .cloned()"
|
| 114 |
+
},
|
| 115 |
+
"commit_sha": "2e791d5289a5eaf011722af0413bc64967acca19"
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"id": "crates/common_types/src/payments.rs::impl::AuthenticationConnectorAccountMap",
|
| 119 |
+
"file": "crates/common_types/src/payments.rs",
|
| 120 |
+
"kind": "impl_item",
|
| 121 |
+
"status": "modified",
|
| 122 |
+
"code_changed": true,
|
| 123 |
+
"imports_changed": true,
|
| 124 |
+
"before_code": "impl AuthenticationConnectorAccountMap {\n /// get inner hashmap\n pub fn inner(\n &self,\n ) -> &HashMap<enums::AuthenticationProduct, common_utils::id_type::MerchantConnectorAccountId>\n {\n &self.0\n }\n /// fn to get click to pay connector_account_id\n pub fn get_click_to_pay_connector_account_id(\n &self,\n ) -> Result<common_utils::id_type::MerchantConnectorAccountId, errors::ValidationError> {\n self.inner()\n .get(&enums::AuthenticationProduct::ClickToPay)\n .ok_or(errors::ValidationError::MissingRequiredField {\n field_name: \"authentication_product_id\".to_string(),\n })\n .cloned()\n }\n}",
|
| 125 |
+
"after_code": "impl AuthenticationConnectorAccountMap {\n /// fn to get click to pay connector_account_id\n pub fn get_click_to_pay_connector_account_id(\n &self,\n ) -> Result<common_utils::id_type::MerchantConnectorAccountId, errors::ValidationError> {\n self.0\n .get(&enums::AuthenticationProduct::ClickToPay)\n .ok_or(errors::ValidationError::MissingRequiredField {\n field_name: \"authentication_product_id.click_to_pay\".to_string(),\n })\n .cloned()\n }\n}",
|
| 126 |
+
"diff_span": {
|
| 127 |
+
"before": "impl AuthenticationConnectorAccountMap {\n /// get inner hashmap\n pub fn inner(\n &self,\n ) -> &HashMap<enums::AuthenticationProduct, common_utils::id_type::MerchantConnectorAccountId>\n {\n &self.0\n }\n /// fn to get click to pay connector_account_id\n pub fn get_click_to_pay_connector_account_id(\n &self,\n ) -> Result<common_utils::id_type::MerchantConnectorAccountId, errors::ValidationError> {\n self.inner()\n .get(&enums::AuthenticationProduct::ClickToPay)\n .ok_or(errors::ValidationError::MissingRequiredField {\n field_name: \"authentication_product_id\".to_string(),\n })\n .cloned()",
|
| 128 |
+
"after": " &self,\n ) -> Result<common_utils::id_type::MerchantConnectorAccountId, errors::ValidationError> {\n self.0\n .get(&enums::AuthenticationProduct::ClickToPay)\n .ok_or(errors::ValidationError::MissingRequiredField {\n field_name: \"authentication_product_id.click_to_pay\".to_string(),\n })\n .cloned()"
|
| 129 |
+
},
|
| 130 |
+
"commit_sha": "2e791d5289a5eaf011722af0413bc64967acca19",
|
| 131 |
+
"before_imports": [
|
| 132 |
+
"use common_enums::enums;",
|
| 133 |
+
"use std::collections::HashMap;"
|
| 134 |
+
],
|
| 135 |
+
"after_imports": [
|
| 136 |
+
"use common_enums::enums;"
|
| 137 |
+
]
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"id": "crates/common_types/src/payments.rs::AuthenticationConnectorAccountMap::function::inner",
|
| 141 |
+
"file": "crates/common_types/src/payments.rs",
|
| 142 |
+
"kind": "function_item",
|
| 143 |
+
"status": "removed",
|
| 144 |
+
"before_code": "pub fn inner(\n &self,\n ) -> &HashMap<enums::AuthenticationProduct, common_utils::id_type::MerchantConnectorAccountId>\n {\n &self.0\n }",
|
| 145 |
+
"after_code": null,
|
| 146 |
+
"diff_span": null,
|
| 147 |
+
"commit_sha": "2e791d5289a5eaf011722af0413bc64967acca19"
|
| 148 |
+
}
|
| 149 |
+
]
|
| 150 |
+
}
|
diffs/pr_6859/389ae52/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "389ae521c73dd728d527fba01e08bd44ddc9b799",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/392c044/diff.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "392c044f45744fb6b170f0b8be2f80fe0d262814",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/common_enums/src/enums.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": []
|
| 8 |
+
}
|
diffs/pr_6859/3c2e034/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6859/3cfac70/diff.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "3cfac70e273066165aaa72cfaaed301c815bfded",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/router/src/core/payments/helpers.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": [
|
| 8 |
+
{
|
| 9 |
+
"id": "crates/router/src/core/payments/helpers.rs::function::is_merchant_eligible_authentication_service",
|
| 10 |
+
"file": "crates/router/src/core/payments/helpers.rs",
|
| 11 |
+
"kind": "function_item",
|
| 12 |
+
"status": "modified",
|
| 13 |
+
"code_changed": true,
|
| 14 |
+
"imports_changed": false,
|
| 15 |
+
"before_code": "pub async fn is_merchant_eligible_authentication_service(\n merchant_id: &id_type::MerchantId,\n state: &SessionState,\n) -> RouterResult<bool> {\n let merchants_eligible_for_authentication_service = state\n .store\n .as_ref()\n .find_config_by_key_unwrap_or(\n consts::AUTHENTICATION_SERVICE_ELIGIBLE_CONFIG,\n Some(\"[]\".to_string()),\n )\n .await;\n\n let auth_eligible_array: Vec<String> = match merchants_eligible_for_authentication_service {\n Ok(config) => serde_json::from_str(&config.config)\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"unable to parse authentication service config\")?,\n Err(err) => {\n if !err.current_context().is_db_not_found() {\n logger::error!(\n \"Error fetching authentication service enabled merchant config {:?}\",\n err\n );\n }\n Vec::new()\n }\n };\n\n Ok(auth_eligible_array.contains(&merchant_id.get_string_repr().to_owned()))\n}",
|
| 16 |
+
"after_code": "pub async fn is_merchant_eligible_authentication_service(\n merchant_id: &id_type::MerchantId,\n state: &SessionState,\n) -> RouterResult<bool> {\n let merchants_eligible_for_authentication_service = state\n .store\n .as_ref()\n .find_config_by_key_unwrap_or(\n consts::AUTHENTICATION_SERVICE_ELIGIBLE_CONFIG,\n Some(\"[]\".to_string()),\n )\n .await;\n\n let auth_eligible_array: Vec<String> = match merchants_eligible_for_authentication_service {\n Ok(config) => serde_json::from_str(&config.config)\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"unable to parse authentication service config\")?,\n Err(err) => {\n logger::error!(\n \"Error fetching authentication service enabled merchant config {:?}\",\n err\n );\n Vec::new()\n }\n };\n\n Ok(auth_eligible_array.contains(&merchant_id.get_string_repr().to_owned()))\n}",
|
| 17 |
+
"diff_span": {
|
| 18 |
+
"before": " .attach_printable(\"unable to parse authentication service config\")?,\n Err(err) => {\n if !err.current_context().is_db_not_found() {\n logger::error!(\n \"Error fetching authentication service enabled merchant config {:?}\",\n err\n );\n }\n Vec::new()\n }",
|
| 19 |
+
"after": " .attach_printable(\"unable to parse authentication service config\")?,\n Err(err) => {\n logger::error!(\n \"Error fetching authentication service enabled merchant config {:?}\",\n err\n );\n Vec::new()\n }"
|
| 20 |
+
},
|
| 21 |
+
"commit_sha": "3cfac70e273066165aaa72cfaaed301c815bfded"
|
| 22 |
+
}
|
| 23 |
+
]
|
| 24 |
+
}
|
diffs/pr_6859/4f82382/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "4f82382f08cd133fdf497069f05a8772c845a634",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/5128445/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "5128445e5038534b8c6b10ea4ee7f868b5009e62",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/55029ed/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6859/5b1cd69/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "5b1cd69b172ab41eaceb8bfb4a38df4af3c59bb6",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/5b4178b/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "5b4178b4b6f424e37421b8d8a8085f514b39a6b3",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/5d0d9d1/diff.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "5d0d9d178fd01752c501e41b195e3181d18423f2",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/hyperswitch_domain_models/src/merchant_connector_account.rs",
|
| 6 |
+
"crates/router/src/core/unified_authentication_service/utils.rs"
|
| 7 |
+
],
|
| 8 |
+
"diffs": [
|
| 9 |
+
{
|
| 10 |
+
"id": "crates/router/src/core/unified_authentication_service/utils.rs::function::construct_uas_router_data",
|
| 11 |
+
"file": "crates/router/src/core/unified_authentication_service/utils.rs",
|
| 12 |
+
"kind": "function_item",
|
| 13 |
+
"status": "modified",
|
| 14 |
+
"code_changed": true,
|
| 15 |
+
"imports_changed": false,
|
| 16 |
+
"before_code": "pub fn construct_uas_router_data<F: Clone, Req, Res>(\n authentication_connector_name: String,\n payment_method: PaymentMethod,\n merchant_id: common_utils::id_type::MerchantId,\n address: Option<PaymentAddress>,\n request_data: Req,\n merchant_connector_account: &MerchantConnectorAccount,\n authentication_id: Option<String>,\n) -> RouterResult<RouterData<F, Req, Res>> {\n let test_mode: Option<bool> = merchant_connector_account.test_mode;\n let auth_type: ConnectorAuthType = merchant_connector_account\n .get_connector_account_details()\n .parse_value(\"ConnectorAuthType\")\n .change_context(ApiErrorResponse::InternalServerError)?;\n Ok(RouterData {\n flow: PhantomData,\n merchant_id,\n customer_id: None,\n connector_customer: None,\n connector: authentication_connector_name,\n payment_id: common_utils::id_type::PaymentId::get_irrelevant_id(\"authentication\")\n .get_string_repr()\n .to_owned(),\n attempt_id: IRRELEVANT_ATTEMPT_ID_IN_AUTHENTICATION_FLOW.to_owned(),\n status: common_enums::AttemptStatus::default(),\n payment_method,\n connector_auth_type: auth_type,\n description: None,\n return_url: None,\n address: address.unwrap_or_default(),\n auth_type: common_enums::AuthenticationType::default(),\n connector_meta_data: merchant_connector_account.metadata.clone(),\n connector_wallets_details: merchant_connector_account.get_connector_wallets_details(),\n amount_captured: None,\n minor_amount_captured: None,\n access_token: None,\n session_token: None,\n reference_id: None,\n payment_method_token: None,\n recurring_mandate_payment_data: None,\n preprocessing_id: None,\n payment_method_balance: None,\n connector_api_version: None,\n request: request_data,\n response: Err(ErrorResponse::default()),\n connector_request_reference_id:\n IRRELEVANT_CONNECTOR_REQUEST_REFERENCE_ID_IN_AUTHENTICATION_FLOW.to_owned(),\n #[cfg(feature = \"payouts\")]\n payout_method_data: None,\n #[cfg(feature = \"payouts\")]\n quote_id: None,\n test_mode,\n connector_http_status_code: None,\n external_latency: None,\n apple_pay_flow: None,\n frm_metadata: None,\n dispute_id: None,\n refund_id: None,\n payment_method_status: None,\n connector_response: None,\n integrity_check: Ok(()),\n additional_merchant_data: None,\n header_payload: None,\n connector_mandate_request_reference_id: None,\n authentication_id,\n psd2_sca_exemption_type: None,\n })\n}",
|
| 17 |
+
"after_code": "pub fn construct_uas_router_data<F: Clone, Req, Res>(\n authentication_connector_name: String,\n payment_method: PaymentMethod,\n merchant_id: common_utils::id_type::MerchantId,\n address: Option<PaymentAddress>,\n request_data: Req,\n merchant_connector_account: &MerchantConnectorAccount,\n authentication_id: Option<String>,\n) -> RouterResult<RouterData<F, Req, Res>> {\n let auth_type: ConnectorAuthType = merchant_connector_account\n .get_connector_account_details()\n .parse_value(\"ConnectorAuthType\")\n .change_context(ApiErrorResponse::InternalServerError)?;\n Ok(RouterData {\n flow: PhantomData,\n merchant_id,\n customer_id: None,\n connector_customer: None,\n connector: authentication_connector_name,\n payment_id: common_utils::id_type::PaymentId::get_irrelevant_id(\"authentication\")\n .get_string_repr()\n .to_owned(),\n attempt_id: IRRELEVANT_ATTEMPT_ID_IN_AUTHENTICATION_FLOW.to_owned(),\n status: common_enums::AttemptStatus::default(),\n payment_method,\n connector_auth_type: auth_type,\n description: None,\n return_url: None,\n address: address.unwrap_or_default(),\n auth_type: common_enums::AuthenticationType::default(),\n connector_meta_data: merchant_connector_account.metadata.clone(),\n connector_wallets_details: merchant_connector_account.get_connector_wallets_details(),\n amount_captured: None,\n minor_amount_captured: None,\n access_token: None,\n session_token: None,\n reference_id: None,\n payment_method_token: None,\n recurring_mandate_payment_data: None,\n preprocessing_id: None,\n payment_method_balance: None,\n connector_api_version: None,\n request: request_data,\n response: Err(ErrorResponse::default()),\n connector_request_reference_id:\n IRRELEVANT_CONNECTOR_REQUEST_REFERENCE_ID_IN_AUTHENTICATION_FLOW.to_owned(),\n #[cfg(feature = \"payouts\")]\n payout_method_data: None,\n #[cfg(feature = \"payouts\")]\n quote_id: None,\n test_mode: None,\n connector_http_status_code: None,\n external_latency: None,\n apple_pay_flow: None,\n frm_metadata: None,\n dispute_id: None,\n refund_id: None,\n payment_method_status: None,\n connector_response: None,\n integrity_check: Ok(()),\n additional_merchant_data: None,\n header_payload: None,\n connector_mandate_request_reference_id: None,\n authentication_id,\n psd2_sca_exemption_type: None,\n })\n}",
|
| 18 |
+
"diff_span": {
|
| 19 |
+
"before": " authentication_id: Option<String>,\n) -> RouterResult<RouterData<F, Req, Res>> {\n let test_mode: Option<bool> = merchant_connector_account.test_mode;\n let auth_type: ConnectorAuthType = merchant_connector_account\n .get_connector_account_details()\n .parse_value(\"ConnectorAuthType\")\n .change_context(ApiErrorResponse::InternalServerError)?;\n Ok(RouterData {\n flow: PhantomData,\n merchant_id,\n customer_id: None,\n connector_customer: None,\n connector: authentication_connector_name,\n payment_id: common_utils::id_type::PaymentId::get_irrelevant_id(\"authentication\")\n .get_string_repr()\n .to_owned(),\n attempt_id: IRRELEVANT_ATTEMPT_ID_IN_AUTHENTICATION_FLOW.to_owned(),\n status: common_enums::AttemptStatus::default(),\n payment_method,\n connector_auth_type: auth_type,\n description: None,\n return_url: None,\n address: address.unwrap_or_default(),\n auth_type: common_enums::AuthenticationType::default(),\n connector_meta_data: merchant_connector_account.metadata.clone(),\n connector_wallets_details: merchant_connector_account.get_connector_wallets_details(),\n amount_captured: None,\n minor_amount_captured: None,\n access_token: None,\n session_token: None,\n reference_id: None,\n payment_method_token: None,\n recurring_mandate_payment_data: None,\n preprocessing_id: None,\n payment_method_balance: None,\n connector_api_version: None,\n request: request_data,\n response: Err(ErrorResponse::default()),\n connector_request_reference_id:\n IRRELEVANT_CONNECTOR_REQUEST_REFERENCE_ID_IN_AUTHENTICATION_FLOW.to_owned(),\n #[cfg(feature = \"payouts\")]\n payout_method_data: None,\n #[cfg(feature = \"payouts\")]\n quote_id: None,\n test_mode,\n connector_http_status_code: None,\n external_latency: None,",
|
| 20 |
+
"after": " #[cfg(feature = \"payouts\")]\n quote_id: None,\n test_mode: None,\n connector_http_status_code: None,\n external_latency: None,"
|
| 21 |
+
},
|
| 22 |
+
"commit_sha": "5d0d9d178fd01752c501e41b195e3181d18423f2"
|
| 23 |
+
}
|
| 24 |
+
]
|
| 25 |
+
}
|
diffs/pr_6859/5f694cf/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6859/60a60e1/diff.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "60a60e1d916e45a8acdd8c55345c7a51d4d0f504",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": []
|
| 8 |
+
}
|
diffs/pr_6859/6e4bc87/diff.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "6e4bc873d876cc83b2760a388ad62f854eb869ed",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/hyperswitch_domain_models/src/merchant_connector_account.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": []
|
| 8 |
+
}
|
diffs/pr_6859/98b5af4/diff.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "98b5af4ea8c7c5b79a37b61a88eae1463397e6ff",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [
|
| 5 |
+
"crates/router/src/core/payments.rs"
|
| 6 |
+
],
|
| 7 |
+
"diffs": [
|
| 8 |
+
{
|
| 9 |
+
"id": "crates/router/src/core/payments.rs::function::payments_operation_core",
|
| 10 |
+
"file": "crates/router/src/core/payments.rs",
|
| 11 |
+
"kind": "function_item",
|
| 12 |
+
"status": "modified",
|
| 13 |
+
"code_changed": true,
|
| 14 |
+
"imports_changed": false,
|
| 15 |
+
"before_code": "pub async fn payments_operation_core<F, Req, Op, FData, D>(\n state: &SessionState,\n req_state: ReqState,\n merchant_account: domain::MerchantAccount,\n profile_id_from_auth_layer: Option<id_type::ProfileId>,\n key_store: domain::MerchantKeyStore,\n operation: Op,\n req: Req,\n call_connector_action: CallConnectorAction,\n auth_flow: services::AuthFlow,\n eligible_connectors: Option<Vec<common_enums::RoutableConnectors>>,\n header_payload: HeaderPayload,\n) -> RouterResult<(D, Req, Option<domain::Customer>, Option<u16>, Option<u128>)>\nwhere\n F: Send + Clone + Sync,\n Req: Authenticate + Clone,\n Op: Operation<F, Req, Data = D> + Send + Sync,\n D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone,\n\n // To create connector flow specific interface data\n D: ConstructFlowSpecificData<F, FData, router_types::PaymentsResponseData>,\n RouterData<F, FData, router_types::PaymentsResponseData>: Feature<F, FData>,\n\n // To construct connector flow specific api\n dyn api::Connector:\n services::api::ConnectorIntegration<F, FData, router_types::PaymentsResponseData>,\n\n // To perform router related operation for PaymentResponse\n PaymentResponse: Operation<F, FData, Data = D>,\n FData: Send + Sync + Clone,\n{\n let operation: BoxedOperation<'_, F, Req, D> = Box::new(operation);\n\n tracing::Span::current().record(\"merchant_id\", merchant_account.get_id().get_string_repr());\n let (operation, validate_result) = operation\n .to_validate_request()?\n .validate_request(&req, &merchant_account)?;\n\n tracing::Span::current().record(\"payment_id\", format!(\"{}\", validate_result.payment_id));\n // get profile from headers\n let operations::GetTrackerResponse {\n operation,\n customer_details,\n mut payment_data,\n business_profile,\n mandate_type,\n } = operation\n .to_get_tracker()?\n .get_trackers(\n state,\n &validate_result.payment_id,\n &req,\n &merchant_account,\n &key_store,\n auth_flow,\n &header_payload,\n )\n .await?;\n core_utils::validate_profile_id_from_auth_layer(\n profile_id_from_auth_layer,\n &payment_data.get_payment_intent().clone(),\n )?;\n\n let (operation, customer) = operation\n .to_domain()?\n // get_customer_details\n .get_or_create_customer_details(\n state,\n &mut payment_data,\n customer_details,\n &key_store,\n merchant_account.storage_scheme,\n )\n .await\n .to_not_found_response(errors::ApiErrorResponse::CustomerNotFound)\n .attach_printable(\"Failed while fetching/creating customer\")?;\n\n let authentication_type =\n call_decision_manager(state, &merchant_account, &business_profile, &payment_data).await?;\n\n payment_data.set_authentication_type_in_attempt(authentication_type);\n\n let connector = get_connector_choice(\n &operation,\n state,\n &req,\n &merchant_account,\n &business_profile,\n &key_store,\n &mut payment_data,\n eligible_connectors,\n mandate_type,\n )\n .await?;\n\n let should_add_task_to_process_tracker = should_add_task_to_process_tracker(&payment_data);\n\n let locale = header_payload.locale.clone();\n\n payment_data = tokenize_in_router_when_confirm_false_or_external_authentication(\n state,\n &operation,\n &mut payment_data,\n &validate_result,\n &key_store,\n &customer,\n &business_profile,\n )\n .await?;\n\n let mut connector_http_status_code = None;\n let mut external_latency = None;\n if let Some(connector_details) = connector {\n // Fetch and check FRM configs\n #[cfg(feature = \"frm\")]\n let mut frm_info = None;\n #[allow(unused_variables, unused_mut)]\n let mut should_continue_transaction: bool = true;\n #[cfg(feature = \"frm\")]\n let mut should_continue_capture: bool = true;\n #[cfg(feature = \"frm\")]\n let frm_configs = if state.conf.frm.enabled {\n Box::pin(frm_core::call_frm_before_connector_call(\n &operation,\n &merchant_account,\n &mut payment_data,\n state,\n &mut frm_info,\n &customer,\n &mut should_continue_transaction,\n &mut should_continue_capture,\n key_store.clone(),\n ))\n .await?\n } else {\n None\n };\n #[cfg(feature = \"frm\")]\n logger::debug!(\n \"frm_configs: {:?}\\nshould_continue_transaction: {:?}\\nshould_continue_capture: {:?}\",\n frm_configs,\n should_continue_transaction,\n should_continue_capture,\n );\n\n operation\n .to_domain()?\n .call_external_three_ds_authentication_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n mandate_type,\n )\n .await?;\n\n let merchants_eligible_for_authentication_service = state\n .store\n .as_ref()\n .find_config_by_key(crate::consts::AUTHENTICATION_SERVICE_ELIGIBLE_CONFIG)\n .await\n .to_not_found_response(errors::ApiErrorResponse::ConfigNotFound)?;\n let auth_eligible_array: Vec<String> =\n serde_json::from_str(&merchants_eligible_for_authentication_service.config)\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"unable to parse authentication service config\")?;\n let merchant_id = merchant_account.get_id();\n\n if auth_eligible_array.contains(&merchant_id.get_string_repr().to_owned()) {\n let authentication_product_ids = business_profile\n .authentication_product_ids\n .clone()\n .ok_or(errors::ApiErrorResponse::PreconditionFailed {\n message: \"authentication_product_ids is not configured in business profile\"\n .to_string(),\n })?;\n operation\n .to_domain()?\n .call_unified_authentication_service_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n &authentication_product_ids,\n )\n .await?;\n } else {\n logger::info!(\n \"skipping authentication service call since the merchant is not eligible.\"\n )\n };\n\n operation\n .to_domain()?\n .payments_dynamic_tax_calculation(\n state,\n &mut payment_data,\n &connector_details,\n &business_profile,\n &key_store,\n &merchant_account,\n )\n .await?;\n\n if should_continue_transaction {\n #[cfg(feature = \"frm\")]\n match (\n should_continue_capture,\n payment_data.get_payment_attempt().capture_method,\n ) {\n (\n false,\n Some(storage_enums::CaptureMethod::Automatic)\n | Some(storage_enums::CaptureMethod::SequentialAutomatic),\n )\n | (false, Some(storage_enums::CaptureMethod::Scheduled)) => {\n if let Some(info) = &mut frm_info {\n if let Some(frm_data) = &mut info.frm_data {\n frm_data.fraud_check.payment_capture_method =\n payment_data.get_payment_attempt().capture_method;\n }\n }\n payment_data\n .set_capture_method_in_attempt(storage_enums::CaptureMethod::Manual);\n logger::debug!(\"payment_id : {:?} capture method has been changed to manual, since it has configured Post FRM flow\",payment_data.get_payment_attempt().payment_id);\n }\n _ => (),\n };\n payment_data = match connector_details {\n ConnectorCallType::PreDetermined(connector) => {\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n let routable_connectors =\n convert_connector_data_to_routable_connectors(&[connector.clone()])\n .map_err(|e| logger::error!(routable_connector_error=?e))\n .unwrap_or_default();\n let schedule_time = if should_add_task_to_process_tracker {\n payment_sync::get_sync_process_schedule_time(\n &*state.store,\n connector.connector.id(),\n merchant_account.get_id(),\n 0,\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed while getting process schedule time\")?\n } else {\n None\n };\n let (router_data, mca) = call_connector_service(\n state,\n req_state.clone(),\n &merchant_account,\n &key_store,\n connector.clone(),\n &operation,\n &mut payment_data,\n &customer,\n call_connector_action.clone(),\n &validate_result,\n schedule_time,\n header_payload.clone(),\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n false,\n )\n .await?;\n\n let op_ref = &operation;\n let should_trigger_post_processing_flows = is_operation_confirm(&operation);\n\n let operation = Box::new(PaymentResponse);\n\n connector_http_status_code = router_data.connector_http_status_code;\n external_latency = router_data.external_latency;\n //add connector http status code metrics\n add_connector_http_status_code_metrics(connector_http_status_code);\n\n operation\n .to_post_update_tracker()?\n .save_pm_and_mandate(\n state,\n &router_data,\n &merchant_account,\n &key_store,\n &mut payment_data,\n &business_profile,\n )\n .await?;\n\n let mut payment_data = operation\n .to_post_update_tracker()?\n .update_tracker(\n state,\n payment_data,\n router_data,\n &key_store,\n merchant_account.storage_scheme,\n &locale,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n routable_connectors,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n &business_profile,\n )\n .await?;\n\n if should_trigger_post_processing_flows {\n complete_postprocessing_steps_if_required(\n state,\n &merchant_account,\n &key_store,\n &customer,\n &mca,\n &connector,\n &mut payment_data,\n op_ref,\n Some(header_payload.clone()),\n )\n .await?;\n }\n\n payment_data\n }\n\n ConnectorCallType::Retryable(connectors) => {\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n let routable_connectors =\n convert_connector_data_to_routable_connectors(&connectors)\n .map_err(|e| logger::error!(routable_connector_error=?e))\n .unwrap_or_default();\n\n let mut connectors = connectors.into_iter();\n\n let connector_data = get_connector_data(&mut connectors)?;\n\n let schedule_time = if should_add_task_to_process_tracker {\n payment_sync::get_sync_process_schedule_time(\n &*state.store,\n connector_data.connector.id(),\n merchant_account.get_id(),\n 0,\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed while getting process schedule time\")?\n } else {\n None\n };\n let (router_data, mca) = call_connector_service(\n state,\n req_state.clone(),\n &merchant_account,\n &key_store,\n connector_data.clone(),\n &operation,\n &mut payment_data,\n &customer,\n call_connector_action.clone(),\n &validate_result,\n schedule_time,\n header_payload.clone(),\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n false,\n )\n .await?;\n\n #[cfg(all(feature = \"retry\", feature = \"v1\"))]\n let mut router_data = router_data;\n #[cfg(all(feature = \"retry\", feature = \"v1\"))]\n {\n use crate::core::payments::retry::{self, GsmValidation};\n let config_bool = retry::config_should_call_gsm(\n &*state.store,\n merchant_account.get_id(),\n &business_profile,\n )\n .await;\n\n if config_bool && router_data.should_call_gsm() {\n router_data = retry::do_gsm_actions(\n state,\n req_state.clone(),\n &mut payment_data,\n connectors,\n connector_data.clone(),\n router_data,\n &merchant_account,\n &key_store,\n &operation,\n &customer,\n &validate_result,\n schedule_time,\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n )\n .await?;\n };\n }\n\n let op_ref = &operation;\n let should_trigger_post_processing_flows = is_operation_confirm(&operation);\n\n let operation = Box::new(PaymentResponse);\n connector_http_status_code = router_data.connector_http_status_code;\n external_latency = router_data.external_latency;\n //add connector http status code metrics\n add_connector_http_status_code_metrics(connector_http_status_code);\n\n operation\n .to_post_update_tracker()?\n .save_pm_and_mandate(\n state,\n &router_data,\n &merchant_account,\n &key_store,\n &mut payment_data,\n &business_profile,\n )\n .await?;\n\n let mut payment_data = operation\n .to_post_update_tracker()?\n .update_tracker(\n state,\n payment_data,\n router_data,\n &key_store,\n merchant_account.storage_scheme,\n &locale,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n routable_connectors,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n &business_profile,\n )\n .await?;\n\n if should_trigger_post_processing_flows {\n complete_postprocessing_steps_if_required(\n state,\n &merchant_account,\n &key_store,\n &customer,\n &mca,\n &connector_data,\n &mut payment_data,\n op_ref,\n Some(header_payload.clone()),\n )\n .await?;\n }\n\n payment_data\n }\n\n ConnectorCallType::SessionMultiple(connectors) => {\n let session_surcharge_details =\n call_surcharge_decision_management_for_session_flow(\n state,\n &merchant_account,\n &business_profile,\n payment_data.get_payment_attempt(),\n payment_data.get_payment_intent(),\n payment_data.get_billing_address(),\n &connectors,\n )\n .await?;\n Box::pin(call_multiple_connectors_service(\n state,\n &merchant_account,\n &key_store,\n connectors,\n &operation,\n payment_data,\n &customer,\n session_surcharge_details,\n &business_profile,\n header_payload.clone(),\n ))\n .await?\n }\n };\n\n #[cfg(feature = \"frm\")]\n if let Some(fraud_info) = &mut frm_info {\n #[cfg(feature = \"v1\")]\n Box::pin(frm_core::post_payment_frm_core(\n state,\n req_state,\n &merchant_account,\n &mut payment_data,\n fraud_info,\n frm_configs\n .clone()\n .ok_or(errors::ApiErrorResponse::MissingRequiredField {\n field_name: \"frm_configs\",\n })\n .attach_printable(\"Frm configs label not found\")?,\n &customer,\n key_store.clone(),\n &mut should_continue_capture,\n ))\n .await?;\n }\n } else {\n (_, payment_data) = operation\n .to_update_tracker()?\n .update_trackers(\n state,\n req_state,\n payment_data.clone(),\n customer.clone(),\n validate_result.storage_scheme,\n None,\n &key_store,\n #[cfg(feature = \"frm\")]\n frm_info.and_then(|info| info.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n header_payload.clone(),\n )\n .await?;\n }\n\n let payment_intent_status = payment_data.get_payment_intent().status;\n\n payment_data\n .get_payment_attempt()\n .payment_token\n .as_ref()\n .zip(payment_data.get_payment_attempt().payment_method)\n .map(ParentPaymentMethodToken::create_key_for_token)\n .async_map(|key_for_hyperswitch_token| async move {\n if key_for_hyperswitch_token\n .should_delete_payment_method_token(payment_intent_status)\n {\n let _ = key_for_hyperswitch_token.delete(state).await;\n }\n })\n .await;\n } else {\n (_, payment_data) = operation\n .to_update_tracker()?\n .update_trackers(\n state,\n req_state,\n payment_data.clone(),\n customer.clone(),\n validate_result.storage_scheme,\n None,\n &key_store,\n None,\n header_payload.clone(),\n )\n .await?;\n }\n\n let cloned_payment_data = payment_data.clone();\n let cloned_customer = customer.clone();\n\n #[cfg(feature = \"v1\")]\n operation\n .to_domain()?\n .store_extended_card_info_temporarily(\n state,\n payment_data.get_payment_intent().get_id(),\n &business_profile,\n payment_data.get_payment_method_data(),\n )\n .await?;\n\n utils::trigger_payments_webhook(\n merchant_account,\n business_profile,\n &key_store,\n cloned_payment_data,\n cloned_customer,\n state,\n operation,\n )\n .await\n .map_err(|error| logger::warn!(payments_outgoing_webhook_error=?error))\n .ok();\n\n Ok((\n payment_data,\n req,\n customer,\n connector_http_status_code,\n external_latency,\n ))\n}",
|
| 16 |
+
"after_code": "pub async fn payments_operation_core<F, Req, Op, FData, D>(\n state: &SessionState,\n req_state: ReqState,\n merchant_account: domain::MerchantAccount,\n profile_id_from_auth_layer: Option<id_type::ProfileId>,\n key_store: domain::MerchantKeyStore,\n operation: Op,\n req: Req,\n call_connector_action: CallConnectorAction,\n auth_flow: services::AuthFlow,\n eligible_connectors: Option<Vec<common_enums::RoutableConnectors>>,\n header_payload: HeaderPayload,\n) -> RouterResult<(D, Req, Option<domain::Customer>, Option<u16>, Option<u128>)>\nwhere\n F: Send + Clone + Sync,\n Req: Authenticate + Clone,\n Op: Operation<F, Req, Data = D> + Send + Sync,\n D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone,\n\n // To create connector flow specific interface data\n D: ConstructFlowSpecificData<F, FData, router_types::PaymentsResponseData>,\n RouterData<F, FData, router_types::PaymentsResponseData>: Feature<F, FData>,\n\n // To construct connector flow specific api\n dyn api::Connector:\n services::api::ConnectorIntegration<F, FData, router_types::PaymentsResponseData>,\n\n // To perform router related operation for PaymentResponse\n PaymentResponse: Operation<F, FData, Data = D>,\n FData: Send + Sync + Clone,\n{\n let operation: BoxedOperation<'_, F, Req, D> = Box::new(operation);\n\n tracing::Span::current().record(\"merchant_id\", merchant_account.get_id().get_string_repr());\n let (operation, validate_result) = operation\n .to_validate_request()?\n .validate_request(&req, &merchant_account)?;\n\n tracing::Span::current().record(\"payment_id\", format!(\"{}\", validate_result.payment_id));\n // get profile from headers\n let operations::GetTrackerResponse {\n operation,\n customer_details,\n mut payment_data,\n business_profile,\n mandate_type,\n } = operation\n .to_get_tracker()?\n .get_trackers(\n state,\n &validate_result.payment_id,\n &req,\n &merchant_account,\n &key_store,\n auth_flow,\n &header_payload,\n )\n .await?;\n core_utils::validate_profile_id_from_auth_layer(\n profile_id_from_auth_layer,\n &payment_data.get_payment_intent().clone(),\n )?;\n\n let (operation, customer) = operation\n .to_domain()?\n // get_customer_details\n .get_or_create_customer_details(\n state,\n &mut payment_data,\n customer_details,\n &key_store,\n merchant_account.storage_scheme,\n )\n .await\n .to_not_found_response(errors::ApiErrorResponse::CustomerNotFound)\n .attach_printable(\"Failed while fetching/creating customer\")?;\n\n let authentication_type =\n call_decision_manager(state, &merchant_account, &business_profile, &payment_data).await?;\n\n payment_data.set_authentication_type_in_attempt(authentication_type);\n\n let connector = get_connector_choice(\n &operation,\n state,\n &req,\n &merchant_account,\n &business_profile,\n &key_store,\n &mut payment_data,\n eligible_connectors,\n mandate_type,\n )\n .await?;\n\n let should_add_task_to_process_tracker = should_add_task_to_process_tracker(&payment_data);\n\n let locale = header_payload.locale.clone();\n\n payment_data = tokenize_in_router_when_confirm_false_or_external_authentication(\n state,\n &operation,\n &mut payment_data,\n &validate_result,\n &key_store,\n &customer,\n &business_profile,\n )\n .await?;\n\n let mut connector_http_status_code = None;\n let mut external_latency = None;\n if let Some(connector_details) = connector {\n // Fetch and check FRM configs\n #[cfg(feature = \"frm\")]\n let mut frm_info = None;\n #[allow(unused_variables, unused_mut)]\n let mut should_continue_transaction: bool = true;\n #[cfg(feature = \"frm\")]\n let mut should_continue_capture: bool = true;\n #[cfg(feature = \"frm\")]\n let frm_configs = if state.conf.frm.enabled {\n Box::pin(frm_core::call_frm_before_connector_call(\n &operation,\n &merchant_account,\n &mut payment_data,\n state,\n &mut frm_info,\n &customer,\n &mut should_continue_transaction,\n &mut should_continue_capture,\n key_store.clone(),\n ))\n .await?\n } else {\n None\n };\n #[cfg(feature = \"frm\")]\n logger::debug!(\n \"frm_configs: {:?}\\nshould_continue_transaction: {:?}\\nshould_continue_capture: {:?}\",\n frm_configs,\n should_continue_transaction,\n should_continue_capture,\n );\n\n let merchants_eligible_for_authentication_service = state\n .store\n .as_ref()\n .find_config_by_key(crate::consts::AUTHENTICATION_SERVICE_ELIGIBLE_CONFIG)\n .await\n .to_not_found_response(errors::ApiErrorResponse::ConfigNotFound)?;\n let auth_eligible_array: Vec<String> =\n serde_json::from_str(&merchants_eligible_for_authentication_service.config)\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"unable to parse authentication service config\")?;\n let merchant_id = merchant_account.get_id();\n\n if auth_eligible_array.contains(&merchant_id.get_string_repr().to_owned()) {\n let authentication_product_ids = business_profile\n .authentication_product_ids\n .clone()\n .ok_or(errors::ApiErrorResponse::PreconditionFailed {\n message: \"authentication_product_ids is not configured in business profile\"\n .to_string(),\n })?;\n operation\n .to_domain()?\n .call_unified_authentication_service_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n &authentication_product_ids,\n )\n .await?;\n } else {\n logger::info!(\n \"skipping authentication service call since the merchant is not eligible.\"\n );\n\n operation\n .to_domain()?\n .call_external_three_ds_authentication_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n mandate_type,\n )\n .await?;\n };\n\n operation\n .to_domain()?\n .payments_dynamic_tax_calculation(\n state,\n &mut payment_data,\n &connector_details,\n &business_profile,\n &key_store,\n &merchant_account,\n )\n .await?;\n\n if should_continue_transaction {\n #[cfg(feature = \"frm\")]\n match (\n should_continue_capture,\n payment_data.get_payment_attempt().capture_method,\n ) {\n (\n false,\n Some(storage_enums::CaptureMethod::Automatic)\n | Some(storage_enums::CaptureMethod::SequentialAutomatic),\n )\n | (false, Some(storage_enums::CaptureMethod::Scheduled)) => {\n if let Some(info) = &mut frm_info {\n if let Some(frm_data) = &mut info.frm_data {\n frm_data.fraud_check.payment_capture_method =\n payment_data.get_payment_attempt().capture_method;\n }\n }\n payment_data\n .set_capture_method_in_attempt(storage_enums::CaptureMethod::Manual);\n logger::debug!(\"payment_id : {:?} capture method has been changed to manual, since it has configured Post FRM flow\",payment_data.get_payment_attempt().payment_id);\n }\n _ => (),\n };\n payment_data = match connector_details {\n ConnectorCallType::PreDetermined(connector) => {\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n let routable_connectors =\n convert_connector_data_to_routable_connectors(&[connector.clone()])\n .map_err(|e| logger::error!(routable_connector_error=?e))\n .unwrap_or_default();\n let schedule_time = if should_add_task_to_process_tracker {\n payment_sync::get_sync_process_schedule_time(\n &*state.store,\n connector.connector.id(),\n merchant_account.get_id(),\n 0,\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed while getting process schedule time\")?\n } else {\n None\n };\n let (router_data, mca) = call_connector_service(\n state,\n req_state.clone(),\n &merchant_account,\n &key_store,\n connector.clone(),\n &operation,\n &mut payment_data,\n &customer,\n call_connector_action.clone(),\n &validate_result,\n schedule_time,\n header_payload.clone(),\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n false,\n )\n .await?;\n\n let op_ref = &operation;\n let should_trigger_post_processing_flows = is_operation_confirm(&operation);\n\n let operation = Box::new(PaymentResponse);\n\n connector_http_status_code = router_data.connector_http_status_code;\n external_latency = router_data.external_latency;\n //add connector http status code metrics\n add_connector_http_status_code_metrics(connector_http_status_code);\n\n operation\n .to_post_update_tracker()?\n .save_pm_and_mandate(\n state,\n &router_data,\n &merchant_account,\n &key_store,\n &mut payment_data,\n &business_profile,\n )\n .await?;\n\n let mut payment_data = operation\n .to_post_update_tracker()?\n .update_tracker(\n state,\n payment_data,\n router_data,\n &key_store,\n merchant_account.storage_scheme,\n &locale,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n routable_connectors,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n &business_profile,\n )\n .await?;\n\n if should_trigger_post_processing_flows {\n complete_postprocessing_steps_if_required(\n state,\n &merchant_account,\n &key_store,\n &customer,\n &mca,\n &connector,\n &mut payment_data,\n op_ref,\n Some(header_payload.clone()),\n )\n .await?;\n }\n\n payment_data\n }\n\n ConnectorCallType::Retryable(connectors) => {\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n let routable_connectors =\n convert_connector_data_to_routable_connectors(&connectors)\n .map_err(|e| logger::error!(routable_connector_error=?e))\n .unwrap_or_default();\n\n let mut connectors = connectors.into_iter();\n\n let connector_data = get_connector_data(&mut connectors)?;\n\n let schedule_time = if should_add_task_to_process_tracker {\n payment_sync::get_sync_process_schedule_time(\n &*state.store,\n connector_data.connector.id(),\n merchant_account.get_id(),\n 0,\n )\n .await\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"Failed while getting process schedule time\")?\n } else {\n None\n };\n let (router_data, mca) = call_connector_service(\n state,\n req_state.clone(),\n &merchant_account,\n &key_store,\n connector_data.clone(),\n &operation,\n &mut payment_data,\n &customer,\n call_connector_action.clone(),\n &validate_result,\n schedule_time,\n header_payload.clone(),\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n false,\n )\n .await?;\n\n #[cfg(all(feature = \"retry\", feature = \"v1\"))]\n let mut router_data = router_data;\n #[cfg(all(feature = \"retry\", feature = \"v1\"))]\n {\n use crate::core::payments::retry::{self, GsmValidation};\n let config_bool = retry::config_should_call_gsm(\n &*state.store,\n merchant_account.get_id(),\n &business_profile,\n )\n .await;\n\n if config_bool && router_data.should_call_gsm() {\n router_data = retry::do_gsm_actions(\n state,\n req_state.clone(),\n &mut payment_data,\n connectors,\n connector_data.clone(),\n router_data,\n &merchant_account,\n &key_store,\n &operation,\n &customer,\n &validate_result,\n schedule_time,\n #[cfg(feature = \"frm\")]\n frm_info.as_ref().and_then(|fi| fi.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n &business_profile,\n )\n .await?;\n };\n }\n\n let op_ref = &operation;\n let should_trigger_post_processing_flows = is_operation_confirm(&operation);\n\n let operation = Box::new(PaymentResponse);\n connector_http_status_code = router_data.connector_http_status_code;\n external_latency = router_data.external_latency;\n //add connector http status code metrics\n add_connector_http_status_code_metrics(connector_http_status_code);\n\n operation\n .to_post_update_tracker()?\n .save_pm_and_mandate(\n state,\n &router_data,\n &merchant_account,\n &key_store,\n &mut payment_data,\n &business_profile,\n )\n .await?;\n\n let mut payment_data = operation\n .to_post_update_tracker()?\n .update_tracker(\n state,\n payment_data,\n router_data,\n &key_store,\n merchant_account.storage_scheme,\n &locale,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n routable_connectors,\n #[cfg(all(feature = \"dynamic_routing\", feature = \"v1\"))]\n &business_profile,\n )\n .await?;\n\n if should_trigger_post_processing_flows {\n complete_postprocessing_steps_if_required(\n state,\n &merchant_account,\n &key_store,\n &customer,\n &mca,\n &connector_data,\n &mut payment_data,\n op_ref,\n Some(header_payload.clone()),\n )\n .await?;\n }\n\n payment_data\n }\n\n ConnectorCallType::SessionMultiple(connectors) => {\n let session_surcharge_details =\n call_surcharge_decision_management_for_session_flow(\n state,\n &merchant_account,\n &business_profile,\n payment_data.get_payment_attempt(),\n payment_data.get_payment_intent(),\n payment_data.get_billing_address(),\n &connectors,\n )\n .await?;\n Box::pin(call_multiple_connectors_service(\n state,\n &merchant_account,\n &key_store,\n connectors,\n &operation,\n payment_data,\n &customer,\n session_surcharge_details,\n &business_profile,\n header_payload.clone(),\n ))\n .await?\n }\n };\n\n #[cfg(feature = \"frm\")]\n if let Some(fraud_info) = &mut frm_info {\n #[cfg(feature = \"v1\")]\n Box::pin(frm_core::post_payment_frm_core(\n state,\n req_state,\n &merchant_account,\n &mut payment_data,\n fraud_info,\n frm_configs\n .clone()\n .ok_or(errors::ApiErrorResponse::MissingRequiredField {\n field_name: \"frm_configs\",\n })\n .attach_printable(\"Frm configs label not found\")?,\n &customer,\n key_store.clone(),\n &mut should_continue_capture,\n ))\n .await?;\n }\n } else {\n (_, payment_data) = operation\n .to_update_tracker()?\n .update_trackers(\n state,\n req_state,\n payment_data.clone(),\n customer.clone(),\n validate_result.storage_scheme,\n None,\n &key_store,\n #[cfg(feature = \"frm\")]\n frm_info.and_then(|info| info.suggested_action),\n #[cfg(not(feature = \"frm\"))]\n None,\n header_payload.clone(),\n )\n .await?;\n }\n\n let payment_intent_status = payment_data.get_payment_intent().status;\n\n payment_data\n .get_payment_attempt()\n .payment_token\n .as_ref()\n .zip(payment_data.get_payment_attempt().payment_method)\n .map(ParentPaymentMethodToken::create_key_for_token)\n .async_map(|key_for_hyperswitch_token| async move {\n if key_for_hyperswitch_token\n .should_delete_payment_method_token(payment_intent_status)\n {\n let _ = key_for_hyperswitch_token.delete(state).await;\n }\n })\n .await;\n } else {\n (_, payment_data) = operation\n .to_update_tracker()?\n .update_trackers(\n state,\n req_state,\n payment_data.clone(),\n customer.clone(),\n validate_result.storage_scheme,\n None,\n &key_store,\n None,\n header_payload.clone(),\n )\n .await?;\n }\n\n let cloned_payment_data = payment_data.clone();\n let cloned_customer = customer.clone();\n\n #[cfg(feature = \"v1\")]\n operation\n .to_domain()?\n .store_extended_card_info_temporarily(\n state,\n payment_data.get_payment_intent().get_id(),\n &business_profile,\n payment_data.get_payment_method_data(),\n )\n .await?;\n\n utils::trigger_payments_webhook(\n merchant_account,\n business_profile,\n &key_store,\n cloned_payment_data,\n cloned_customer,\n state,\n operation,\n )\n .await\n .map_err(|error| logger::warn!(payments_outgoing_webhook_error=?error))\n .ok();\n\n Ok((\n payment_data,\n req,\n customer,\n connector_http_status_code,\n external_latency,\n ))\n}",
|
| 17 |
+
"diff_span": {
|
| 18 |
+
"before": " );\n\n operation\n .to_domain()?\n .call_external_three_ds_authentication_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n mandate_type,\n )\n .await?;\n\n let merchants_eligible_for_authentication_service = state\n .store\n .as_ref()\n .find_config_by_key(crate::consts::AUTHENTICATION_SERVICE_ELIGIBLE_CONFIG)\n .await\n .to_not_found_response(errors::ApiErrorResponse::ConfigNotFound)?;\n let auth_eligible_array: Vec<String> =\n serde_json::from_str(&merchants_eligible_for_authentication_service.config)\n .change_context(errors::ApiErrorResponse::InternalServerError)\n .attach_printable(\"unable to parse authentication service config\")?;\n let merchant_id = merchant_account.get_id();\n\n if auth_eligible_array.contains(&merchant_id.get_string_repr().to_owned()) {\n let authentication_product_ids = business_profile\n .authentication_product_ids\n .clone()\n .ok_or(errors::ApiErrorResponse::PreconditionFailed {\n message: \"authentication_product_ids is not configured in business profile\"\n .to_string(),\n })?;\n operation\n .to_domain()?\n .call_unified_authentication_service_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n &authentication_product_ids,\n )\n .await?;\n } else {\n logger::info!(\n \"skipping authentication service call since the merchant is not eligible.\"\n )\n };\n",
|
| 19 |
+
"after": " logger::info!(\n \"skipping authentication service call since the merchant is not eligible.\"\n );\n\n operation\n .to_domain()?\n .call_external_three_ds_authentication_if_eligible(\n state,\n &mut payment_data,\n &mut should_continue_transaction,\n &connector_details,\n &business_profile,\n &key_store,\n mandate_type,\n )\n .await?;\n };\n"
|
| 20 |
+
},
|
| 21 |
+
"commit_sha": "98b5af4ea8c7c5b79a37b61a88eae1463397e6ff"
|
| 22 |
+
}
|
| 23 |
+
]
|
| 24 |
+
}
|
diffs/pr_6859/a0ea8e7/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "a0ea8e7c10c000b3a6177e50baf4f130c9b4ba91",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/a97f01e/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "a97f01eeaca1ac9baedcac357835702653eaaa96",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/be0ffa9/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6859/c6bc417/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "c6bc41713bd5c26b0f19ec7bbd3415d743b0374e",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/c7a0b06/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "c7a0b06db2e063fff440604d171575041e8143ed",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|
diffs/pr_6859/ecbee61/diff.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
diffs/pr_6859/edae612/diff.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"commit_sha": "edae612175c69435f4c12c9276981d05a3130387",
|
| 3 |
+
"pr_number": 6859,
|
| 4 |
+
"rust_files": [],
|
| 5 |
+
"diffs": []
|
| 6 |
+
}
|