Class: Pago::V2026_04::Models::CardPayment
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema of a payment with a card payment method.
Constant Summary collapse
- JSON_KEYS =
{ created_at: "created_at", modified_at: "modified_at", id: "id", processor: "processor", status: "status", amount: "amount", currency: "currency", method: "method", trigger: "trigger", decline_reason: "decline_reason", decline_message: "decline_message", organization_id: "organization_id", checkout_id: "checkout_id", order_id: "order_id", processor_metadata: "processor_metadata", method_metadata: "method_metadata" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "processor", "status", "amount", "currency", "method", "trigger", "decline_reason", "decline_message", "organization_id", "checkout_id", "order_id", "method_metadata"].freeze
Instance Attribute Summary collapse
-
#amount ⇒ Integer
readonly
The payment amount in cents.
-
#checkout_id ⇒ String?
readonly
The ID of the checkout session associated with this payment.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#currency ⇒ String
readonly
The payment currency.
-
#decline_message ⇒ String?
readonly
Human-readable error message, if the payment was declined.
-
#decline_reason ⇒ String?
readonly
Error code, if the payment was declined.
-
#id ⇒ String
readonly
The ID of the object.
-
#method ⇒ String
readonly
The payment method used.
- #method_metadata ⇒ Models::CardPaymentMetadata readonly
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#order_id ⇒ String?
readonly
The ID of the order associated with this payment.
-
#organization_id ⇒ String
readonly
The ID of the organization that owns the payment.
- #processor ⇒ String readonly
-
#processor_metadata ⇒ Hash{String => Object}
readonly
Additional metadata from the payment processor for internal use.
- #status ⇒ String readonly
-
#trigger ⇒ String?
readonly
What initiated this payment attempt, e.g.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(created_at:, modified_at:, id:, processor:, status:, amount:, currency:, method:, trigger:, decline_reason:, decline_message:, organization_id:, checkout_id:, order_id:, processor_metadata: ::Pago::UNSET, method_metadata:) ⇒ CardPayment
constructor
A new instance of CardPayment.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(created_at:, modified_at:, id:, processor:, status:, amount:, currency:, method:, trigger:, decline_reason:, decline_message:, organization_id:, checkout_id:, order_id:, processor_metadata: ::Pago::UNSET, method_metadata:) ⇒ CardPayment
Returns a new instance of CardPayment.
8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 |
# File 'lib/pago/v2026_04/models.rb', line 8963 def initialize( created_at:, modified_at:, id:, processor:, status:, amount:, currency:, method:, trigger:, decline_reason:, decline_message:, organization_id:, checkout_id:, order_id:, processor_metadata: ::Pago::UNSET, method_metadata: ) super() assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:id, id) assign(:processor, processor) assign(:status, status) assign(:amount, amount) assign(:currency, currency) assign(:method, method) assign(:trigger, trigger) assign(:decline_reason, decline_reason) assign(:decline_message, ) assign(:organization_id, organization_id) assign(:checkout_id, checkout_id) assign(:order_id, order_id) assign(:processor_metadata, ) assign(:method_metadata, ) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
The payment amount in cents.
8922 8923 8924 |
# File 'lib/pago/v2026_04/models.rb', line 8922 def amount @amount end |
#checkout_id ⇒ String? (readonly)
The ID of the checkout session associated with this payment.
8950 8951 8952 |
# File 'lib/pago/v2026_04/models.rb', line 8950 def checkout_id @checkout_id end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
8904 8905 8906 |
# File 'lib/pago/v2026_04/models.rb', line 8904 def created_at @created_at end |
#currency ⇒ String (readonly)
The payment currency. Currently, only usd is supported.
8926 8927 8928 |
# File 'lib/pago/v2026_04/models.rb', line 8926 def currency @currency end |
#decline_message ⇒ String? (readonly)
Human-readable error message, if the payment was declined.
8942 8943 8944 |
# File 'lib/pago/v2026_04/models.rb', line 8942 def @decline_message end |
#decline_reason ⇒ String? (readonly)
Error code, if the payment was declined.
8938 8939 8940 |
# File 'lib/pago/v2026_04/models.rb', line 8938 def decline_reason @decline_reason end |
#id ⇒ String (readonly)
The ID of the object.
8912 8913 8914 |
# File 'lib/pago/v2026_04/models.rb', line 8912 def id @id end |
#method ⇒ String (readonly)
The payment method used.
8930 8931 8932 |
# File 'lib/pago/v2026_04/models.rb', line 8930 def method @method end |
#method_metadata ⇒ Models::CardPaymentMetadata (readonly)
8961 8962 8963 |
# File 'lib/pago/v2026_04/models.rb', line 8961 def @method_metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
8908 8909 8910 |
# File 'lib/pago/v2026_04/models.rb', line 8908 def modified_at @modified_at end |
#order_id ⇒ String? (readonly)
The ID of the order associated with this payment.
8954 8955 8956 |
# File 'lib/pago/v2026_04/models.rb', line 8954 def order_id @order_id end |
#organization_id ⇒ String (readonly)
The ID of the organization that owns the payment.
8946 8947 8948 |
# File 'lib/pago/v2026_04/models.rb', line 8946 def organization_id @organization_id end |
#processor ⇒ String (readonly)
8915 8916 8917 |
# File 'lib/pago/v2026_04/models.rb', line 8915 def processor @processor end |
#processor_metadata ⇒ Hash{String => Object} (readonly)
Additional metadata from the payment processor for internal use.
8958 8959 8960 |
# File 'lib/pago/v2026_04/models.rb', line 8958 def @processor_metadata end |
#status ⇒ String (readonly)
8918 8919 8920 |
# File 'lib/pago/v2026_04/models.rb', line 8918 def status @status end |
#trigger ⇒ String? (readonly)
What initiated this payment attempt, e.g. initial purchase, subscription renewal, or an automated dunning retry.
8934 8935 8936 |
# File 'lib/pago/v2026_04/models.rb', line 8934 def trigger @trigger end |
Class Method Details
.from_json(data) ⇒ CardPayment?
9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 |
# File 'lib/pago/v2026_04/models.rb', line 9002 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( created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), id: (data.key?("id") ? data["id"] : ::Pago::UNSET), processor: (data.key?("processor") ? data["processor"] : ::Pago::UNSET), status: (data.key?("status") ? data["status"] : ::Pago::UNSET), amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET), currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET), method: (data.key?("method") ? data["method"] : ::Pago::UNSET), trigger: (data.key?("trigger") ? data["trigger"] : ::Pago::UNSET), decline_reason: (data.key?("decline_reason") ? data["decline_reason"] : ::Pago::UNSET), decline_message: (data.key?("decline_message") ? data["decline_message"] : ::Pago::UNSET), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET), checkout_id: (data.key?("checkout_id") ? data["checkout_id"] : ::Pago::UNSET), order_id: (data.key?("order_id") ? data["order_id"] : ::Pago::UNSET), processor_metadata: (data.key?("processor_metadata") ? data["processor_metadata"] : ::Pago::UNSET), method_metadata: (data.key?("method_metadata") ? Models::CardPaymentMetadata.from_json(data["method_metadata"]) : ::Pago::UNSET) ), data ) end |