Class: Pago::V2026_04::Models::CardPaymentMetadata
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Additional metadata for a card payment method.
Constant Summary collapse
- JSON_KEYS =
{ brand: "brand", last4: "last4" }.freeze
- REQUIRED_KEYS =
["brand", "last4"].freeze
Instance Attribute Summary collapse
-
#brand ⇒ String
readonly
The brand of the card used for the payment.
-
#last4 ⇒ String
readonly
The last 4 digits of the card number.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(brand:, last4:) ⇒ CardPaymentMetadata
constructor
A new instance of CardPaymentMetadata.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(brand:, last4:) ⇒ CardPaymentMetadata
Returns a new instance of CardPaymentMetadata.
9047 9048 9049 9050 9051 9052 9053 9054 |
# File 'lib/pago/v2026_04/models.rb', line 9047 def initialize( brand:, last4: ) super() assign(:brand, brand) assign(:last4, last4) end |
Instance Attribute Details
#brand ⇒ String (readonly)
The brand of the card used for the payment.
9041 9042 9043 |
# File 'lib/pago/v2026_04/models.rb', line 9041 def brand @brand end |
#last4 ⇒ String (readonly)
The last 4 digits of the card number.
9045 9046 9047 |
# File 'lib/pago/v2026_04/models.rb', line 9045 def last4 @last4 end |
Class Method Details
.from_json(data) ⇒ CardPaymentMetadata?
9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 |
# File 'lib/pago/v2026_04/models.rb', line 9058 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( brand: (data.key?("brand") ? data["brand"] : ::Pago::UNSET), last4: (data.key?("last4") ? data["last4"] : ::Pago::UNSET) ), data ) end |