Class: ProcessOut::PayoutItemAmountBreakdowns
- Inherits:
-
Object
- Object
- ProcessOut::PayoutItemAmountBreakdowns
- Defined in:
- lib/processout/payout_item_amount_breakdowns.rb
Instance Attribute Summary collapse
-
#acquirer_fee ⇒ Object
Returns the value of attribute acquirer_fee.
-
#gateway_fee ⇒ Object
Returns the value of attribute gateway_fee.
-
#interchange_fee ⇒ Object
Returns the value of attribute interchange_fee.
-
#markup_fee ⇒ Object
Returns the value of attribute markup_fee.
-
#other_fee ⇒ Object
Returns the value of attribute other_fee.
-
#scheme_fee ⇒ Object
Returns the value of attribute scheme_fee.
Instance Method Summary collapse
-
#fill_with_data(data) ⇒ Object
- Fills the object with data coming from the API Params:
data
-
Hash
of data coming from the API.
- Fills the object with data coming from the API Params:
-
#initialize(client, data = {}) ⇒ PayoutItemAmountBreakdowns
constructor
- Initializes the PayoutItemAmountBreakdowns object Params:
client
ProcessOut
client instancedata
-
data that can be used to fill the object.
- Initializes the PayoutItemAmountBreakdowns object Params:
-
#new(data = {}) ⇒ Object
Create a new PayoutItemAmountBreakdowns using the current client.
-
#prefill(data) ⇒ Object
- Prefills the object with the data passed as parameters Params:
data
-
Hash
of data.
- Prefills the object with the data passed as parameters Params:
-
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want.
Constructor Details
#initialize(client, data = {}) ⇒ PayoutItemAmountBreakdowns
Initializes the PayoutItemAmountBreakdowns object Params:
client
-
ProcessOut
client instance data
-
data that can be used to fill the object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 48 def initialize(client, data = {}) @client = client self.scheme_fee = data.fetch(:scheme_fee, nil) self.interchange_fee = data.fetch(:interchange_fee, nil) self.gateway_fee = data.fetch(:gateway_fee, nil) self.markup_fee = data.fetch(:markup_fee, nil) self.acquirer_fee = data.fetch(:acquirer_fee, nil) self.other_fee = data.fetch(:other_fee, nil) end |
Instance Attribute Details
#acquirer_fee ⇒ Object
Returns the value of attribute acquirer_fee.
15 16 17 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 15 def acquirer_fee @acquirer_fee end |
#gateway_fee ⇒ Object
Returns the value of attribute gateway_fee.
13 14 15 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 13 def gateway_fee @gateway_fee end |
#interchange_fee ⇒ Object
Returns the value of attribute interchange_fee.
12 13 14 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 12 def interchange_fee @interchange_fee end |
#markup_fee ⇒ Object
Returns the value of attribute markup_fee.
14 15 16 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 14 def markup_fee @markup_fee end |
#other_fee ⇒ Object
Returns the value of attribute other_fee.
16 17 18 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 16 def other_fee @other_fee end |
#scheme_fee ⇒ Object
Returns the value of attribute scheme_fee.
11 12 13 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 11 def scheme_fee @scheme_fee end |
Instance Method Details
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
data
-
Hash
of data coming from the API
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 80 def fill_with_data(data) if data.nil? return self end if data.include? "scheme_fee" self.scheme_fee = data["scheme_fee"] end if data.include? "interchange_fee" self.interchange_fee = data["interchange_fee"] end if data.include? "gateway_fee" self.gateway_fee = data["gateway_fee"] end if data.include? "markup_fee" self.markup_fee = data["markup_fee"] end if data.include? "acquirer_fee" self.acquirer_fee = data["acquirer_fee"] end if data.include? "other_fee" self.other_fee = data["other_fee"] end self end |
#new(data = {}) ⇒ Object
Create a new PayoutItemAmountBreakdowns using the current client
61 62 63 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 61 def new(data = {}) PayoutItemAmountBreakdowns.new(@client, data) end |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data
-
Hash
of data
109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 109 def prefill(data) if data.nil? return self end self.scheme_fee = data.fetch(:scheme_fee, self.scheme_fee) self.interchange_fee = data.fetch(:interchange_fee, self.interchange_fee) self.gateway_fee = data.fetch(:gateway_fee, self.gateway_fee) self.markup_fee = data.fetch(:markup_fee, self.markup_fee) self.acquirer_fee = data.fetch(:acquirer_fee, self.acquirer_fee) self.other_fee = data.fetch(:other_fee, self.other_fee) self end |
#to_json(options) ⇒ Object
Overrides the JSON marshaller to only send the fields we want
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/processout/payout_item_amount_breakdowns.rb', line 66 def to_json() { "scheme_fee": self.scheme_fee, "interchange_fee": self.interchange_fee, "gateway_fee": self.gateway_fee, "markup_fee": self.markup_fee, "acquirer_fee": self.acquirer_fee, "other_fee": self.other_fee, }.to_json end |