Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(router): add expand attempts support in payments retrieve response (#1678)
Sai Harsha Vardhan8572f1da8eb5
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rsindex 2802a7f82f..a49a8f00fa 100644--- a/crates/api_models/src/payments.rs+++ b/crates/api_models/src/payments.rs@@ -293,6 +293,56 @@ pub struct PaymentsRequest {pub feature_metadata: Option<FeatureMetadata>,}+#[derive(+ Default, Debug, serde::Serialize, Clone, PartialEq, ToSchema, router_derive::PolymorphicSchema,+)]+pub struct PaymentAttemptResponse {+ /// Unique identifier for the attempt+ pub attempt_id: String,+ /// The status of the attempt+ #[schema(value_type = AttemptStatus, example = "charged")]+ pub status: enums::AttemptStatus,+ /// The payment attempt amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,+ pub amount: i64,+ /// The currency of the amount of the payment attempt+ #[schema(value_type = Option<Currency>, example = "usd")]+ pub currency: Option<enums::Currency>,+ /// The connector used for the payment+ pub connector: Option<String>,+ /// If there was an error while calling the connector the error message is received here+ pub error_message: Option<String>,+ /// The payment method that is to be used+ #[schema(value_type = Option<PaymentMethod>, example = "bank_transfer")]+ pub payment_method: Option<enums::PaymentMethod>,+ /// A unique identifier for a payment provided by the connector+ pub connector_transaction_id: Option<String>,+ /// This is the instruction for capture/ debit the money from the users' card. On the other hand authorization refers to blocking the amount on the users' payment method.+ #[schema(value_type = Option<CaptureMethod>, example = "scheduled")]+ pub capture_method: Option<enums::CaptureMethod>,+ /// The transaction authentication can be set to undergo payer authentication. By default, the authentication will be marked as NO_THREE_DS+ #[schema(value_type = Option<AuthenticationType>, example = "no_three_ds", default = "three_ds")]+ pub authentication_type: Option<enums::AuthenticationType>,+ /// If the payment was cancelled the reason provided here+ pub cancellation_reason: Option<String>,+ /// A unique identifier to link the payment to a mandate, can be use instead of payment_method_data+ pub mandate_id: Option<String>,+ /// If there was an error while calling the connectors the code is received here+ pub error_code: Option<String>,+ /// Provide a reference to a stored payment method+ pub payment_token: Option<String>,+ /// additional data related to some connectors+ pub connector_metadata: Option<serde_json::Value>,+ /// Payment Experience for the current payment+ #[schema(value_type = Option<PaymentExperience>, example = "redirect_to_url")]+ pub payment_experience: Option<enums::PaymentExperience>,+ /// Payment Method Type+ #[schema(value_type = Option<PaymentMethodType>, example = "google_pay")]+ pub payment_method_type: Option<enums::PaymentMethodType>,+ /// reference to the payment at connector side+ #[schema(value_type = Option<String>, example = "993672945374576J")]+ pub reference_id: Option<String>,+}+impl PaymentsRequest {pub fn get_feature_metadata_as_value(&self,@@ -1362,6 +1412,11 @@ pub struct PaymentsResponse {#[schema(value_type = Option<Vec<DisputeResponsePaymentsRetrieve>>)]pub disputes: Option<Vec<disputes::DisputeResponsePaymentsRetrieve>>,+ /// List of attempts that happened on this intent+ #[schema(value_type = Option<Vec<PaymentAttemptResponse>>)]+ #[serde(skip_serializing_if = "Option::is_none")]+ pub attempts: Option<Vec<PaymentAttemptResponse>>,+/// A unique identifier to link the payment to a mandate, can be use instead of payment_method_data#[schema(max_length = 255, example = "mandate_iwer89rnjef349dni3")]pub mandate_id: Option<String>,@@ -1771,6 +1826,8 @@ pub struct PaymentsRetrieveRequest {pub merchant_connector_details: Option<admin::MerchantConnectorDetailsWrap>,/// This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDKpub client_secret: Option<String>,+ /// If enabled provides list of attempts linked to payment intent+ pub expand_attempts: Option<bool>,}#[derive(Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, Clone, ToSchema)]@@ -2164,6 +2221,8 @@ pub struct PaymentRetrieveBody {pub force_sync: Option<bool>,/// This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDKpub client_secret: Option<String>,+ /// If enabled provides list of attempts linked to payment intent+ pub expand_attempts: Option<bool>,}#[derive(Default, Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rsindex 5bdbd7bbae..271e4f97cd 100644--- a/crates/common_enums/src/enums.rs+++ b/crates/common_enums/src/enums.rs@@ -24,6 +24,7 @@ pub mod diesel_exports {serde::Serialize,strum::Display,strum::EnumString,+ ToSchema,)]#[router_derive::diesel_enum(storage_type = "pg_enum")]#[serde(rename_all = "snake_case")]diff --git a/crates/diesel_models/src/query/payment_attempt.rs b/crates/diesel_models/src/query/payment_attempt.rsindex 36ef16c9f8..11968fc250 100644--- a/crates/diesel_models/src/query/payment_attempt.rs+++ b/crates/diesel_models/src/query/payment_attempt.rs@@ -180,6 +180,30 @@ impl PaymentAttempt {).await}++ #[instrument(skip(conn))]+ pub async fn find_by_merchant_id_payment_id(+ conn: &PgPooledConn,+ merchant_id: &str,+ payment_id: &str,+ ) -> StorageResult<Vec<Self>> {+ generics::generic_filter::<+ <Self as HasTable>::Table,+ _,+ <<Self as HasTable>::Table as Table>::PrimaryKey,+ _,+ >(+ conn,+ dsl::merchant_id+ .eq(merchant_id.to_owned())+ .and(dsl::payment_id.eq(payment_id.to_owned())),+ None,+ None,+ None,+ )+ .await+ }+pub async fn get_filters_for_payments(conn: &PgPooledConn,pi: &[PaymentIntent],diff --git a/crates/router/src/compatibility/stripe/payment_intents.rs b/crates/router/src/compatibility/stripe/payment_intents.rsindex 165317775c..10e52bfa59 100644--- a/crates/router/src/compatibility/stripe/payment_intents.rs+++ b/crates/router/src/compatibility/stripe/payment_intents.rs@@ -80,6 +80,7 @@ pub async fn payment_intents_retrieve(param: None,merchant_connector_details: None,client_secret: query_payload.client_secret.clone(),+ expand_attempts: None,};let (auth_type, auth_flow) =diff --git a/crates/router/src/compatibility/stripe/setup_intents.rs b/crates/router/src/compatibility/stripe/setup_intents.rsindex 8665031140..71e0f7ebbc 100644--- a/crates/router/src/compatibility/stripe/setup_intents.rs+++ b/crates/router/src/compatibility/stripe/setup_intents.rs@@ -84,6 +84,7 @@ pub async fn setup_intents_retrieve(param: None,merchant_connector_details: None,client_secret: query_payload.client_secret.clone(),+ expand_attempts: None,};let (auth_type, auth_flow) =diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rsindex 60b28f102f..3c6b295b41 100644--- a/crates/router/src/core/payments.rs+++ b/crates/router/src/core/payments.rs@@ -479,6 +479,7 @@ impl PaymentRedirectFlow for PaymentRedirectSync {}}),client_secret: None,+ expand_attempts: None,};payments_core::<api::PSync, api::PaymentsResponse, _, _, _>(state,@@ -1081,6 +1082,7 @@ wherepub payment_method_data: Option<api::PaymentMethodData>,pub refunds: Vec<storage::Refund>,pub disputes: Vec<storage::Dispute>,+ pub attempts: Option<Vec<storage::PaymentAttempt>>,pub sessions_token: Vec<api::SessionToken>,pub card_cvc: Option<Secret<String>>,pub email: Option<pii::Email>,diff --git a/crates/router/src/core/payments/operations/payment_cancel.rs b/crates/router/src/core/payments/operations/payment_cancel.rsindex 435c5684fb..c21b545737 100644--- a/crates/router/src/core/payments/operations/payment_cancel.rs+++ b/crates/router/src/core/payments/operations/payment_cancel.rs@@ -150,6 +150,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsCancelRequest>force_sync: None,refunds: vec![],disputes: vec![],+ attempts: None,connector_response,sessions_token: vec![],card_cvc: None,diff --git a/crates/router/src/core/payments/operations/payment_capture.rs b/crates/router/src/core/payments/operations/payment_capture.rsindex ceafe45703..16002726ca 100644--- a/crates/router/src/core/payments/operations/payment_capture.rs+++ b/crates/router/src/core/payments/operations/payment_capture.rs@@ -155,6 +155,7 @@ impl<F: Send + Clone> GetTracker<F, payments::PaymentData<F>, api::PaymentsCaptupayment_method_data: None,refunds: vec![],disputes: vec![],+ attempts: None,connector_response,sessions_token: vec![],card_cvc: None,diff --git a/crates/router/src/core/payments/operations/payment_complete_authorize.rs b/crates/router/src/core/payments/operations/payment_complete_authorize.rsindex b0dcafda1f..8c4c1688c0 100644--- a/crates/router/src/core/payments/operations/payment_complete_authorize.rs+++ b/crates/router/src/core/payments/operations/payment_complete_authorize.rs@@ -217,6 +217,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Coforce_sync: None,refunds: vec![],disputes: vec![],+ attempts: None,sessions_token: vec![],card_cvc: request.card_cvc.clone(),creds_identifier: None,diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rsindex a578f078c9..434b9444ac 100644--- a/crates/router/src/core/payments/operations/payment_confirm.rs+++ b/crates/router/src/core/payments/operations/payment_confirm.rs@@ -272,6 +272,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Paforce_sync: None,refunds: vec![],disputes: vec![],+ attempts: None,sessions_token: vec![],card_cvc: request.card_cvc.clone(),creds_identifier,diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rsindex b52b1faca9..f5fc016a1e 100644--- a/crates/router/src/core/payments/operations/payment_create.rs+++ b/crates/router/src/core/payments/operations/payment_create.rs@@ -251,6 +251,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Papayment_method_data: request.payment_method_data.clone(),refunds: vec![],disputes: vec![],+ attempts: None,force_sync: None,connector_response,sessions_token: vec![],diff --git a/crates/router/src/core/payments/operations/payment_method_validate.rs b/crates/router/src/core/payments/operations/payment_method_validate.rsindex 4e2a7e0101..be6e5a1437 100644--- a/crates/router/src/core/payments/operations/payment_method_validate.rs+++ b/crates/router/src/core/payments/operations/payment_method_validate.rs@@ -177,6 +177,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::VerifyRequest> for Paymforce_sync: None,refunds: vec![],disputes: vec![],+ attempts: None,sessions_token: vec![],card_cvc: None,creds_identifier,diff --git a/crates/router/src/core/payments/operations/payment_session.rs b/crates/router/src/core/payments/operations/payment_session.rsindex 096cf297d0..a2f014fac7 100644--- a/crates/router/src/core/payments/operations/payment_session.rs+++ b/crates/router/src/core/payments/operations/payment_session.rs@@ -168,6 +168,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsSessionRequest>force_sync: None,refunds: vec![],disputes: vec![],+ attempts: None,sessions_token: vec![],connector_response,card_cvc: None,diff --git a/crates/router/src/core/payments/operations/payment_start.rs b/crates/router/src/core/payments/operations/payment_start.rsindex ab92f29e0a..cb9cc845ed 100644--- a/crates/router/src/core/payments/operations/payment_start.rs+++ b/crates/router/src/core/payments/operations/payment_start.rs@@ -141,6 +141,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsStartRequest> fforce_sync: None,refunds: vec![],disputes: vec![],+ attempts: None,sessions_token: vec![],card_cvc: None,creds_identifier: None,diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rsindex c939e5f7a7..4e8ae9d21b 100644--- a/crates/router/src/core/payments/operations/payment_status.rs+++ b/crates/router/src/core/payments/operations/payment_status.rs@@ -233,6 +233,19 @@ async fn get_tracker_for_sync<).await?;+ let attempts = match request.expand_attempts {+ Some(true) => {+ Some(db+ .find_attempts_by_merchant_id_payment_id(merchant_id, &payment_id_str, storage_scheme)+ .await+ .change_context(errors::ApiErrorResponse::InternalServerError)+ .attach_printable_lazy(|| {+ format!("Error while retrieving attempt list for, merchant_id: {merchant_id}, payment_id: {payment_id_str}")+ })?)+ },+ _ => None,+ };+let refunds = db.find_refund_by_payment_id_merchant_id(&payment_id_str, merchant_id, storage_scheme).await@@ -300,6 +313,7 @@ async fn get_tracker_for_sync<payment_attempt,refunds,disputes,+ attempts,sessions_token: vec![],card_cvc: None,creds_identifier,diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rsindex d25de0d3f2..17171c8438 100644--- a/crates/router/src/core/payments/operations/payment_update.rs+++ b/crates/router/src/core/payments/operations/payment_update.rs@@ -318,6 +318,7 @@ impl<F: Send + Clone> GetTracker<F, PaymentData<F>, api::PaymentsRequest> for Paforce_sync: None,refunds: vec![],disputes: vec![],+ attempts: None,connector_response,sessions_token: vec![],card_cvc: request.card_cvc.clone(),diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rsindex 6aabf66deb..407b635364 100644--- a/crates/router/src/core/payments/transformers.rs+++ b/crates/router/src/core/payments/transformers.rs@@ -169,6 +169,7 @@ wherepayment_data.payment_intent,payment_data.refunds,payment_data.disputes,+ payment_data.attempts,payment_data.payment_method_data,customer,auth_flow,@@ -258,6 +259,7 @@ pub fn payments_to_payments_response<R, Op>(payment_intent: storage::PaymentIntent,refunds: Vec<storage::Refund>,disputes: Vec<storage::Dispute>,+ option_attempts: Option<Vec<storage::PaymentAttempt>>,payment_method_data: Option<api::PaymentMethodData>,customer: Option<domain::Customer>,auth_flow: services::AuthFlow,@@ -296,6 +298,12 @@ where.collect(),)};+ let attempts_response = option_attempts.map(|attempts| {+ attempts+ .into_iter()+ .map(ForeignInto::foreign_into)+ .collect()+ });let merchant_id = payment_attempt.merchant_id.to_owned();let payment_method_type = payment_attempt.payment_method_type@@ -407,6 +415,7 @@ where.set_description(payment_intent.description).set_refunds(refunds_response) // refunds.iter().map(refund_to_refund_response),.set_disputes(disputes_response)+ .set_attempts(attempts_response).set_payment_method(payment_attempt.payment_method,auth_flow == services::AuthFlow::Merchant,@@ -466,6 +475,7 @@ wheredescription: payment_intent.description,refunds: refunds_response,disputes: disputes_response,+ attempts: attempts_response,payment_method: payment_attempt.payment_method,capture_method: payment_attempt.capture_method,error_message: payment_attempt.error_message,diff --git a/crates/router/src/core/webhooks.rs b/crates/router/src/core/webhooks.rsindex 4d07c5beb4..35dbeb0672 100644--- a/crates/router/src/core/webhooks.rs+++ b/crates/router/src/core/webhooks.rs@@ -56,6 +56,7 @@ pub async fn payments_incoming_webhook_flow<W: api::OutgoingWebhookType>(param: None,merchant_connector_details: None,client_secret: None,+ expand_attempts: None,},services::AuthFlow::Merchant,consume_or_trigger_flow,diff --git a/crates/router/src/db/payment_attempt.rs b/crates/router/src/db/payment_attempt.rsindex 3cf833fc91..702463aba7 100644--- a/crates/router/src/db/payment_attempt.rs+++ b/crates/router/src/db/payment_attempt.rs@@ -63,6 +63,13 @@ pub trait PaymentAttemptInterface {storage_scheme: enums::MerchantStorageScheme,) -> CustomResult<types::PaymentAttempt, errors::StorageError>;+ async fn find_attempts_by_merchant_id_payment_id(+ &self,+ merchant_id: &str,+ payment_id: &str,+ storage_scheme: enums::MerchantStorageScheme,+ ) -> CustomResult<Vec<types::PaymentAttempt>, errors::StorageError>;+async fn get_filters_for_payments(&self,pi: &[diesel_models::payment_intent::PaymentIntent],@@ -216,6 +223,19 @@ mod storage {.into_report()}+ async fn find_attempts_by_merchant_id_payment_id(+ &self,+ merchant_id: &str,+ payment_id: &str,+ _storage_scheme: enums::MerchantStorageScheme,+ ) -> CustomResult<Vec<PaymentAttempt>, errors::StorageError> {+ let conn = connection::pg_connection_read(self).await?;+ PaymentAttempt::find_by_merchant_id_payment_id(&conn, merchant_id, payment_id)+ .await+ .map_err(Into::into)+ .into_report()+ }+async fn find_payment_attempt_by_attempt_id_merchant_id(&self,merchant_id: &str,@@ -285,6 +305,16 @@ impl PaymentAttemptInterface for MockDb {Err(errors::StorageError::MockDbError)?}+ async fn find_attempts_by_merchant_id_payment_id(+ &self,+ _merchant_id: &str,+ _payment_id: &str,+ _storage_scheme: enums::MerchantStorageScheme,+ ) -> CustomResult<Vec<types::PaymentAttempt>, errors::StorageError> {+ // [#172]: Implement function for `MockDb`+ Err(errors::StorageError::MockDbError)?+ }+#[allow(clippy::panic)]async fn insert_payment_attempt(&self,@@ -832,6 +862,35 @@ mod storage {}}+ async fn find_attempts_by_merchant_id_payment_id(+ &self,+ merchant_id: &str,+ payment_id: &str,+ storage_scheme: enums::MerchantStorageScheme,+ ) -> CustomResult<Vec<PaymentAttempt>, errors::StorageError> {+ match storage_scheme {+ enums::MerchantStorageScheme::PostgresOnly => {+ let conn = connection::pg_connection_read(self).await?;+ PaymentAttempt::find_by_merchant_id_payment_id(&conn, merchant_id, payment_id)+ .await+ .map_err(Into::into)+ .into_report()+ }+ enums::MerchantStorageScheme::RedisKv => {+ let key = format!("{merchant_id}_{payment_id}");+ let lookup = self.get_lookup_by_lookup_id(&key).await?;++ let pattern = db_utils::generate_hscan_pattern_for_attempt(&lookup.sk_id);++ self.redis_conn()+ .map_err(Into::<errors::StorageError>::into)?+ .hscan_and_deserialize(&key, &pattern, None)+ .await+ .change_context(errors::StorageError::KVError)+ }+ }+ }+async fn get_filters_for_payments(&self,pi: &[diesel_models::payment_intent::PaymentIntent],diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rsindex d0fe046118..204f6f4429 100644--- a/crates/router/src/openapi.rs+++ b/crates/router/src/openapi.rs@@ -154,6 +154,7 @@ Never share your secret api keys. Keep them guarded and secure.api_models::enums::FrmAction,api_models::enums::FrmPreferredFlowTypes,api_models::enums::RetryAction,+ api_models::enums::AttemptStatus,api_models::admin::MerchantConnectorCreate,api_models::admin::MerchantConnectorUpdate,api_models::admin::PrimaryBusinessDetails,@@ -260,6 +261,7 @@ Never share your secret api keys. Keep them guarded and secure.api_models::payments::SepaBankTransferInstructions,api_models::payments::BacsBankTransferInstructions,api_models::payments::RedirectResponse,+ api_models::payments::PaymentAttemptResponse,api_models::payment_methods::RequiredFieldInfo,api_models::refunds::RefundListRequest,api_models::refunds::RefundListResponse,diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rsindex 492d551140..f9a485a328 100644--- a/crates/router/src/routes/payments.rs+++ b/crates/router/src/routes/payments.rs@@ -149,6 +149,7 @@ pub async fn payments_retrieve(merchant_id: json_payload.merchant_id.clone(),force_sync: json_payload.force_sync.unwrap_or(false),client_secret: json_payload.client_secret.clone(),+ expand_attempts: json_payload.expand_attempts,..Default::default()};let (auth_type, auth_flow) =diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rsindex 2d3d2e74ee..9834914910 100644--- a/crates/router/src/types/transformers.rs+++ b/crates/router/src/types/transformers.rs@@ -496,3 +496,28 @@ impl TryFrom<domain::MerchantConnectorAccount> for api_models::admin::MerchantCo})}}++impl ForeignFrom<storage::PaymentAttempt> for api_models::payments::PaymentAttemptResponse {+ fn foreign_from(payment_attempt: storage::PaymentAttempt) -> Self {+ Self {+ attempt_id: payment_attempt.attempt_id,+ status: payment_attempt.status,+ amount: payment_attempt.amount,+ currency: payment_attempt.currency,+ connector: payment_attempt.connector,+ error_message: payment_attempt.error_reason,+ payment_method: payment_attempt.payment_method,+ connector_transaction_id: payment_attempt.connector_transaction_id,+ capture_method: payment_attempt.capture_method,+ authentication_type: payment_attempt.authentication_type,+ cancellation_reason: payment_attempt.cancellation_reason,+ mandate_id: payment_attempt.mandate_id,+ error_code: payment_attempt.error_code,+ payment_token: payment_attempt.payment_token,+ connector_metadata: payment_attempt.connector_metadata,+ payment_experience: payment_attempt.payment_experience,+ payment_method_type: payment_attempt.payment_method_type,+ reference_id: payment_attempt.connector_response_reference_id,+ }+ }+}diff --git a/crates/router/src/utils/db_utils.rs b/crates/router/src/utils/db_utils.rsindex cb1c1b04a8..b02402d7fe 100644--- a/crates/router/src/utils/db_utils.rs+++ b/crates/router/src/utils/db_utils.rs@@ -11,6 +11,17 @@ pub fn generate_hscan_pattern_for_refund(sk: &str) -> String {.join("_")}+#[cfg(feature = "kv_store")]+/// Generates hscan field pattern. Suppose the field is pa_1234 it will generate+/// pa_*+pub fn generate_hscan_pattern_for_attempt(sk: &str) -> String {+ sk.split('_')+ .take(1)+ .chain(["*"])+ .collect::<Vec<&str>>()+ .join("_")+}+// The first argument should be a future while the second argument should be a closure that returns a future for a database callpub async fn try_redis_get_else_try_database_get<F, RFut, DFut, T>(redis_fut: RFut,diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.jsonindex 3025a6ed25..51095d9c35 100644--- a/openapi/openapi_spec.json+++ b/openapi/openapi_spec.json@@ -1933,6 +1933,34 @@}}},+ "AttemptStatus": {+ "type": "string",+ "enum": [+ "started",+ "authentication_failed",+ "router_declined",+ "authentication_pending",+ "authentication_successful",+ "authorized",+ "authorization_failed",+ "charged",+ "authorizing",+ "cod_initiated",+ "voided",+ "void_initiated",+ "capture_initiated",+ "capture_failed",+ "void_failed",+ "auto_refunded",+ "partial_charged",+ "unresolved",+ "pending",+ "failure",+ "payment_method_awaited",+ "confirmation_awaited",+ "device_data_collection_pending"+ ]+ },"AuthenticationType": {"type": "string","enum": [@@ -5999,6 +6027,121 @@}}},+ "PaymentAttemptResponse": {+ "type": "object",+ "required": [+ "attempt_id",+ "status",+ "amount"+ ],+ "properties": {+ "attempt_id": {+ "type": "string",+ "description": "Unique identifier for the attempt"+ },+ "status": {+ "$ref": "#/components/schemas/AttemptStatus"+ },+ "amount": {+ "type": "integer",+ "format": "int64",+ "description": "The payment attempt amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,"+ },+ "currency": {+ "allOf": [+ {+ "$ref": "#/components/schemas/Currency"+ }+ ],+ "nullable": true+ },+ "connector": {+ "type": "string",+ "description": "The connector used for the payment",+ "nullable": true+ },+ "error_message": {+ "type": "string",+ "description": "If there was an error while calling the connector the error message is received here",+ "nullable": true+ },+ "payment_method": {+ "allOf": [+ {+ "$ref": "#/components/schemas/PaymentMethod"+ }+ ],+ "nullable": true+ },+ "connector_transaction_id": {+ "type": "string",+ "description": "A unique identifier for a payment provided by the connector",+ "nullable": true+ },+ "capture_method": {+ "allOf": [+ {+ "$ref": "#/components/schemas/CaptureMethod"+ }+ ],+ "nullable": true+ },+ "authentication_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/AuthenticationType"+ }+ ],+ "nullable": true+ },+ "cancellation_reason": {+ "type": "string",+ "description": "If the payment was cancelled the reason provided here",+ "nullable": true+ },+ "mandate_id": {+ "type": "string",+ "description": "A unique identifier to link the payment to a mandate, can be use instead of payment_method_data",+ "nullable": true+ },+ "error_code": {+ "type": "string",+ "description": "If there was an error while calling the connectors the code is received here",+ "nullable": true+ },+ "payment_token": {+ "type": "string",+ "description": "Provide a reference to a stored payment method",+ "nullable": true+ },+ "connector_metadata": {+ "description": "additional data related to some connectors",+ "nullable": true+ },+ "payment_experience": {+ "allOf": [+ {+ "$ref": "#/components/schemas/PaymentExperience"+ }+ ],+ "nullable": true+ },+ "payment_method_type": {+ "allOf": [+ {+ "$ref": "#/components/schemas/PaymentMethodType"+ }+ ],+ "nullable": true+ },+ "reference_id": {+ "type": "string",+ "description": "reference to the payment at connector side",+ "example": "993672945374576J",+ "nullable": true+ }+ }+ },"PaymentExperience": {"type": "string","enum": [@@ -6612,6 +6755,11 @@"type": "string","description": "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK","nullable": true+ },+ "expand_attempts": {+ "type": "boolean",+ "description": "If enabled provides list of attempts linked to payment intent",+ "nullable": true}}},@@ -7449,6 +7597,14 @@"description": "List of dispute that happened on this intent","nullable": true},+ "attempts": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/PaymentAttemptResponse"+ },+ "description": "List of attempts that happened on this intent",+ "nullable": true+ },"mandate_id": {"type": "string","description": "A unique identifier to link the payment to a mandate, can be use instead of payment_method_data",@@ -7740,6 +7896,11 @@"type": "string","description": "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK","nullable": true+ },+ "expand_attempts": {+ "type": "boolean",+ "description": "If enabled provides list of attempts linked to payment intent",+ "nullable": true}}},