mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 01:57:45 +08:00 
			
		
		
		
	test(selenium): read config from CONNECTOR_AUTH_FILE_PATH environment variable and fix bugs in UI tests (#1225)
				
					
				
			Co-authored-by: AkshayaFoiger <akshaya.shankar@juspay.in> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
		| @ -75,6 +75,15 @@ pub struct NuveiPaymentsRequest { | ||||
|     pub checksum: String, | ||||
|     pub billing_address: Option<BillingAddress>, | ||||
|     pub related_transaction_id: Option<String>, | ||||
|     pub url_details: Option<UrlDetails>, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, Serialize, Default)] | ||||
| #[serde(rename_all = "camelCase")] | ||||
| pub struct UrlDetails { | ||||
|     pub success_url: String, | ||||
|     pub failure_url: String, | ||||
|     pub pending_url: String, | ||||
| } | ||||
|  | ||||
| #[derive(Debug, Serialize, Default)] | ||||
| @ -676,12 +685,18 @@ impl<F> | ||||
|             capture_method: item.request.capture_method, | ||||
|             ..Default::default() | ||||
|         })?; | ||||
|         let return_url = item.request.get_return_url()?; | ||||
|         Ok(Self { | ||||
|             is_rebilling: request_data.is_rebilling, | ||||
|             user_token_id: request_data.user_token_id, | ||||
|             related_transaction_id: request_data.related_transaction_id, | ||||
|             payment_option: request_data.payment_option, | ||||
|             billing_address: request_data.billing_address, | ||||
|             url_details: Some(UrlDetails { | ||||
|                 success_url: return_url.clone(), | ||||
|                 failure_url: return_url.clone(), | ||||
|                 pending_url: return_url, | ||||
|             }), | ||||
|             ..request | ||||
|         }) | ||||
|     } | ||||
| @ -1017,6 +1032,7 @@ pub enum NuveiTransactionStatus { | ||||
|     Declined, | ||||
|     Error, | ||||
|     Redirect, | ||||
|     Pending, | ||||
|     #[default] | ||||
|     Processing, | ||||
| } | ||||
| @ -1100,7 +1116,9 @@ fn get_payment_status(response: &NuveiPaymentsResponse) -> enums::AttemptStatus | ||||
|                     _ => enums::AttemptStatus::Failure, | ||||
|                 } | ||||
|             } | ||||
|             NuveiTransactionStatus::Processing => enums::AttemptStatus::Pending, | ||||
|             NuveiTransactionStatus::Processing | NuveiTransactionStatus::Pending => { | ||||
|                 enums::AttemptStatus::Pending | ||||
|             } | ||||
|             NuveiTransactionStatus::Redirect => enums::AttemptStatus::AuthenticationPending, | ||||
|         }, | ||||
|         None => match response.status { | ||||
| @ -1253,7 +1271,9 @@ impl From<NuveiTransactionStatus> for enums::RefundStatus { | ||||
|         match item { | ||||
|             NuveiTransactionStatus::Approved => Self::Success, | ||||
|             NuveiTransactionStatus::Declined | NuveiTransactionStatus::Error => Self::Failure, | ||||
|             NuveiTransactionStatus::Processing | NuveiTransactionStatus::Redirect => Self::Pending, | ||||
|             NuveiTransactionStatus::Processing | ||||
|             | NuveiTransactionStatus::Pending | ||||
|             | NuveiTransactionStatus::Redirect => Self::Pending, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1645,14 +1645,8 @@ impl api::IncomingWebhook for Stripe { | ||||
|  | ||||
|         Ok(match details.event_data.event_object.object { | ||||
|             stripe::WebhookEventObjectType::PaymentIntent | ||||
|             | stripe::WebhookEventObjectType::Charge => { | ||||
|                 api_models::webhooks::ObjectReferenceId::PaymentId( | ||||
|                     api_models::payments::PaymentIdType::ConnectorTransactionId( | ||||
|                         details.event_data.event_object.id, | ||||
|                     ), | ||||
|                 ) | ||||
|             } | ||||
|             stripe::WebhookEventObjectType::Dispute => { | ||||
|             | stripe::WebhookEventObjectType::Charge | ||||
|             | stripe::WebhookEventObjectType::Dispute => { | ||||
|                 api_models::webhooks::ObjectReferenceId::PaymentId( | ||||
|                     api_models::payments::PaymentIdType::ConnectorTransactionId( | ||||
|                         details | ||||
| @ -1692,7 +1686,9 @@ impl api::IncomingWebhook for Stripe { | ||||
|             stripe::WebhookEventType::SourceChargeable => { | ||||
|                 api::IncomingWebhookEvent::SourceChargeable | ||||
|             } | ||||
|             stripe::WebhookEventType::ChargeSucceeded => api::IncomingWebhookEvent::ChargeSucceeded, | ||||
|             stripe::WebhookEventType::ChargeSucceeded => { | ||||
|                 api::IncomingWebhookEvent::PaymentIntentSuccess | ||||
|             } | ||||
|             stripe::WebhookEventType::DisputeCreated => api::IncomingWebhookEvent::DisputeOpened, | ||||
|             stripe::WebhookEventType::DisputeClosed => api::IncomingWebhookEvent::DisputeCancelled, | ||||
|             stripe::WebhookEventType::DisputeUpdated => api::IncomingWebhookEvent::try_from( | ||||
|  | ||||
| @ -1399,11 +1399,11 @@ pub struct PaymentIntentResponse { | ||||
|     pub id: String, | ||||
|     pub object: String, | ||||
|     pub amount: i64, | ||||
|     pub amount_received: i64, | ||||
|     pub amount_capturable: i64, | ||||
|     pub amount_received: Option<i64>, | ||||
|     pub amount_capturable: Option<i64>, | ||||
|     pub currency: String, | ||||
|     pub status: StripePaymentStatus, | ||||
|     pub client_secret: Secret<String>, | ||||
|     pub client_secret: Option<Secret<String>>, | ||||
|     pub created: i32, | ||||
|     pub customer: Option<String>, | ||||
|     pub payment_method: Option<String>, | ||||
| @ -1519,7 +1519,7 @@ impl From<SetupIntentResponse> for PaymentIntentResponse { | ||||
|             id: value.id, | ||||
|             object: value.object, | ||||
|             status: value.status, | ||||
|             client_secret: value.client_secret, | ||||
|             client_secret: Some(value.client_secret), | ||||
|             customer: value.customer, | ||||
|             description: None, | ||||
|             statement_descriptor: value.statement_descriptor, | ||||
| @ -1619,7 +1619,7 @@ impl<F, T> | ||||
|                 connector_metadata, | ||||
|                 network_txn_id, | ||||
|             }), | ||||
|             amount_captured: Some(item.response.amount_received), | ||||
|             amount_captured: item.response.amount_received, | ||||
|             ..item.data | ||||
|         }) | ||||
|     } | ||||
| @ -1707,7 +1707,7 @@ impl<F, T> | ||||
|         Ok(Self { | ||||
|             status: enums::AttemptStatus::from(item.response.status.to_owned()), | ||||
|             response, | ||||
|             amount_captured: Some(item.response.amount_received), | ||||
|             amount_captured: item.response.amount_received, | ||||
|             ..item.data | ||||
|         }) | ||||
|     } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jagan
					Jagan