feat(router): add requeue support for payments and fix duplicate entry error in process tracker for requeued payments (#1567)

This commit is contained in:
Sai Harsha Vardhan
2023-07-03 12:56:01 +05:30
committed by GitHub
parent 7489c870d9
commit b967d23251
18 changed files with 133 additions and 22 deletions

View File

@ -973,3 +973,23 @@ pub struct UnresolvedResponseReason {
/// A message to merchant to give hint on next action he/she should do to resolve
pub message: String,
}
#[derive(
Debug,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::EnumString,
Clone,
PartialEq,
Eq,
ToSchema,
)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum RetryAction {
/// Payment can be retried from the client side until the payment is successful or payment expires or the attempts(configured by the merchant) for payment are exhausted
ManualRetry,
/// Denotes that the payment is requeued
Requeue,
}

View File

@ -278,9 +278,9 @@ pub struct PaymentsRequest {
/// Business sub label for the payment
pub business_sub_label: Option<String>,
/// If enabled payment can be retried from the client side until the payment is successful or payment expires or the attempts(configured by the merchant) for payment are exhausted.
#[serde(default)]
pub manual_retry: bool,
/// Denotes the retry action
#[schema(value_type = Option<RetryAction>)]
pub retry_action: Option<api_enums::RetryAction>,
/// Any user defined fields can be passed here.
#[schema(value_type = Option<Object>, example = r#"{ "udf1": "some-value", "udf2": "some-value" }"#)]