Class: WebPay::ChargeResponse
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
- #amount ⇒ Object
- #amount_refunded ⇒ Object
- #captured ⇒ Object
- #card ⇒ Object
- #created ⇒ Object
- #currency ⇒ Object
- #customer ⇒ Object
- #description ⇒ Object
- #expire_time ⇒ Object
- #failure_message ⇒ Object
- #fees ⇒ Object
-
#id ⇒ Object
attributes accessors.
-
#initialize(hash = {}) ⇒ ChargeResponse
constructor
A new instance of ChargeResponse.
- #livemode ⇒ Object
- #object ⇒ Object
- #paid ⇒ Object
- #recursion ⇒ Object
- #refunded ⇒ Object
- #shop ⇒ Object
Methods inherited from Entity
Constructor Details
#initialize(hash = {}) ⇒ ChargeResponse
Returns a new instance of ChargeResponse.
257 258 259 260 261 262 |
# File 'lib/webpay/data_types.rb', line 257 def initialize(hash = {}) hash = normalize_hash(hash) hash['card'] = WebPay::CardResponse.new(hash['card']) if hash['card'].is_a?(Hash) hash['fees'] = hash['fees'].is_a?(Array) ? hash['fees'].map { |x| WebPay::ChargeFeeResponse.new(x) if x.is_a?(Hash) } : hash['fees'] @attributes = hash end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
250 251 252 |
# File 'lib/webpay/data_types.rb', line 250 def attributes @attributes end |
Class Method Details
.fields ⇒ Object
252 253 254 |
# File 'lib/webpay/data_types.rb', line 252 def self.fields ['id', 'object', 'livemode', 'amount', 'card', 'created', 'currency', 'paid', 'captured', 'refunded', 'amount_refunded', 'customer', 'recursion', 'shop', 'description', 'failure_message', 'expire_time', 'fees'] end |
Instance Method Details
#amount ⇒ Object
279 280 281 |
# File 'lib/webpay/data_types.rb', line 279 def amount attributes['amount'] end |
#amount_refunded ⇒ Object
307 308 309 |
# File 'lib/webpay/data_types.rb', line 307 def amount_refunded attributes['amount_refunded'] end |
#captured ⇒ Object
299 300 301 |
# File 'lib/webpay/data_types.rb', line 299 def captured attributes['captured'] end |
#card ⇒ Object
283 284 285 |
# File 'lib/webpay/data_types.rb', line 283 def card attributes['card'] end |
#created ⇒ Object
287 288 289 |
# File 'lib/webpay/data_types.rb', line 287 def created attributes['created'] end |
#currency ⇒ Object
291 292 293 |
# File 'lib/webpay/data_types.rb', line 291 def currency attributes['currency'] end |
#customer ⇒ Object
311 312 313 |
# File 'lib/webpay/data_types.rb', line 311 def customer attributes['customer'] end |
#description ⇒ Object
323 324 325 |
# File 'lib/webpay/data_types.rb', line 323 def description attributes['description'] end |
#expire_time ⇒ Object
331 332 333 |
# File 'lib/webpay/data_types.rb', line 331 def expire_time attributes['expire_time'] end |
#failure_message ⇒ Object
327 328 329 |
# File 'lib/webpay/data_types.rb', line 327 def attributes['failure_message'] end |
#fees ⇒ Object
335 336 337 |
# File 'lib/webpay/data_types.rb', line 335 def fees attributes['fees'] end |
#id ⇒ Object
attributes accessors
267 268 269 |
# File 'lib/webpay/data_types.rb', line 267 def id attributes['id'] end |
#livemode ⇒ Object
275 276 277 |
# File 'lib/webpay/data_types.rb', line 275 def livemode attributes['livemode'] end |
#object ⇒ Object
271 272 273 |
# File 'lib/webpay/data_types.rb', line 271 def object attributes['object'] end |
#paid ⇒ Object
295 296 297 |
# File 'lib/webpay/data_types.rb', line 295 def paid attributes['paid'] end |
#recursion ⇒ Object
315 316 317 |
# File 'lib/webpay/data_types.rb', line 315 def recursion attributes['recursion'] end |
#refunded ⇒ Object
303 304 305 |
# File 'lib/webpay/data_types.rb', line 303 def refunded attributes['refunded'] end |
#shop ⇒ Object
319 320 321 |
# File 'lib/webpay/data_types.rb', line 319 def shop attributes['shop'] end |