-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
103 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
class ErrorObject < StripeObject | ||
# Unlike other objects, we explicitly declare getter methods here. This | ||
# is because the API doesn't return `null` values for fields on this | ||
# object, rather the fields are omitted entirely. Not declaring the getter | ||
# methods would cause users to run into `NoMethodError` exceptions and | ||
# prevent generic error handling. | ||
|
||
def charge | ||
@values[:charge] | ||
end | ||
|
||
def code | ||
@values[:code] | ||
end | ||
|
||
def doc_url | ||
@values[:doc_url] | ||
end | ||
|
||
def message | ||
@values[:message] | ||
end | ||
|
||
def param | ||
@values[:param] | ||
end | ||
|
||
def payment_intent | ||
@values[:payment_intent] | ||
end | ||
|
||
def payment_method | ||
@values[:payment_method] | ||
end | ||
|
||
def setup_intent | ||
@values[:setup_intent] | ||
end | ||
|
||
def source | ||
@values[:source] | ||
end | ||
|
||
def type | ||
@values[:type] | ||
end | ||
|
||
# For OAuth errors | ||
|
||
def oauth_error | ||
@values[:error] | ||
end | ||
|
||
def oauth_error_description | ||
@values[:error_description] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters