-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix: support every Stripe error code #15
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe there is a |
||
ChargeAlreadyCaptured, | ||
ChargeAlreadyRefunded, | ||
ChargeDisputed, | ||
ChargeExpiredForCapture, | ||
CountryUnsupported, | ||
CouponExpired, | ||
CustomerMaxSubscriptions, | ||
EmailInvalid, | ||
ExpiredCard, | ||
IncorrectAddress, | ||
IncorrectCvc, | ||
IncorrectNumber, | ||
IncorrectZip, | ||
CardDeclined, | ||
Missing, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The generic (Should be added after |
||
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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cannot find a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indeed, my bad, will fix this (I extracted the error code from the page with some JS code :)) |
||
TaxIdInvalid, | ||
TaxesCalculationFailed, | ||
TestmodeChargesOnly, | ||
TlsVersionUnsupported, | ||
TokenAlreadyUsed, | ||
TokenInUse, | ||
TransfersNotAllowed, | ||
UpstreamOrderCreationFailed, | ||
UrlInvalid | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably worth using the |
||
|
||
impl fmt::Display for ErrorCode { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find this error code (
stripe_account
) in the Stripe documentation.