Module: PayPal::Common::Response
- Includes:
- Base
- Included in:
- AdaptivePayments::Response::Details, AdaptivePayments::Response::Pay, AdaptivePayments::Response::PayOptions, AdaptivePayments::Response::Preapproval, AdaptivePayments::Response::Refund, AdaptivePayments::Response::ShippingAddress, Invoice::Response::Details, Invoice::Response::Invoice, Invoice::Response::Search, Permissions::Response::Permission, Permissions::Response::PersonalData, Permissions::Response::Token
- Defined in:
- lib/paypal/common/response.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Base
#after_initialize, #build_datetime, #build_value, #camelize, #hash_keys, #initialize, #request, #to_hash, #to_json, #underscore
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
7
8
9
|
# File 'lib/paypal/common/response.rb', line 7
def error
@error
end
|
#response_envelope ⇒ Object
Returns the value of attribute response_envelope.
8
9
10
|
# File 'lib/paypal/common/response.rb', line 8
def response_envelope
@response_envelope
end
|
Instance Method Details
#errors ⇒ Object
14
15
16
|
# File 'lib/paypal/common/response.rb', line 14
def errors
@error||[]
end
|
#set_error(value) ⇒ Object
18
19
20
|
# File 'lib/paypal/common/response.rb', line 18
def set_error(value)
self.error = build_value(ErrorData, value)
end
|
#set_response_envelope(value) ⇒ Object
10
11
12
|
# File 'lib/paypal/common/response.rb', line 10
def set_response_envelope(value)
self.response_envelope = ResponseEnvelope.new(value)
end
|
#success? ⇒ Boolean
26
27
28
|
# File 'lib/paypal/common/response.rb', line 26
def success?
self.response_envelope.success?
end
|
#valid? ⇒ Boolean
30
31
32
|
# File 'lib/paypal/common/response.rb', line 30
def valid?
(self.errors||[]).empty?
end
|