Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use constants instead of static strings #1647

Merged
merged 1 commit into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Stripe.net/Constants/AccountType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ namespace Stripe
{
public static class AccountType
{
public static string Custom => "custom";
public const string Custom = "custom";

public static string Standard => "standard";
public const string Standard = "standard";
}
}
4 changes: 2 additions & 2 deletions src/Stripe.net/Constants/BankAccountHolderType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ namespace Stripe
{
public static class BankAccountHolderType
{
public static string Individual => "individual";
public const string Individual = "individual";

public static string Company => "company";
public const string Company = "company";
}
}
276 changes: 138 additions & 138 deletions src/Stripe.net/Constants/Events.cs

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/Stripe.net/Constants/FilePurpose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ namespace Stripe
{
public static class FilePurpose
{
public static string BusinessLogo => "business_logo";
public const string BusinessLogo = "business_logo";

public static string DisputeEvidence => "dispute_evidence";
public const string DisputeEvidence = "dispute_evidence";

public static string IdentityDocument => "identity_document";
public const string IdentityDocument = "identity_document";

public static string IncorporationArticle => "incorporation_article";
public const string IncorporationArticle = "incorporation_article";

public static string IncorporationDocument => "incorporation_document";
public const string IncorporationDocument = "incorporation_document";

public static string PaymentProviderTransfer => "payment_provider_transfer";
public const string PaymentProviderTransfer = "payment_provider_transfer";

public static string ProductFeed => "product_feed";
public const string ProductFeed = "product_feed";
}
}
8 changes: 4 additions & 4 deletions src/Stripe.net/Constants/PlanIntervals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ namespace Stripe
{
public static class PlanIntervals
{
public static string Day => "day";
public const string Day = "day";

public static string Week => "week";
public const string Week = "week";

public static string Month => "month";
public const string Month = "month";

public static string Year => "year";
public const string Year = "year";
}
}
8 changes: 4 additions & 4 deletions src/Stripe.net/Constants/RefundReasons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ namespace Stripe
{
public static class RefundReasons
{
public static string Unknown => null;
public const string Unknown = null;

public static string Duplicate => "duplicate";
public const string Duplicate = "duplicate";

public static string Fraudulent => "fraudulent";
public const string Fraudulent = "fraudulent";

public static string RequestedByCustomer => "requested_by_customer";
public const string RequestedByCustomer = "requested_by_customer";
}
}
8 changes: 4 additions & 4 deletions src/Stripe.net/Constants/SourceFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ namespace Stripe
{
public static class SourceFlow
{
public static string Redirect => "redirect";
public const string Redirect = "redirect";

public static string Receiver => "receiver";
public const string Receiver = "receiver";

public static string CodeVerification => "code_verification";
public const string CodeVerification = "code_verification";

public static string None => "none";
public const string None = "none";
}
}
28 changes: 14 additions & 14 deletions src/Stripe.net/Constants/SourceType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@ namespace Stripe
{
public static class SourceType
{
public static string AchCreditTransfer => "ach_credit_transfer";
public const string AchCreditTransfer = "ach_credit_transfer";

public static string AchDebit => "ach_debit";
public const string AchDebit = "ach_debit";

public static string Alipay => "alipay";
public const string Alipay = "alipay";

public static string Bancontact => "bancontact";
public const string Bancontact = "bancontact";

public static string Bitcoin => "bitcoin";
public const string Bitcoin = "bitcoin";

public static string Card => "card";
public const string Card = "card";

public static string Eps => "eps";
public const string Eps = "eps";

public static string Giropay => "giropay";
public const string Giropay = "giropay";

public static string Ideal => "ideal";
public const string Ideal = "ideal";

public static string P24 => "p24";
public const string P24 = "p24";

public static string SepaCreditTransfer => "sepa_credit_transfer";
public const string SepaCreditTransfer = "sepa_credit_transfer";

public static string SepaDebit => "sepa_debit";
public const string SepaDebit = "sepa_debit";

public static string Sofort => "sofort";
public const string Sofort = "sofort";

public static string ThreeDSecure => "three_d_secure";
public const string ThreeDSecure = "three_d_secure";
}
}
4 changes: 2 additions & 2 deletions src/Stripe.net/Constants/SourceUsage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ namespace Stripe
{
public static class SourceUsage
{
public static string Reusable => "reusable";
public const string Reusable = "reusable";

public static string SingleUse => "single_use";
public const string SingleUse = "single_use";
}
}
14 changes: 7 additions & 7 deletions src/Stripe.net/Constants/SubscriptionStatuses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ namespace Stripe
{
public static class SubscriptionStatuses
{
public static string Trialing => "trialing";
public const string Trialing = "trialing";

public static string Active => "active";
public const string Active = "active";

public static string PastDue => "past_due";
public const string PastDue = "past_due";

public static string Canceled => "canceled";
public const string Canceled = "canceled";

public static string Unpaid => "unpaid";
public const string Unpaid = "unpaid";

public static string Incomplete => "incomplete";
public const string Incomplete = "incomplete";

public static string IncompleteExpired => "incomplete_expired";
public const string IncompleteExpired = "incomplete_expired";
}
}
20 changes: 10 additions & 10 deletions src/Stripe.net/Constants/TransferFailureCodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ namespace Stripe
{
public static class TransferFailureCodes
{
public static string InsufficientFunds => "insufficient_funds";
public const string InsufficientFunds = "insufficient_funds";

public static string AccountClosed => "account_closed";
public const string AccountClosed = "account_closed";

public static string NoAccount => "no_account";
public const string NoAccount = "no_account";

public static string InvalidAccountNumber => "invalid_account_number";
public const string InvalidAccountNumber = "invalid_account_number";

public static string DebitNotAuthorized => "debit_not_authorized";
public const string DebitNotAuthorized = "debit_not_authorized";

public static string BankOwnershipChanged => "bank_ownership_changed";
public const string BankOwnershipChanged = "bank_ownership_changed";

public static string AccountFrozen => "account_frozen";
public const string AccountFrozen = "account_frozen";

public static string CouldNotProcess => "could_not_process";
public const string CouldNotProcess = "could_not_process";

public static string BankAccountRestricted => "bank_account_restricted";
public const string BankAccountRestricted = "bank_account_restricted";

public static string InvalidCurrency => "invalid_currency";
public const string InvalidCurrency = "invalid_currency";
}
}
4 changes: 2 additions & 2 deletions src/Stripe.net/Constants/TransferMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ public static class TransferMethod
/// <summary>
/// Standard is the default method.
/// </summary>
public static string Standard => "standard";
public const string Standard = "standard";

/// <summary>
/// Only supported for transfers to debit cards.
/// </summary>
public static string Instant => "instant";
public const string Instant = "instant";
}
}