-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1966 from stripe/remi-add-issuing-changes
Add support for `SpendingControls` on Issuing `Card` and `Cardholder`
- Loading branch information
Showing
22 changed files
with
337 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/Stripe.net/Entities/Issuing/Cardholders/CardholderSpendingControls.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Stripe | ||
{ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public class CardholderSpendingControls : StripeEntity<CardholderSpendingControls> | ||
{ | ||
/// <summary> | ||
/// Categories of authorizations permitted for this cardholder. | ||
/// </summary> | ||
[JsonProperty("allowed_categories")] | ||
public List<string> AllowedCategories { get; set; } | ||
|
||
/// <summary> | ||
/// Categories of authorizations to always decline for this cardholder. | ||
/// </summary> | ||
[JsonProperty("blocked_categories")] | ||
public List<string> BlockedCategories { get; set; } | ||
|
||
/// <summary> | ||
/// Limit the spending with rules based on time intervals and categories. | ||
/// </summary> | ||
[JsonProperty("spending_limits")] | ||
public List<CardholderSpendingControlsSpendingLimit> SpendingLimits { get; set; } | ||
|
||
/// <summary> | ||
/// Currency for the amounts within <see cref="SpendingLimits"/>. | ||
/// </summary> | ||
[JsonProperty("spending_limits_currency")] | ||
public string SpendingLimitsCurrency { get; set; } | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Stripe.net/Entities/Issuing/Cardholders/CardholderSpendingControlsSpendingLimit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace Stripe | ||
{ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public class CardholderSpendingControlsSpendingLimit : StripeEntity<CardholderSpendingControlsSpendingLimit> | ||
{ | ||
/// <summary> | ||
/// Maximum amount allowed to spend per time interval. | ||
/// </summary> | ||
[JsonProperty("amount")] | ||
public long? Amount { get; set; } | ||
|
||
/// <summary> | ||
/// Categories on which to apply the spending limit. Leave this empty to limit all charges. | ||
/// </summary> | ||
[JsonProperty("categories")] | ||
public List<string> Categories { get; set; } | ||
|
||
/// <summary> | ||
/// The time interval with which to apply this spending limit towards. Allowed values are | ||
/// <c>per_authorization</c>, <c>daily</c>, <c>weekly</c>, <c>monthly</c>, <c>yearly</c>, | ||
/// or <c>all_time</c>. | ||
/// </summary> | ||
[JsonProperty("interval")] | ||
public string Interval { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/Stripe.net/Entities/Issuing/Cards/CardSpendingControls.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
namespace Stripe.Issuing | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public class CardSpendingControls : StripeEntity<CardSpendingControls> | ||
{ | ||
/// <summary> | ||
/// Categories of authorizations permitted for this card. | ||
/// </summary> | ||
[JsonProperty("allowed_categories")] | ||
public List<string> AllowedCategories { get; set; } | ||
|
||
/// <summary> | ||
/// Categories of authorizations to always decline for this card. | ||
/// </summary> | ||
[JsonProperty("blocked_categories")] | ||
public List<string> BlockedCategories { get; set; } | ||
|
||
/// <summary> | ||
/// Maximum count of approved authorizations on this card. Counts all authorizations | ||
/// retroactively. | ||
/// </summary> | ||
[JsonProperty("max_approvals")] | ||
public long? MaxApprovals { get; set; } | ||
|
||
/// <summary> | ||
/// Limit the spending with rules based on time intervals and categories. | ||
/// </summary> | ||
[JsonProperty("spending_limits")] | ||
public List<CardSpendingControlsSpendingLimit> SpendingLimits { get; set; } | ||
|
||
/// <summary> | ||
/// Currency for the amounts within <see cref="SpendingLimits"/>. Locked to the currency of | ||
/// the card. | ||
/// </summary> | ||
[JsonProperty("spending_limits_currency")] | ||
public string SpendingLimitsCurrency { get; set; } | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/Stripe.net/Entities/Issuing/Cards/CardSpendingControlsSpendingLimit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace Stripe.Issuing | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public class CardSpendingControlsSpendingLimit : StripeEntity<CardSpendingControlsSpendingLimit> | ||
{ | ||
/// <summary> | ||
/// Maximum amount allowed to spend per time interval. | ||
/// </summary> | ||
[JsonProperty("amount")] | ||
public long Amount { get; set; } | ||
|
||
/// <summary> | ||
/// Categories on which to apply the spending limit. Leave this empty to limit all charges. | ||
/// </summary> | ||
[JsonProperty("categories")] | ||
public List<string> Categories { get; set; } | ||
|
||
/// <summary> | ||
/// The time interval with which to apply this spending limit towards. Allowed values are | ||
/// <c>per_authorization</c>, <c>daily</c>, <c>weekly</c>, <c>monthly</c>, <c>yearly</c>, | ||
/// or <c>all_time</c>. | ||
/// </summary> | ||
[JsonProperty("interval")] | ||
public string Interval { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/Stripe.net/Services/Issuing/Cardholders/CardholderSpendingControlsOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Stripe.Issuing | ||
{ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public class CardholderSpendingControlsOptions : INestedOptions | ||
{ | ||
/// <summary> | ||
/// Categories of authorizations permitted for this cardholder. | ||
/// </summary> | ||
[JsonProperty("allowed_categories")] | ||
public List<string> AllowedCategories { get; set; } | ||
|
||
/// <summary> | ||
/// Categories of authorizations to always decline for this cardholder. | ||
/// </summary> | ||
[JsonProperty("blocked_categories")] | ||
public List<string> BlockedCategories { get; set; } | ||
|
||
/// <summary> | ||
/// Limit the spending with rules based on time intervals and categories. | ||
/// </summary> | ||
[JsonProperty("spending_limits")] | ||
public List<CardholderSpendingControlsSpendingLimitOptions> SpendingLimits { get; set; } | ||
|
||
/// <summary> | ||
/// Currency for the amounts within <see cref="SpendingLimits"/>. | ||
/// </summary> | ||
[JsonProperty("spending_limits_currency")] | ||
public string SpendingLimitsCurrency { get; set; } | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...Stripe.net/Services/Issuing/Cardholders/CardholderSpendingControlsSpendingLimitOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace Stripe.Issuing | ||
{ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
public class CardholderSpendingControlsSpendingLimitOptions : INestedOptions | ||
{ | ||
/// <summary> | ||
/// Maximum amount allowed to spend per time interval. | ||
/// </summary> | ||
[JsonProperty("amount")] | ||
public long? Amount { get; set; } | ||
|
||
/// <summary> | ||
/// categories on which to apply the spending limit. Leave this empty to limit all charges. | ||
/// </summary> | ||
[JsonProperty("categories")] | ||
public List<string> Categories { get; set; } | ||
|
||
/// <summary> | ||
/// The time interval with which to apply this spending limit towards. Allowed values are | ||
/// <c>per_authorization</c>, <c>daily</c>, <c>weekly</c>, <c>monthly</c>, <c>yearly</c>, | ||
/// or <c>all_time</c>. | ||
/// </summary> | ||
[JsonProperty("interval")] | ||
public string Interval { get; set; } | ||
} | ||
} |
Oops, something went wrong.