fix: remove and/or resolve fixmes & todos in stripe compatibility (#218)

This commit is contained in:
Nishant Joshi
2022-12-23 00:56:41 +05:30
committed by GitHub
parent 87cedc296e
commit 9e0deac3c5
3 changed files with 138 additions and 136 deletions

View File

@ -157,138 +157,142 @@ pub enum StripeErrorCode {
},
#[error(error_type = StripeErrorType::InvalidRequestError, code = "", message = "The mandate information is invalid. {message}")]
PaymentIntentMandateInvalid { message: String },
// TODO: Some day implement all stripe error codes https://stripe.com/docs/error-codes
// AccountCountryInvalidAddress,
// AccountErrorCountryChangeRequiresAdditionalSteps,
// AccountInformationMismatch,
// AccountInvalid,
// AccountNumberInvalid,
// AcssDebitSessionIncomplete,
// AlipayUpgradeRequired,
// AmountTooLarge,
// AmountTooSmall,
// ApiKeyExpired,
// AuthenticationRequired,
// BalanceInsufficient,
// BankAccountBadRoutingNumbers,
// BankAccountDeclined,
// BankAccountExists,
// BankAccountUnusable,
// BankAccountUnverified,
// BankAccountVerificationFailed,
// BillingInvalidMandate,
// BitcoinUpgradeRequired,
// CardDeclineRateLimitExceeded,
// CardDeclined,
// CardholderPhoneNumberRequired,
// ChargeAlreadyCaptured,
// ChargeAlreadyRefunded,
// ChargeDisputed,
// ChargeExceedsSourceLimit,
// ChargeExpiredForCapture,
// ChargeInvalidParameter,
// ClearingCodeUnsupported,
// CountryCodeInvalid,
// CountryUnsupported,
// CouponExpired,
// CustomerMaxPaymentMethods,
// CustomerMaxSubscriptions,
// DebitNotAuthorized,
// EmailInvalid,
// ExpiredCard,
// IdempotencyKeyInUse,
// IncorrectAddress,
// IncorrectCvc,
// IncorrectNumber,
// IncorrectZip,
// InstantPayoutsConfigDisabled,
// InstantPayoutsCurrencyDisabled,
// InstantPayoutsLimitExceeded,
// InstantPayoutsUnsupported,
// InsufficientFunds,
// IntentInvalidState,
// IntentVerificationMethodMissing,
// InvalidCardType,
// InvalidCharacters,
// InvalidChargeAmount,
// InvalidCvc,
// InvalidExpiryMonth,
// InvalidExpiryYear,
// InvalidNumber,
// InvalidSourceUsage,
// InvoiceNoCustomerLineItems,
// InvoiceNoPaymentMethodTypes,
// InvoiceNoSubscriptionLineItems,
// InvoiceNotEditable,
// InvoiceOnBehalfOfNotEditable,
// InvoicePaymentIntentRequiresAction,
// InvoiceUpcomingNone,
// LivemodeMismatch,
// LockTimeout,
// Missing,
// NoAccount,
// NotAllowedOnStandardAccount,
// OutOfInventory,
// ParameterInvalidEmpty,
// ParameterInvalidInteger,
// ParameterInvalidStringBlank,
// ParameterInvalidStringEmpty,
// ParametersExclusive,
// PaymentIntentActionRequired,
// PaymentIntentIncompatiblePaymentMethod,
// PaymentIntentInvalidParameter,
// PaymentIntentKonbiniRejectedConfirmationNumber,
// PaymentIntentPaymentAttemptExpired,
// PaymentIntentUnexpectedState,
// PaymentMethodBankAccountAlreadyVerified,
// PaymentMethodBankAccountBlocked,
// PaymentMethodBillingDetailsAddressMissing,
// PaymentMethodCurrencyMismatch,
// PaymentMethodInvalidParameter,
// PaymentMethodInvalidParameterTestmode,
// PaymentMethodMicrodepositFailed,
// PaymentMethodMicrodepositVerificationAmountsInvalid,
// PaymentMethodMicrodepositVerificationAmountsMismatch,
// PaymentMethodMicrodepositVerificationAttemptsExceeded,
// PaymentMethodMicrodepositVerificationDescriptorCodeMismatch,
// PaymentMethodMicrodepositVerificationTimeout,
// PaymentMethodProviderDecline,
// PaymentMethodProviderTimeout,
// PaymentMethodUnactivated,
// PaymentMethodUnexpectedState,
// PaymentMethodUnsupportedType,
// PayoutsNotAllowed,
// PlatformAccountRequired,
// PlatformApiKeyExpired,
// PostalCodeInvalid,
// ProcessingError,
// ProductInactive,
// RateLimit,
// ReferToCustomer,
// RefundDisputedPayment,
// ResourceAlreadyExists,
// ResourceMissing,
// ReturnIntentAlreadyProcessed,
// RoutingNumberInvalid,
// SecretKeyRequired,
// SepaUnsupportedAccount,
// SetupAttemptFailed,
// SetupIntentAuthenticationFailure,
// SetupIntentInvalidParameter,
// SetupIntentSetupAttemptExpired,
// SetupIntentUnexpectedState,
// ShippingCalculationFailed,
// SkuInactive,
// StateUnsupported,
// StatusTransitionInvalid,
// TaxIdInvalid,
// TaxesCalculationFailed,
// TerminalLocationCountryUnsupported,
// TestmodeChargesOnly,
// TlsVersionUnsupported,
// TokenInUse,
// TransferSourceBalanceParametersMismatch,
// TransfersNotAllowed,
// [#216]: https://github.com/juspay/orca/issues/216
// Implement the remaining stripe error codes
/*
AccountCountryInvalidAddress,
AccountErrorCountryChangeRequiresAdditionalSteps,
AccountInformationMismatch,
AccountInvalid,
AccountNumberInvalid,
AcssDebitSessionIncomplete,
AlipayUpgradeRequired,
AmountTooLarge,
AmountTooSmall,
ApiKeyExpired,
AuthenticationRequired,
BalanceInsufficient,
BankAccountBadRoutingNumbers,
BankAccountDeclined,
BankAccountExists,
BankAccountUnusable,
BankAccountUnverified,
BankAccountVerificationFailed,
BillingInvalidMandate,
BitcoinUpgradeRequired,
CardDeclineRateLimitExceeded,
CardDeclined,
CardholderPhoneNumberRequired,
ChargeAlreadyCaptured,
ChargeAlreadyRefunded,
ChargeDisputed,
ChargeExceedsSourceLimit,
ChargeExpiredForCapture,
ChargeInvalidParameter,
ClearingCodeUnsupported,
CountryCodeInvalid,
CountryUnsupported,
CouponExpired,
CustomerMaxPaymentMethods,
CustomerMaxSubscriptions,
DebitNotAuthorized,
EmailInvalid,
ExpiredCard,
IdempotencyKeyInUse,
IncorrectAddress,
IncorrectCvc,
IncorrectNumber,
IncorrectZip,
InstantPayoutsConfigDisabled,
InstantPayoutsCurrencyDisabled,
InstantPayoutsLimitExceeded,
InstantPayoutsUnsupported,
InsufficientFunds,
IntentInvalidState,
IntentVerificationMethodMissing,
InvalidCardType,
InvalidCharacters,
InvalidChargeAmount,
InvalidCvc,
InvalidExpiryMonth,
InvalidExpiryYear,
InvalidNumber,
InvalidSourceUsage,
InvoiceNoCustomerLineItems,
InvoiceNoPaymentMethodTypes,
InvoiceNoSubscriptionLineItems,
InvoiceNotEditable,
InvoiceOnBehalfOfNotEditable,
InvoicePaymentIntentRequiresAction,
InvoiceUpcomingNone,
LivemodeMismatch,
LockTimeout,
Missing,
NoAccount,
NotAllowedOnStandardAccount,
OutOfInventory,
ParameterInvalidEmpty,
ParameterInvalidInteger,
ParameterInvalidStringBlank,
ParameterInvalidStringEmpty,
ParametersExclusive,
PaymentIntentActionRequired,
PaymentIntentIncompatiblePaymentMethod,
PaymentIntentInvalidParameter,
PaymentIntentKonbiniRejectedConfirmationNumber,
PaymentIntentPaymentAttemptExpired,
PaymentIntentUnexpectedState,
PaymentMethodBankAccountAlreadyVerified,
PaymentMethodBankAccountBlocked,
PaymentMethodBillingDetailsAddressMissing,
PaymentMethodCurrencyMismatch,
PaymentMethodInvalidParameter,
PaymentMethodInvalidParameterTestmode,
PaymentMethodMicrodepositFailed,
PaymentMethodMicrodepositVerificationAmountsInvalid,
PaymentMethodMicrodepositVerificationAmountsMismatch,
PaymentMethodMicrodepositVerificationAttemptsExceeded,
PaymentMethodMicrodepositVerificationDescriptorCodeMismatch,
PaymentMethodMicrodepositVerificationTimeout,
PaymentMethodProviderDecline,
PaymentMethodProviderTimeout,
PaymentMethodUnactivated,
PaymentMethodUnexpectedState,
PaymentMethodUnsupportedType,
PayoutsNotAllowed,
PlatformAccountRequired,
PlatformApiKeyExpired,
PostalCodeInvalid,
ProcessingError,
ProductInactive,
RateLimit,
ReferToCustomer,
RefundDisputedPayment,
ResourceAlreadyExists,
ResourceMissing,
ReturnIntentAlreadyProcessed,
RoutingNumberInvalid,
SecretKeyRequired,
SepaUnsupportedAccount,
SetupAttemptFailed,
SetupIntentAuthenticationFailure,
SetupIntentInvalidParameter,
SetupIntentSetupAttemptExpired,
SetupIntentUnexpectedState,
ShippingCalculationFailed,
SkuInactive,
StateUnsupported,
StatusTransitionInvalid,
TaxIdInvalid,
TaxesCalculationFailed,
TerminalLocationCountryUnsupported,
TestmodeChargesOnly,
TlsVersionUnsupported,
TokenInUse,
TransferSourceBalanceParametersMismatch,
TransfersNotAllowed,
*/
}
impl ::core::fmt::Display for StripeErrorCode {