Skip to content

Commit 0b66478

Browse files
Add ErrorObject rbi file (#1906)
1 parent 0f910c9 commit 0b66478

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

rbi/stripe/error_object.rbi

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# frozen_string_literal: true
2+
# typed: true
3+
4+
module Stripe
5+
class ErrorObject < StripeObject
6+
# errorFields: The beginning of the section generated from our OpenAPI spec
7+
# For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one.
8+
sig { returns(T.nilable(String)) }
9+
def advice_code; end
10+
11+
# For card errors, the ID of the failed charge.
12+
sig { returns(T.nilable(String)) }
13+
def charge; end
14+
15+
# For some errors that could be handled programmatically, a short string indicating the [error code](https://docs.stripe.com/error-codes) reported.
16+
sig { returns(T.nilable(String)) }
17+
def code; end
18+
19+
# For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://docs.stripe.com/declines#issuer-declines) if they provide one.
20+
sig { returns(T.nilable(String)) }
21+
def decline_code; end
22+
23+
# A URL to more information about the [error code](https://docs.stripe.com/error-codes) reported.
24+
sig { returns(T.nilable(String)) }
25+
def doc_url; end
26+
27+
# A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
28+
sig { returns(T.nilable(String)) }
29+
def message; end
30+
31+
# For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
32+
sig { returns(T.nilable(String)) }
33+
def network_advice_code; end
34+
35+
# For payments declined by the network, an alphanumeric code which indicates the reason the payment failed.
36+
sig { returns(T.nilable(String)) }
37+
def network_decline_code; end
38+
39+
# If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
40+
sig { returns(T.nilable(String)) }
41+
def param; end
42+
43+
# The PaymentIntent object for errors returned on a request involving a PaymentIntent.
44+
sig { returns(T.nilable(::Stripe::PaymentIntent)) }
45+
def payment_intent; end
46+
47+
# The PaymentMethod object for errors returned on a request involving a PaymentMethod.
48+
sig { returns(T.nilable(::Stripe::PaymentMethod)) }
49+
def payment_method; end
50+
51+
# If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
52+
sig { returns(T.nilable(String)) }
53+
def payment_method_type; end
54+
55+
# A URL to the request log entry in your dashboard.
56+
sig { returns(T.nilable(String)) }
57+
def request_log_url; end
58+
59+
# The SetupIntent object for errors returned on a request involving a SetupIntent.
60+
sig { returns(T.nilable(::Stripe::SetupIntent)) }
61+
def setup_intent; end
62+
63+
# The PaymentSource object for errors returned on a request involving a PaymentSource.
64+
sig {
65+
returns(T.nilable(T.any(::Stripe::Account, ::Stripe::BankAccount, ::Stripe::Card, ::Stripe::Source)))
66+
}
67+
def source; end
68+
69+
# The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
70+
sig { returns(String) }
71+
def type; end
72+
73+
# The user message associated with the error.
74+
sig { returns(T.nilable(String)) }
75+
def user_message; end
76+
77+
# errorFields: The end of the section generated from our OpenAPI spec
78+
end
79+
80+
class OAuthErrorObject < StripeObject
81+
sig { returns(T.nilable(String)) }
82+
def error; end
83+
84+
sig { returns(T.nilable(String)) }
85+
def error_description; end
86+
end
87+
88+
end

0 commit comments

Comments
 (0)