tremendous_ruby 5.21.0 → 5.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/models/balance_transaction.rb +30 -3
  3. data/lib/tremendous/models/balance_transaction_order_payment.rb +32 -5
  4. data/lib/tremendous/models/campaign.rb +46 -1
  5. data/lib/tremendous/models/campaign_base.rb +46 -1
  6. data/lib/tremendous/models/connected_organization_organization.rb +11 -1
  7. data/lib/tremendous/models/create_campaign_request.rb +46 -1
  8. data/lib/tremendous/models/create_order200_response_order.rb +1 -1
  9. data/lib/tremendous/models/create_organization.rb +11 -1
  10. data/lib/tremendous/models/create_organization200_response_organization.rb +11 -1
  11. data/lib/tremendous/models/create_organization_for_response.rb +11 -1
  12. data/lib/tremendous/models/create_organization_properties.rb +11 -1
  13. data/lib/tremendous/models/create_organization_request.rb +14 -4
  14. data/lib/tremendous/models/create_topup_request.rb +1 -1
  15. data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +1 -1
  16. data/lib/tremendous/models/fraud_review.rb +1 -1
  17. data/lib/tremendous/models/fraud_review_related_rewards.rb +16 -5
  18. data/lib/tremendous/models/fraud_rules_list_item.rb +1 -1
  19. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +15 -5
  20. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner.rb +30 -3
  21. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order_payment.rb +32 -5
  22. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +46 -1
  23. data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +11 -1
  24. data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +1 -1
  25. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +44 -4
  26. data/lib/tremendous/models/list_orders200_response_orders_inner.rb +1 -1
  27. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +33 -6
  28. data/lib/tremendous/models/list_orders200_response_orders_inner_payment_refund.rb +33 -6
  29. data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +11 -1
  30. data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +1 -0
  31. data/lib/tremendous/models/list_topups200_response_topups_inner.rb +48 -7
  32. data/lib/tremendous/models/order.rb +1 -1
  33. data/lib/tremendous/models/order_base.rb +1 -1
  34. data/lib/tremendous/models/order_base_payment.rb +33 -6
  35. data/lib/tremendous/models/order_with_link.rb +1 -1
  36. data/lib/tremendous/models/order_without_link.rb +1 -1
  37. data/lib/tremendous/models/organization.rb +11 -1
  38. data/lib/tremendous/models/payment_details.rb +32 -5
  39. data/lib/tremendous/models/payment_details_refund.rb +33 -6
  40. data/lib/tremendous/models/recipient.rb +1 -0
  41. data/lib/tremendous/models/refund_details.rb +32 -5
  42. data/lib/tremendous/models/review_redeemed_rewards_amount.rb +1 -1
  43. data/lib/tremendous/models/single_reward_order_with_link_order.rb +1 -1
  44. data/lib/tremendous/models/single_reward_order_without_link_order.rb +1 -1
  45. data/lib/tremendous/models/topup.rb +48 -7
  46. data/lib/tremendous/models/topup_create_request.rb +1 -1
  47. data/lib/tremendous/models/update_campaign.rb +46 -1
  48. data/lib/tremendous/models/update_campaign_request.rb +46 -1
  49. data/lib/tremendous/version.rb +1 -1
  50. metadata +1 -1
@@ -18,16 +18,19 @@ module Tremendous
18
18
  # Unique identifier for the topup request.
19
19
  attr_accessor :id
20
20
 
21
- # Amount in USD intended to be added to your organizations balance.
21
+ # Amount to add to your organization's balance, denominated in `currency_code`.
22
22
  attr_accessor :amount
23
23
 
24
+ # Currency of the topup amount. Always matches the organization's currency.
25
+ attr_accessor :currency_code
26
+
24
27
  # Amount of the processing fee for the topup (typically reserved for credit card topups).
25
28
  attr_accessor :processing_fee
26
29
 
27
30
  # ID of the funding_source object used for this topup.
28
31
  attr_accessor :funding_source_id
29
32
 
30
- # Status of the topup <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> created </code> </td> <td> The topup is processing (and may be under review). </td> </tr> <tr> <td> <code> fully_credited </code> </td> <td> The funds have been added to the balance. </td> </tr> <tr> <td> <code> reversed </code> </td> <td> The topup was credited, but then reversed due to a chargeback or ACH return. </td> </tr> <tr> <td> <code> rejected </code> </td> <td> The topup was rejected by an admin. </td> </tr> </tbody> </table>
33
+ # Status of the topup <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> created </code> </td> <td> The topup is processing (and may be under review). </td> </tr> <tr> <td> <code> partially_credited </code> </td> <td> Some funds have been credited to the balance. The remainder will be credited by <code>expected_settlement_at</code>. </td> </tr> <tr> <td> <code> fully_credited </code> </td> <td> All funds have been added to the balance. </td> </tr> <tr> <td> <code> reversed </code> </td> <td> The topup was credited, but then reversed due to a chargeback or ACH return. </td> </tr> <tr> <td> <code> rejected </code> </td> <td> The topup was rejected by an admin. </td> </tr> </tbody> </table>
31
34
  attr_accessor :status
32
35
 
33
36
  # Timestamp indicating when the topup object was created (when the request was made).
@@ -48,11 +51,21 @@ module Tremendous
48
51
  # Idempotency key to prevent duplicate requests.
49
52
  attr_accessor :idempotency_key
50
53
 
54
+ # Amount credited to the balance immediately. Equals `amount` for non-ACH topups or ACH debits fully within instant funding limits. Can be 0 if nothing was credited instantly.
55
+ attr_accessor :instant_credit_amount
56
+
57
+ # Amount that will be available once the settlement period elapses. 0 if nothing is settling.
58
+ attr_accessor :settled_amount
59
+
60
+ # Timestamp indicating when the pending amount will be credited to the balance. Null if the topup was fully credited immediately.
61
+ attr_accessor :expected_settlement_at
62
+
51
63
  # Attribute mapping from ruby-style variable name to JSON key.
52
64
  def self.attribute_map
53
65
  {
54
66
  :'id' => :'id',
55
67
  :'amount' => :'amount',
68
+ :'currency_code' => :'currency_code',
56
69
  :'processing_fee' => :'processing_fee',
57
70
  :'funding_source_id' => :'funding_source_id',
58
71
  :'status' => :'status',
@@ -61,7 +74,10 @@ module Tremendous
61
74
  :'rejected_at' => :'rejected_at',
62
75
  :'reversed_at' => :'reversed_at',
63
76
  :'reversed_reason' => :'reversed_reason',
64
- :'idempotency_key' => :'idempotency_key'
77
+ :'idempotency_key' => :'idempotency_key',
78
+ :'instant_credit_amount' => :'instant_credit_amount',
79
+ :'settled_amount' => :'settled_amount',
80
+ :'expected_settlement_at' => :'expected_settlement_at'
65
81
  }
66
82
  end
67
83
 
@@ -80,6 +96,7 @@ module Tremendous
80
96
  {
81
97
  :'id' => :'String',
82
98
  :'amount' => :'Float',
99
+ :'currency_code' => :'String',
83
100
  :'processing_fee' => :'Float',
84
101
  :'funding_source_id' => :'String',
85
102
  :'status' => :'String',
@@ -88,7 +105,10 @@ module Tremendous
88
105
  :'rejected_at' => :'Time',
89
106
  :'reversed_at' => :'Time',
90
107
  :'reversed_reason' => :'String',
91
- :'idempotency_key' => :'String'
108
+ :'idempotency_key' => :'String',
109
+ :'instant_credit_amount' => :'Float',
110
+ :'settled_amount' => :'Float',
111
+ :'expected_settlement_at' => :'Date'
92
112
  }
93
113
  end
94
114
 
@@ -99,7 +119,8 @@ module Tremendous
99
119
  :'rejected_at',
100
120
  :'reversed_at',
101
121
  :'reversed_reason',
102
- :'idempotency_key'
122
+ :'idempotency_key',
123
+ :'expected_settlement_at'
103
124
  ])
104
125
  end
105
126
 
@@ -127,6 +148,10 @@ module Tremendous
127
148
  self.amount = attributes[:'amount']
128
149
  end
129
150
 
151
+ if attributes.key?(:'currency_code')
152
+ self.currency_code = attributes[:'currency_code']
153
+ end
154
+
130
155
  if attributes.key?(:'processing_fee')
131
156
  self.processing_fee = attributes[:'processing_fee']
132
157
  end
@@ -162,6 +187,18 @@ module Tremendous
162
187
  if attributes.key?(:'idempotency_key')
163
188
  self.idempotency_key = attributes[:'idempotency_key']
164
189
  end
190
+
191
+ if attributes.key?(:'instant_credit_amount')
192
+ self.instant_credit_amount = attributes[:'instant_credit_amount']
193
+ end
194
+
195
+ if attributes.key?(:'settled_amount')
196
+ self.settled_amount = attributes[:'settled_amount']
197
+ end
198
+
199
+ if attributes.key?(:'expected_settlement_at')
200
+ self.expected_settlement_at = attributes[:'expected_settlement_at']
201
+ end
165
202
  end
166
203
 
167
204
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -186,6 +223,7 @@ module Tremendous
186
223
  self.class == o.class &&
187
224
  id == o.id &&
188
225
  amount == o.amount &&
226
+ currency_code == o.currency_code &&
189
227
  processing_fee == o.processing_fee &&
190
228
  funding_source_id == o.funding_source_id &&
191
229
  status == o.status &&
@@ -194,7 +232,10 @@ module Tremendous
194
232
  rejected_at == o.rejected_at &&
195
233
  reversed_at == o.reversed_at &&
196
234
  reversed_reason == o.reversed_reason &&
197
- idempotency_key == o.idempotency_key
235
+ idempotency_key == o.idempotency_key &&
236
+ instant_credit_amount == o.instant_credit_amount &&
237
+ settled_amount == o.settled_amount &&
238
+ expected_settlement_at == o.expected_settlement_at
198
239
  end
199
240
 
200
241
  # @see the `==` method
@@ -206,7 +247,7 @@ module Tremendous
206
247
  # Calculates hash code according to all attributes.
207
248
  # @return [Integer] Hash code
208
249
  def hash
209
- [id, amount, processing_fee, funding_source_id, status, created_at, fully_credited_at, rejected_at, reversed_at, reversed_reason, idempotency_key].hash
250
+ [id, amount, currency_code, processing_fee, funding_source_id, status, created_at, fully_credited_at, rejected_at, reversed_at, reversed_reason, idempotency_key, instant_credit_amount, settled_amount, expected_settlement_at].hash
210
251
  end
211
252
 
212
253
  # Builds the object from hash
@@ -25,7 +25,7 @@ module Tremendous
25
25
  # ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
26
26
  attr_accessor :campaign_id
27
27
 
28
- # Date the order has been created
28
+ # Date the order was created
29
29
  attr_accessor :created_at
30
30
 
31
31
  # Execution status of a given order <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> CANCELED </code> </td> <td> The order and all of its rewards were canceled. </td> </tr> <tr> <td> <code> OPEN </code> </td> <td> The order has been created, but hasn't yet been processed. </td> </tr> <tr> <td> <code> EXECUTED </code> </td> <td> The order has been executed. Payment has been handled and rewards are being delivered (if applicable). </td> </tr> <tr> <td> <code> FAILED </code> </td> <td> The order could not be processed due to an error. E.g. due to insufficient funds in the account. </td> </tr> <tr> <td> <code> PENDING APPROVAL </code> </td> <td> The order has been created but needs approval to be executed. </td> </tr> <tr> <td> <code> PENDING INTERNAL PAYMENT APPROVAL </code> </td> <td> The order has been created but it is under review and requires approval from our team. </td> </tr> <tr> <td> <code> PENDING SETTLEMENT </code> </td> <td> The order has been created but the funds are being held until the settlement window clears. </td> </tr> </tbody> </table>
@@ -25,7 +25,7 @@ module Tremendous
25
25
  # ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
26
26
  attr_accessor :campaign_id
27
27
 
28
- # Date the order has been created
28
+ # Date the order was created
29
29
  attr_accessor :created_at
30
30
 
31
31
  # Execution status of a given order <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> CANCELED </code> </td> <td> The order and all of its rewards were canceled. </td> </tr> <tr> <td> <code> OPEN </code> </td> <td> The order has been created, but hasn't yet been processed. </td> </tr> <tr> <td> <code> EXECUTED </code> </td> <td> The order has been executed. Payment has been handled and rewards are being delivered (if applicable). </td> </tr> <tr> <td> <code> FAILED </code> </td> <td> The order could not be processed due to an error. E.g. due to insufficient funds in the account. </td> </tr> <tr> <td> <code> PENDING APPROVAL </code> </td> <td> The order has been created but needs approval to be executed. </td> </tr> <tr> <td> <code> PENDING INTERNAL PAYMENT APPROVAL </code> </td> <td> The order has been created but it is under review and requires approval from our team. </td> </tr> <tr> <td> <code> PENDING SETTLEMENT </code> </td> <td> The order has been created but the funds are being held until the settlement window clears. </td> </tr> </tbody> </table>
@@ -14,20 +14,23 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Tremendous
17
- # Cost breakdown of the order (cost of rewards + fees). Cost and fees are always denominated in USD, independent from the currency of the ordered rewards. Note that this property will only appear for processed orders (`status` is `EXECUTED`).
17
+ # Cost breakdown of the order (cost of rewards + fees). Cost and fees are denominated in the organization's currency (see payment `currency_code`), independent of the ordered rewards' currency. Note that this property will only appear for processed orders (`status` is `EXECUTED`).
18
18
  class OrderBasePayment
19
- # Total price of the order before fees (in USD)
19
+ # Total price of the order before fees, denominated in `currency_code`.
20
20
  attr_accessor :subtotal
21
21
 
22
- # Total price of the order including fees (in USD)
22
+ # Total price of the order including fees, denominated in `currency_code`.
23
23
  attr_accessor :total
24
24
 
25
- # Fees for the order (in USD)
25
+ # Fees for the order, denominated in `currency_code`.
26
26
  attr_accessor :fees
27
27
 
28
- # Discount for the order (in USD)
28
+ # Discount for the order, denominated in `currency_code`.
29
29
  attr_accessor :discount
30
30
 
31
+ # Currency in which the payment amounts (subtotal, total, fees, discount, refund) are denominated. This always matches the organization's currency.
32
+ attr_accessor :currency_code
33
+
31
34
  attr_accessor :refund
32
35
 
33
36
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -37,6 +40,7 @@ module Tremendous
37
40
  :'total' => :'total',
38
41
  :'fees' => :'fees',
39
42
  :'discount' => :'discount',
43
+ :'currency_code' => :'currency_code',
40
44
  :'refund' => :'refund'
41
45
  }
42
46
  end
@@ -58,6 +62,7 @@ module Tremendous
58
62
  :'total' => :'Float',
59
63
  :'fees' => :'Float',
60
64
  :'discount' => :'Float',
65
+ :'currency_code' => :'String',
61
66
  :'refund' => :'PaymentDetailsRefund'
62
67
  }
63
68
  end
@@ -108,6 +113,12 @@ module Tremendous
108
113
  self.discount = nil
109
114
  end
110
115
 
116
+ if attributes.key?(:'currency_code')
117
+ self.currency_code = attributes[:'currency_code']
118
+ else
119
+ self.currency_code = nil
120
+ end
121
+
111
122
  if attributes.key?(:'refund')
112
123
  self.refund = attributes[:'refund']
113
124
  end
@@ -150,6 +161,10 @@ module Tremendous
150
161
  invalid_properties.push('invalid value for "discount", must be greater than or equal to 0.')
151
162
  end
152
163
 
164
+ if @currency_code.nil?
165
+ invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
166
+ end
167
+
153
168
  invalid_properties
154
169
  end
155
170
 
@@ -165,6 +180,7 @@ module Tremendous
165
180
  return false if @fees < 0
166
181
  return false if @discount.nil?
167
182
  return false if @discount < 0
183
+ return false if @currency_code.nil?
168
184
  true
169
185
  end
170
186
 
@@ -224,6 +240,16 @@ module Tremendous
224
240
  @discount = discount
225
241
  end
226
242
 
243
+ # Custom attribute writer method with validation
244
+ # @param [Object] currency_code Value to be assigned
245
+ def currency_code=(currency_code)
246
+ if currency_code.nil?
247
+ fail ArgumentError, 'currency_code cannot be nil'
248
+ end
249
+
250
+ @currency_code = currency_code
251
+ end
252
+
227
253
  # Checks equality by comparing each attribute.
228
254
  # @param [Object] Object to be compared
229
255
  def ==(o)
@@ -233,6 +259,7 @@ module Tremendous
233
259
  total == o.total &&
234
260
  fees == o.fees &&
235
261
  discount == o.discount &&
262
+ currency_code == o.currency_code &&
236
263
  refund == o.refund
237
264
  end
238
265
 
@@ -245,7 +272,7 @@ module Tremendous
245
272
  # Calculates hash code according to all attributes.
246
273
  # @return [Integer] Hash code
247
274
  def hash
248
- [subtotal, total, fees, discount, refund].hash
275
+ [subtotal, total, fees, discount, currency_code, refund].hash
249
276
  end
250
277
 
251
278
  # Builds the object from hash
@@ -25,7 +25,7 @@ module Tremendous
25
25
  # ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
26
26
  attr_accessor :campaign_id
27
27
 
28
- # Date the order has been created
28
+ # Date the order was created
29
29
  attr_accessor :created_at
30
30
 
31
31
  # Execution status of a given order <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> CANCELED </code> </td> <td> The order and all of its rewards were canceled. </td> </tr> <tr> <td> <code> OPEN </code> </td> <td> The order has been created, but hasn't yet been processed. </td> </tr> <tr> <td> <code> EXECUTED </code> </td> <td> The order has been executed. Payment has been handled and rewards are being delivered (if applicable). </td> </tr> <tr> <td> <code> FAILED </code> </td> <td> The order could not be processed due to an error. E.g. due to insufficient funds in the account. </td> </tr> <tr> <td> <code> PENDING APPROVAL </code> </td> <td> The order has been created but needs approval to be executed. </td> </tr> <tr> <td> <code> PENDING INTERNAL PAYMENT APPROVAL </code> </td> <td> The order has been created but it is under review and requires approval from our team. </td> </tr> <tr> <td> <code> PENDING SETTLEMENT </code> </td> <td> The order has been created but the funds are being held until the settlement window clears. </td> </tr> </tbody> </table>
@@ -25,7 +25,7 @@ module Tremendous
25
25
  # ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
26
26
  attr_accessor :campaign_id
27
27
 
28
- # Date the order has been created
28
+ # Date the order was created
29
29
  attr_accessor :created_at
30
30
 
31
31
  # Execution status of a given order <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> CANCELED </code> </td> <td> The order and all of its rewards were canceled. </td> </tr> <tr> <td> <code> OPEN </code> </td> <td> The order has been created, but hasn't yet been processed. </td> </tr> <tr> <td> <code> EXECUTED </code> </td> <td> The order has been executed. Payment has been handled and rewards are being delivered (if applicable). </td> </tr> <tr> <td> <code> FAILED </code> </td> <td> The order could not be processed due to an error. E.g. due to insufficient funds in the account. </td> </tr> <tr> <td> <code> PENDING APPROVAL </code> </td> <td> The order has been created but needs approval to be executed. </td> </tr> <tr> <td> <code> PENDING INTERNAL PAYMENT APPROVAL </code> </td> <td> The order has been created but it is under review and requires approval from our team. </td> </tr> <tr> <td> <code> PENDING SETTLEMENT </code> </td> <td> The order has been created but the funds are being held until the settlement window clears. </td> </tr> </tbody> </table>
@@ -24,6 +24,9 @@ module Tremendous
24
24
  # URL of the website of that organization
25
25
  attr_accessor :website
26
26
 
27
+ # Currency used for this organization's balances, orders, and transactions.
28
+ attr_accessor :currency_code
29
+
27
30
  # Status of the organization. Organizations need to be approved to be able to use them to send out rewards.
28
31
  attr_accessor :status
29
32
 
@@ -58,6 +61,7 @@ module Tremendous
58
61
  :'id' => :'id',
59
62
  :'name' => :'name',
60
63
  :'website' => :'website',
64
+ :'currency_code' => :'currency_code',
61
65
  :'status' => :'status',
62
66
  :'created_at' => :'created_at'
63
67
  }
@@ -79,6 +83,7 @@ module Tremendous
79
83
  :'id' => :'String',
80
84
  :'name' => :'String',
81
85
  :'website' => :'String',
86
+ :'currency_code' => :'String',
82
87
  :'status' => :'String',
83
88
  :'created_at' => :'Date'
84
89
  }
@@ -122,6 +127,10 @@ module Tremendous
122
127
  self.website = nil
123
128
  end
124
129
 
130
+ if attributes.key?(:'currency_code')
131
+ self.currency_code = attributes[:'currency_code']
132
+ end
133
+
125
134
  if attributes.key?(:'status')
126
135
  self.status = attributes[:'status']
127
136
  end
@@ -217,6 +226,7 @@ module Tremendous
217
226
  id == o.id &&
218
227
  name == o.name &&
219
228
  website == o.website &&
229
+ currency_code == o.currency_code &&
220
230
  status == o.status &&
221
231
  created_at == o.created_at
222
232
  end
@@ -230,7 +240,7 @@ module Tremendous
230
240
  # Calculates hash code according to all attributes.
231
241
  # @return [Integer] Hash code
232
242
  def hash
233
- [id, name, website, status, created_at].hash
243
+ [id, name, website, currency_code, status, created_at].hash
234
244
  end
235
245
 
236
246
  # Builds the object from hash
@@ -15,18 +15,21 @@ require 'time'
15
15
 
16
16
  module Tremendous
17
17
  class PaymentDetails
18
- # Total price of the order before fees (in USD)
18
+ # Total price of the order before fees, denominated in `currency_code`.
19
19
  attr_accessor :subtotal
20
20
 
21
- # Total price of the order including fees (in USD)
21
+ # Total price of the order including fees, denominated in `currency_code`.
22
22
  attr_accessor :total
23
23
 
24
- # Fees for the order (in USD)
24
+ # Fees for the order, denominated in `currency_code`.
25
25
  attr_accessor :fees
26
26
 
27
- # Discount for the order (in USD)
27
+ # Discount for the order, denominated in `currency_code`.
28
28
  attr_accessor :discount
29
29
 
30
+ # Currency in which the payment amounts (subtotal, total, fees, discount, refund) are denominated. This always matches the organization's currency.
31
+ attr_accessor :currency_code
32
+
30
33
  attr_accessor :refund
31
34
 
32
35
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -36,6 +39,7 @@ module Tremendous
36
39
  :'total' => :'total',
37
40
  :'fees' => :'fees',
38
41
  :'discount' => :'discount',
42
+ :'currency_code' => :'currency_code',
39
43
  :'refund' => :'refund'
40
44
  }
41
45
  end
@@ -57,6 +61,7 @@ module Tremendous
57
61
  :'total' => :'Float',
58
62
  :'fees' => :'Float',
59
63
  :'discount' => :'Float',
64
+ :'currency_code' => :'String',
60
65
  :'refund' => :'PaymentDetailsRefund'
61
66
  }
62
67
  end
@@ -107,6 +112,12 @@ module Tremendous
107
112
  self.discount = nil
108
113
  end
109
114
 
115
+ if attributes.key?(:'currency_code')
116
+ self.currency_code = attributes[:'currency_code']
117
+ else
118
+ self.currency_code = nil
119
+ end
120
+
110
121
  if attributes.key?(:'refund')
111
122
  self.refund = attributes[:'refund']
112
123
  end
@@ -149,6 +160,10 @@ module Tremendous
149
160
  invalid_properties.push('invalid value for "discount", must be greater than or equal to 0.')
150
161
  end
151
162
 
163
+ if @currency_code.nil?
164
+ invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
165
+ end
166
+
152
167
  invalid_properties
153
168
  end
154
169
 
@@ -164,6 +179,7 @@ module Tremendous
164
179
  return false if @fees < 0
165
180
  return false if @discount.nil?
166
181
  return false if @discount < 0
182
+ return false if @currency_code.nil?
167
183
  true
168
184
  end
169
185
 
@@ -223,6 +239,16 @@ module Tremendous
223
239
  @discount = discount
224
240
  end
225
241
 
242
+ # Custom attribute writer method with validation
243
+ # @param [Object] currency_code Value to be assigned
244
+ def currency_code=(currency_code)
245
+ if currency_code.nil?
246
+ fail ArgumentError, 'currency_code cannot be nil'
247
+ end
248
+
249
+ @currency_code = currency_code
250
+ end
251
+
226
252
  # Checks equality by comparing each attribute.
227
253
  # @param [Object] Object to be compared
228
254
  def ==(o)
@@ -232,6 +258,7 @@ module Tremendous
232
258
  total == o.total &&
233
259
  fees == o.fees &&
234
260
  discount == o.discount &&
261
+ currency_code == o.currency_code &&
235
262
  refund == o.refund
236
263
  end
237
264
 
@@ -244,7 +271,7 @@ module Tremendous
244
271
  # Calculates hash code according to all attributes.
245
272
  # @return [Integer] Hash code
246
273
  def hash
247
- [subtotal, total, fees, discount, refund].hash
274
+ [subtotal, total, fees, discount, currency_code, refund].hash
248
275
  end
249
276
 
250
277
  # Builds the object from hash
@@ -14,15 +14,19 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Tremendous
17
- # Breakdown of the order refunds (total amount in USD, independent from the currency of the ordered rewards). Note that this property will only appear for canceled orders or orders with canceled rewards.
17
+ # Breakdown of the order refunds (total denominated in `currency_code`, independent of the ordered rewards' currency). Note that this property will only appear for canceled orders or orders with canceled rewards.
18
18
  class PaymentDetailsRefund
19
- # Total amount of the order refunds (in USD)
19
+ # Total amount of the order refunds, denominated in `currency_code`.
20
20
  attr_accessor :total
21
21
 
22
+ # Currency of the refund. Always matches the organization's currency.
23
+ attr_accessor :currency_code
24
+
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
23
26
  def self.attribute_map
24
27
  {
25
- :'total' => :'total'
28
+ :'total' => :'total',
29
+ :'currency_code' => :'currency_code'
26
30
  }
27
31
  end
28
32
 
@@ -39,7 +43,8 @@ module Tremendous
39
43
  # Attribute type mapping.
40
44
  def self.openapi_types
41
45
  {
42
- :'total' => :'Float'
46
+ :'total' => :'Float',
47
+ :'currency_code' => :'String'
43
48
  }
44
49
  end
45
50
 
@@ -70,6 +75,12 @@ module Tremendous
70
75
  else
71
76
  self.total = nil
72
77
  end
78
+
79
+ if attributes.key?(:'currency_code')
80
+ self.currency_code = attributes[:'currency_code']
81
+ else
82
+ self.currency_code = nil
83
+ end
73
84
  end
74
85
 
75
86
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -85,6 +96,10 @@ module Tremendous
85
96
  invalid_properties.push('invalid value for "total", must be greater than or equal to 0.')
86
97
  end
87
98
 
99
+ if @currency_code.nil?
100
+ invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
101
+ end
102
+
88
103
  invalid_properties
89
104
  end
90
105
 
@@ -94,6 +109,7 @@ module Tremendous
94
109
  warn '[DEPRECATED] the `valid?` method is obsolete'
95
110
  return false if @total.nil?
96
111
  return false if @total < 0
112
+ return false if @currency_code.nil?
97
113
  true
98
114
  end
99
115
 
@@ -111,12 +127,23 @@ module Tremendous
111
127
  @total = total
112
128
  end
113
129
 
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] currency_code Value to be assigned
132
+ def currency_code=(currency_code)
133
+ if currency_code.nil?
134
+ fail ArgumentError, 'currency_code cannot be nil'
135
+ end
136
+
137
+ @currency_code = currency_code
138
+ end
139
+
114
140
  # Checks equality by comparing each attribute.
115
141
  # @param [Object] Object to be compared
116
142
  def ==(o)
117
143
  return true if self.equal?(o)
118
144
  self.class == o.class &&
119
- total == o.total
145
+ total == o.total &&
146
+ currency_code == o.currency_code
120
147
  end
121
148
 
122
149
  # @see the `==` method
@@ -128,7 +155,7 @@ module Tremendous
128
155
  # Calculates hash code according to all attributes.
129
156
  # @return [Integer] Hash code
130
157
  def hash
131
- [total].hash
158
+ [total, currency_code].hash
132
159
  end
133
160
 
134
161
  # Builds the object from hash
@@ -56,6 +56,7 @@ module Tremendous
56
56
  # List of attributes with nullable: true
57
57
  def self.openapi_nullable
58
58
  Set.new([
59
+ :'name',
59
60
  ])
60
61
  end
61
62
 
@@ -15,13 +15,17 @@ require 'time'
15
15
 
16
16
  module Tremendous
17
17
  class RefundDetails
18
- # Total amount of the order refunds (in USD)
18
+ # Total amount of the order refunds, denominated in `currency_code`.
19
19
  attr_accessor :total
20
20
 
21
+ # Currency of the refund. Always matches the organization's currency.
22
+ attr_accessor :currency_code
23
+
21
24
  # Attribute mapping from ruby-style variable name to JSON key.
22
25
  def self.attribute_map
23
26
  {
24
- :'total' => :'total'
27
+ :'total' => :'total',
28
+ :'currency_code' => :'currency_code'
25
29
  }
26
30
  end
27
31
 
@@ -38,7 +42,8 @@ module Tremendous
38
42
  # Attribute type mapping.
39
43
  def self.openapi_types
40
44
  {
41
- :'total' => :'Float'
45
+ :'total' => :'Float',
46
+ :'currency_code' => :'String'
42
47
  }
43
48
  end
44
49
 
@@ -69,6 +74,12 @@ module Tremendous
69
74
  else
70
75
  self.total = nil
71
76
  end
77
+
78
+ if attributes.key?(:'currency_code')
79
+ self.currency_code = attributes[:'currency_code']
80
+ else
81
+ self.currency_code = nil
82
+ end
72
83
  end
73
84
 
74
85
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -84,6 +95,10 @@ module Tremendous
84
95
  invalid_properties.push('invalid value for "total", must be greater than or equal to 0.')
85
96
  end
86
97
 
98
+ if @currency_code.nil?
99
+ invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
100
+ end
101
+
87
102
  invalid_properties
88
103
  end
89
104
 
@@ -93,6 +108,7 @@ module Tremendous
93
108
  warn '[DEPRECATED] the `valid?` method is obsolete'
94
109
  return false if @total.nil?
95
110
  return false if @total < 0
111
+ return false if @currency_code.nil?
96
112
  true
97
113
  end
98
114
 
@@ -110,12 +126,23 @@ module Tremendous
110
126
  @total = total
111
127
  end
112
128
 
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] currency_code Value to be assigned
131
+ def currency_code=(currency_code)
132
+ if currency_code.nil?
133
+ fail ArgumentError, 'currency_code cannot be nil'
134
+ end
135
+
136
+ @currency_code = currency_code
137
+ end
138
+
113
139
  # Checks equality by comparing each attribute.
114
140
  # @param [Object] Object to be compared
115
141
  def ==(o)
116
142
  return true if self.equal?(o)
117
143
  self.class == o.class &&
118
- total == o.total
144
+ total == o.total &&
145
+ currency_code == o.currency_code
119
146
  end
120
147
 
121
148
  # @see the `==` method
@@ -127,7 +154,7 @@ module Tremendous
127
154
  # Calculates hash code according to all attributes.
128
155
  # @return [Integer] Hash code
129
156
  def hash
130
- [total].hash
157
+ [total, currency_code].hash
131
158
  end
132
159
 
133
160
  # Builds the object from hash
@@ -16,7 +16,7 @@ require 'time'
16
16
  module Tremendous
17
17
  # If a recipient, device, or IP redeems more than this dollar value of rewards, flag for review.
18
18
  class ReviewRedeemedRewardsAmount
19
- # The total amount in USD of redeemed rewards to use as a threshold.
19
+ # The total amount of redeemed rewards to use as a threshold. The amount is denominated in the organization's currency.
20
20
  attr_accessor :amount
21
21
 
22
22
  # The period, in days, to consider for the count. Use `all_time` to consider any redeemed rewards.