Skip to content

Commit

Permalink
fix: add every Stripe error code https://stripe.com/docs/error-codes
Browse files Browse the repository at this point in the history
  • Loading branch information
FGRibreau committed Jun 10, 2018
1 parent 0657bb2 commit 57f06b6
Showing 1 changed file with 74 additions and 8 deletions.
82 changes: 74 additions & 8 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,84 @@ impl fmt::Display for ErrorType {
#[derive(Debug, PartialEq, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ErrorCode {
InvalidNumber,
InvalidExpiryMonth,
InvalidExpiryYear,
InvalidCvc,
InvalidSwipeData,
IncorrectNumber,
AccountAlreadyExists,
AccountCountryInvalidAddress,
AccountInvalid,
StripeAccount,
AccountNumberInvalid,
AlipayUpgradeRequired,
AmountTooLarge,
AmountTooSmall,
ApiKeyExpired,
BalanceInsufficient,
BankAccountExists,
BankAccountUnusable,
BankAccountUnverified,
BitcoinUpgradeRequired,
CardDeclined,
DeclineCode,
ChargeAlreadyCaptured,
ChargeAlreadyRefunded,
ChargeDisputed,
ChargeExpiredForCapture,
CountryUnsupported,
CouponExpired,
CustomerMaxSubscriptions,
EmailInvalid,
ExpiredCard,
IncorrectAddress,
IncorrectCvc,
IncorrectNumber,
IncorrectZip,
CardDeclined,
Missing,
InstantPayoutsUnsupported,
InvalidCardType,
InvalidChargeAmount,
InvalidCvc,
InvalidExpiryMonth,
InvalidExpiryYear,
InvalidNumber,
InvalidSourceUsage,
InvoiceNoCustomerLineItems,
InvoiceNoSubscriptionLineItems,
InvoiceNotEditable,
InvoiceUpcomingNone,
LivemodeMismatch,
OrderCreationFailed,
OrderRequiredSettings,
OrderStatusInvalid,
OrderUpstreamTimeout,
OutOfInventory,
ParameterInvalidEmpty,
ParameterInvalidInteger,
ParameterInvalidStringBlank,
ParameterInvalidStringEmpty,
ParameterMissing,
ParameterUnknown,
PaymentMethodUnactivated,
PayoutsNotAllowed,
PlatformApiKeyExpired,
PostalCodeInvalid,
ProcessingError,
ProductInactive,
RateLimit,
ResourceAlreadyExists,
ResourceMissing,
RoutingNumberInvalid,
SecretKeyRequired,
SepaUnsupportedAccount,
ShippingCalculationFailed,
SkuInactive,
StateUnsupported,
LegalEntity,
TaxIdInvalid,
TaxesCalculationFailed,
TestmodeChargesOnly,
TlsVersionUnsupported,
TokenAlreadyUsed,
TokenInUse,
TransfersNotAllowed,
UpstreamOrderCreationFailed,
UrlInvalid
}

impl fmt::Display for ErrorCode {
Expand Down

0 comments on commit 57f06b6

Please sign in to comment.