Class: WebPay::ChargeRequestRefund
- Inherits:
-
Entity
- Object
- Entity
- WebPay::ChargeRequestRefund
show all
- Defined in:
- lib/webpay/data_types.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Entity
#normalize_hash, #to_h, #to_s
Constructor Details
Returns a new instance of ChargeRequestRefund.
501
502
503
504
|
# File 'lib/webpay/data_types.rb', line 501
def initialize(hash = {})
hash = normalize_hash(hash)
@attributes = hash
end
|
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
482
483
484
|
# File 'lib/webpay/data_types.rb', line 482
def attributes
@attributes
end
|
Class Method Details
.create(params) ⇒ Object
489
490
491
492
493
494
495
496
497
498
499
|
# File 'lib/webpay/data_types.rb', line 489
def self.create(params)
return params if params.is_a?(self)
hash = case params
when Hash; params
when WebPay::ChargeResponse; {'id' => params.id}
when String; {'id' => params}
else
raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
end
self.new(hash)
end
|
.fields ⇒ Object
484
485
486
|
# File 'lib/webpay/data_types.rb', line 484
def self.fields
['id', 'amount', 'uuid']
end
|
Instance Method Details
#amount ⇒ Object
529
530
531
|
# File 'lib/webpay/data_types.rb', line 529
def amount
attributes['amount']
end
|
#amount=(value) ⇒ Object
533
534
535
|
# File 'lib/webpay/data_types.rb', line 533
def amount=(value)
attributes['amount'] = value
end
|
#id ⇒ Object
521
522
523
|
# File 'lib/webpay/data_types.rb', line 521
def id
attributes['id']
end
|
#id=(value) ⇒ Object
525
526
527
|
# File 'lib/webpay/data_types.rb', line 525
def id=(value)
attributes['id'] = value
end
|
#query_params ⇒ Object
514
515
516
517
|
# File 'lib/webpay/data_types.rb', line 514
def query_params
result = {}
return result
end
|
#request_body ⇒ Object
507
508
509
510
511
512
|
# File 'lib/webpay/data_types.rb', line 507
def request_body
result = {}
copy_if_exists(@attributes, result, 'amount', 'request_body');
copy_if_exists(@attributes, result, 'uuid', 'request_body');
result
end
|
#uuid ⇒ Object
537
538
539
|
# File 'lib/webpay/data_types.rb', line 537
def uuid
attributes['uuid']
end
|
#uuid=(value) ⇒ Object
541
542
543
|
# File 'lib/webpay/data_types.rb', line 541
def uuid=(value)
attributes['uuid'] = value
end
|