Class: MundiApi::CreateCaptureChargeRequest
- Defined in:
- lib/mundi_api/models/create_capture_charge_request.rb
Overview
Request for capturing a charge
Instance Attribute Summary collapse
-
#amount ⇒ Integer
The amount that will be captured.
-
#code ⇒ String
Code for the charge.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(code = nil, amount = nil) ⇒ CreateCaptureChargeRequest
constructor
A new instance of CreateCaptureChargeRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(code = nil, amount = nil) ⇒ CreateCaptureChargeRequest
Returns a new instance of CreateCaptureChargeRequest.
26 27 28 29 30 |
# File 'lib/mundi_api/models/create_capture_charge_request.rb', line 26 def initialize(code = nil, amount = nil) @code = code @amount = amount end |
Instance Attribute Details
#amount ⇒ Integer
The amount that will be captured
14 15 16 |
# File 'lib/mundi_api/models/create_capture_charge_request.rb', line 14 def amount @amount end |
#code ⇒ String
Code for the charge. Sending this field will update the code send on the charge and order creation.
10 11 12 |
# File 'lib/mundi_api/models/create_capture_charge_request.rb', line 10 def code @code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/mundi_api/models/create_capture_charge_request.rb', line 33 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. code = hash['code'] amount = hash['amount'] # Create object from extracted values. CreateCaptureChargeRequest.new(code, amount) end |
.names ⇒ Object
A mapping from model property names to API property names.
17 18 19 20 21 22 23 24 |
# File 'lib/mundi_api/models/create_capture_charge_request.rb', line 17 def self.names if @_hash.nil? @_hash = {} @_hash['code'] = 'code' @_hash['amount'] = 'amount' end @_hash end |