Class: Pago::V2026_04::Models::CustomerWallet
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
A wallet represents your balance with an organization.
You can top-up your wallet and use the balance to pay for usage.
Constant Summary collapse
- JSON_KEYS =
{ id: "id", created_at: "created_at", modified_at: "modified_at", customer_id: "customer_id", balance: "balance", currency: "currency" }.freeze
- REQUIRED_KEYS =
["id", "created_at", "modified_at", "customer_id", "balance", "currency"].freeze
Instance Attribute Summary collapse
-
#balance ⇒ Integer
readonly
The current balance of the wallet, in cents.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#currency ⇒ String
readonly
The currency of the wallet.
-
#customer_id ⇒ String
readonly
The ID of the customer that owns the wallet.
-
#id ⇒ String
readonly
The ID of the object.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, created_at:, modified_at:, customer_id:, balance:, currency:) ⇒ CustomerWallet
constructor
A new instance of CustomerWallet.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(id:, created_at:, modified_at:, customer_id:, balance:, currency:) ⇒ CustomerWallet
Returns a new instance of CustomerWallet.
22314 22315 22316 22317 22318 22319 22320 22321 22322 22323 22324 22325 22326 22327 22328 22329 |
# File 'lib/pago/v2026_04/models.rb', line 22314 def initialize( id:, created_at:, modified_at:, customer_id:, balance:, currency: ) super() assign(:id, id) assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:customer_id, customer_id) assign(:balance, balance) assign(:currency, currency) end |
Instance Attribute Details
#balance ⇒ Integer (readonly)
The current balance of the wallet, in cents.
22308 22309 22310 |
# File 'lib/pago/v2026_04/models.rb', line 22308 def balance @balance end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
22296 22297 22298 |
# File 'lib/pago/v2026_04/models.rb', line 22296 def created_at @created_at end |
#currency ⇒ String (readonly)
The currency of the wallet.
22312 22313 22314 |
# File 'lib/pago/v2026_04/models.rb', line 22312 def currency @currency end |
#customer_id ⇒ String (readonly)
The ID of the customer that owns the wallet.
22304 22305 22306 |
# File 'lib/pago/v2026_04/models.rb', line 22304 def customer_id @customer_id end |
#id ⇒ String (readonly)
The ID of the object.
22292 22293 22294 |
# File 'lib/pago/v2026_04/models.rb', line 22292 def id @id end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
22300 22301 22302 |
# File 'lib/pago/v2026_04/models.rb', line 22300 def modified_at @modified_at end |
Class Method Details
.from_json(data) ⇒ CustomerWallet?
22333 22334 22335 22336 22337 22338 22339 22340 22341 22342 22343 22344 22345 22346 22347 22348 22349 |
# File 'lib/pago/v2026_04/models.rb', line 22333 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( id: (data.key?("id") ? data["id"] : ::Pago::UNSET), created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET), balance: (data.key?("balance") ? data["balance"] : ::Pago::UNSET), currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET) ), data ) end |