Skip to content

Commit f18d38b

Browse files
Add retry configuration for payment requests with Dunning and Downtime classes (#481)
1 parent 10400ca commit f18d38b

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Checkout.Payments
2+
{
3+
public class Downtime
4+
{
5+
/// <summary>
6+
/// Indicates if Checkout.com retries the payment when it's declined due to issuer or acquirer downtime
7+
/// (Required)
8+
/// </summary>
9+
public bool Enabled { get; set; }
10+
}
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Checkout.Payments
2+
{
3+
public class Dunning
4+
{
5+
/// <summary>
6+
/// Indicates if Checkout.com retries the payment when it's declined with a supported decline code (Required)
7+
/// </summary>
8+
public bool Enabled { get; set; }
9+
10+
/// <summary> (Optional, [ 1 .. 15 ], default: 6) </summary>
11+
public int? MaxAttempts { get; set; } = 6;
12+
13+
/// <summary> (Optional, [ 1 .. 60 ] default: 30) </summary>
14+
public int? EndAfterDays { get; set; } = 30;
15+
}
16+
}

src/CheckoutSdk/Payments/Request/PaymentRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ public class PaymentRequest
7272

7373
public IList<Product> Items { get; set; }
7474

75-
public PaymentRetryRequest Retry { get; set; }
75+
public RetryRequest Retry { get; set; }
7676

7777
public IDictionary<string, object> Metadata { get; set; } = new Dictionary<string, object>();
7878

7979
public PaymentInstruction Instruction { get; set; }
8080
}
81-
}
81+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Checkout.Payments
2+
{
3+
public class RetryRequest
4+
{
5+
/// <summary> Configuration of asynchronous Dunning retries (Optional) </summary>
6+
public Dunning Dunning { get; set; }
7+
8+
/// <summary> Configuration of asynchronous Downtime retries (Optional) </summary>
9+
public Downtime Downtime { get; set; }
10+
}
11+
}

0 commit comments

Comments
 (0)