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.
351 352 353 354 355 356 |
# File 'lib/webpay/data_types.rb', line 351 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.
344 345 346 |
# File 'lib/webpay/data_types.rb', line 344 def attributes @attributes end |
Class Method Details
.fields ⇒ Object
346 347 348 |
# File 'lib/webpay/data_types.rb', line 346 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
373 374 375 |
# File 'lib/webpay/data_types.rb', line 373 def amount attributes['amount'] end |
#amount_refunded ⇒ Object
401 402 403 |
# File 'lib/webpay/data_types.rb', line 401 def amount_refunded attributes['amount_refunded'] end |
#captured ⇒ Object
393 394 395 |
# File 'lib/webpay/data_types.rb', line 393 def captured attributes['captured'] end |
#card ⇒ Object
377 378 379 |
# File 'lib/webpay/data_types.rb', line 377 def card attributes['card'] end |
#created ⇒ Object
381 382 383 |
# File 'lib/webpay/data_types.rb', line 381 def created attributes['created'] end |
#currency ⇒ Object
385 386 387 |
# File 'lib/webpay/data_types.rb', line 385 def currency attributes['currency'] end |
#customer ⇒ Object
405 406 407 |
# File 'lib/webpay/data_types.rb', line 405 def customer attributes['customer'] end |
#description ⇒ Object
417 418 419 |
# File 'lib/webpay/data_types.rb', line 417 def description attributes['description'] end |
#expire_time ⇒ Object
425 426 427 |
# File 'lib/webpay/data_types.rb', line 425 def expire_time attributes['expire_time'] end |
#failure_message ⇒ Object
421 422 423 |
# File 'lib/webpay/data_types.rb', line 421 def attributes['failure_message'] end |
#fees ⇒ Object
429 430 431 |
# File 'lib/webpay/data_types.rb', line 429 def fees attributes['fees'] end |
#id ⇒ Object
attributes accessors
361 362 363 |
# File 'lib/webpay/data_types.rb', line 361 def id attributes['id'] end |
#livemode ⇒ Object
369 370 371 |
# File 'lib/webpay/data_types.rb', line 369 def livemode attributes['livemode'] end |
#object ⇒ Object
365 366 367 |
# File 'lib/webpay/data_types.rb', line 365 def object attributes['object'] end |
#paid ⇒ Object
389 390 391 |
# File 'lib/webpay/data_types.rb', line 389 def paid attributes['paid'] end |
#recursion ⇒ Object
409 410 411 |
# File 'lib/webpay/data_types.rb', line 409 def recursion attributes['recursion'] end |
#refunded ⇒ Object
397 398 399 |
# File 'lib/webpay/data_types.rb', line 397 def refunded attributes['refunded'] end |
#shop ⇒ Object
413 414 415 |
# File 'lib/webpay/data_types.rb', line 413 def shop attributes['shop'] end |