Class: Pago::V2026_04::Models::RefundCreate
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ metadata: "metadata", order_id: "order_id", reason: "reason", amount: "amount", comment: "comment", revoke_benefits: "revoke_benefits" }.freeze
- REQUIRED_KEYS =
["order_id", "reason", "amount"].freeze
Instance Attribute Summary collapse
-
#amount ⇒ Integer
readonly
Amount to refund in cents.
-
#comment ⇒ String?
readonly
An internal comment about the refund.
-
#metadata ⇒ Hash{String => String, Integer, Float, Boolean}
readonly
Key-value object allowing you to store additional information.
- #order_id ⇒ String readonly
-
#reason ⇒ String
readonly
Reason for the refund.
-
#revoke_benefits ⇒ Boolean
readonly
Should this refund trigger the associated customer benefits to be revoked?.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metadata: ::Pago::UNSET, order_id:, reason:, amount:, comment: ::Pago::UNSET, revoke_benefits: ::Pago::UNSET) ⇒ RefundCreate
constructor
A new instance of RefundCreate.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(metadata: ::Pago::UNSET, order_id:, reason:, amount:, comment: ::Pago::UNSET, revoke_benefits: ::Pago::UNSET) ⇒ RefundCreate
Returns a new instance of RefundCreate.
38379 38380 38381 38382 38383 38384 38385 38386 38387 38388 38389 38390 38391 38392 38393 38394 |
# File 'lib/pago/v2026_04/models.rb', line 38379 def initialize( metadata: ::Pago::UNSET, order_id:, reason:, amount:, comment: ::Pago::UNSET, revoke_benefits: ::Pago::UNSET ) super() assign(:metadata, ) assign(:order_id, order_id) assign(:reason, reason) assign(:amount, amount) assign(:comment, comment) assign(:revoke_benefits, revoke_benefits) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
Amount to refund in cents. Minimum is 1.
38364 38365 38366 |
# File 'lib/pago/v2026_04/models.rb', line 38364 def amount @amount end |
#comment ⇒ String? (readonly)
An internal comment about the refund.
38368 38369 38370 |
# File 'lib/pago/v2026_04/models.rb', line 38368 def comment @comment end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
Key-value object allowing you to store additional information.
The key must be a string with a maximum length of 40 characters. The value must be either:
- A string with a maximum length of 500 characters
- An integer
- A floating-point number
- A boolean
You can store up to 50 key-value pairs.
38353 38354 38355 |
# File 'lib/pago/v2026_04/models.rb', line 38353 def @metadata end |
#order_id ⇒ String (readonly)
38356 38357 38358 |
# File 'lib/pago/v2026_04/models.rb', line 38356 def order_id @order_id end |
#reason ⇒ String (readonly)
Reason for the refund.
38360 38361 38362 |
# File 'lib/pago/v2026_04/models.rb', line 38360 def reason @reason end |
#revoke_benefits ⇒ Boolean (readonly)
Should this refund trigger the associated customer benefits to be revoked?
Note:
Only allowed in case the order is a one-time purchase.
Subscriptions automatically revoke customer benefits once the
subscription itself is revoked, i.e fully canceled.
38377 38378 38379 |
# File 'lib/pago/v2026_04/models.rb', line 38377 def revoke_benefits @revoke_benefits end |
Class Method Details
.from_json(data) ⇒ RefundCreate?
38398 38399 38400 38401 38402 38403 38404 38405 38406 38407 38408 38409 38410 38411 38412 38413 38414 |
# File 'lib/pago/v2026_04/models.rb', line 38398 def self.from_json(data) data = ::JSON.parse(data) if data.is_a?(String) data = ::Pago::Serde.object(data) return nil if data.nil? wrap_raw( new( metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET), order_id: (data.key?("order_id") ? data["order_id"] : ::Pago::UNSET), reason: (data.key?("reason") ? data["reason"] : ::Pago::UNSET), amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET), comment: (data.key?("comment") ? data["comment"] : ::Pago::UNSET), revoke_benefits: (data.key?("revoke_benefits") ? data["revoke_benefits"] : ::Pago::UNSET) ), data ) end |