#[non_exhaustive]pub enum PaymentError {
Show 24 variants
InvalidAmount(i64),
InvalidCurrencyCode(String),
InvalidCountryCode(String),
InvalidReference(String),
InvalidIdempotencyKey(String),
InvalidPhoneNumber(String),
InvalidUrl(String),
MissingRequiredField(&'static str),
InvalidConfiguration(String),
ConnectorNotConfigured {
provider: PaymentProvider,
},
UnsupportedPaymentMethod(String),
UnsupportedCountry(CountryCode),
UnsupportedCurrency(CurrencyCode),
UnsupportedPaymentRoute {
method: String,
country: Option<CountryCode>,
},
AuthenticationFailed,
ProviderRequestFailed {
provider: PaymentProvider,
status: u16,
message: String,
},
ProviderDetails {
details: ProviderErrorDetails,
},
ProviderUnavailable(PaymentProvider),
RateLimited(PaymentProvider),
WebhookVerificationFailed,
InvalidWebhookPayload(String),
UnsupportedOperation(String),
Http(Error),
Json(Error),
}Expand description
PayRail error type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidAmount(i64)
Invalid positive amount.
InvalidCurrencyCode(String)
Invalid currency code.
InvalidCountryCode(String)
Invalid country code.
InvalidReference(String)
Invalid reference.
InvalidIdempotencyKey(String)
Invalid idempotency key.
InvalidPhoneNumber(String)
Invalid phone number.
InvalidUrl(String)
Invalid URL.
MissingRequiredField(&'static str)
A required field was missing.
InvalidConfiguration(String)
Invalid configuration.
ConnectorNotConfigured
Connector is not configured.
Fields
§
provider: PaymentProviderUnsupportedPaymentMethod(String)
Unsupported payment method.
UnsupportedCountry(CountryCode)
Unsupported country.
UnsupportedCurrency(CurrencyCode)
Unsupported currency.
UnsupportedPaymentRoute
Unsupported route.
AuthenticationFailed
Provider authentication failed.
ProviderRequestFailed
Provider request failed.
Fields
§
provider: PaymentProviderProvider.
ProviderDetails
Redacted provider details.
Fields
§
details: ProviderErrorDetailsDetails.
Provider unavailable.
RateLimited(PaymentProvider)
Provider rate limited.
WebhookVerificationFailed
Webhook verification failed.
InvalidWebhookPayload(String)
Invalid webhook payload.
UnsupportedOperation(String)
Unsupported operation.
Http(Error)
HTTP error.
Json(Error)
JSON error.
Trait Implementations§
Source§impl Debug for PaymentError
impl Debug for PaymentError
Source§impl Display for PaymentError
impl Display for PaymentError
Source§impl Error for PaymentError
impl Error for PaymentError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for PaymentError
impl From<Error> for PaymentError
Auto Trait Implementations§
impl Freeze for PaymentError
impl !RefUnwindSafe for PaymentError
impl Send for PaymentError
impl Sync for PaymentError
impl Unpin for PaymentError
impl UnsafeUnpin for PaymentError
impl !UnwindSafe for PaymentError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.