Class: Pago::V2026_04::Models::GenericPayment
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema of a payment with a generic 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" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "processor", "status", "amount", "currency", "method", "trigger", "decline_reason", "decline_message", "organization_id", "checkout_id", "order_id"].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.
-
#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) ⇒ GenericPayment
constructor
A new instance of GenericPayment.
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) ⇒ GenericPayment
Returns a new instance of GenericPayment.
25977 25978 25979 25980 25981 25982 25983 25984 25985 25986 25987 25988 25989 25990 25991 25992 25993 25994 25995 25996 25997 25998 25999 26000 26001 26002 26003 26004 26005 26006 26007 26008 26009 26010 |
# File 'lib/pago/v2026_04/models.rb', line 25977 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 ) 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, ) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
The payment amount in cents.
25939 25940 25941 |
# File 'lib/pago/v2026_04/models.rb', line 25939 def amount @amount end |
#checkout_id ⇒ String? (readonly)
The ID of the checkout session associated with this payment.
25967 25968 25969 |
# File 'lib/pago/v2026_04/models.rb', line 25967 def checkout_id @checkout_id end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
25921 25922 25923 |
# File 'lib/pago/v2026_04/models.rb', line 25921 def created_at @created_at end |
#currency ⇒ String (readonly)
The payment currency. Currently, only usd is supported.
25943 25944 25945 |
# File 'lib/pago/v2026_04/models.rb', line 25943 def currency @currency end |
#decline_message ⇒ String? (readonly)
Human-readable error message, if the payment was declined.
25959 25960 25961 |
# File 'lib/pago/v2026_04/models.rb', line 25959 def @decline_message end |
#decline_reason ⇒ String? (readonly)
Error code, if the payment was declined.
25955 25956 25957 |
# File 'lib/pago/v2026_04/models.rb', line 25955 def decline_reason @decline_reason end |
#id ⇒ String (readonly)
The ID of the object.
25929 25930 25931 |
# File 'lib/pago/v2026_04/models.rb', line 25929 def id @id end |
#method ⇒ String (readonly)
The payment method used.
25947 25948 25949 |
# File 'lib/pago/v2026_04/models.rb', line 25947 def method @method end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
25925 25926 25927 |
# File 'lib/pago/v2026_04/models.rb', line 25925 def modified_at @modified_at end |
#order_id ⇒ String? (readonly)
The ID of the order associated with this payment.
25971 25972 25973 |
# File 'lib/pago/v2026_04/models.rb', line 25971 def order_id @order_id end |
#organization_id ⇒ String (readonly)
The ID of the organization that owns the payment.
25963 25964 25965 |
# File 'lib/pago/v2026_04/models.rb', line 25963 def organization_id @organization_id end |
#processor ⇒ String (readonly)
25932 25933 25934 |
# File 'lib/pago/v2026_04/models.rb', line 25932 def processor @processor end |
#processor_metadata ⇒ Hash{String => Object} (readonly)
Additional metadata from the payment processor for internal use.
25975 25976 25977 |
# File 'lib/pago/v2026_04/models.rb', line 25975 def @processor_metadata end |
#status ⇒ String (readonly)
25935 25936 25937 |
# File 'lib/pago/v2026_04/models.rb', line 25935 def status @status end |
#trigger ⇒ String? (readonly)
What initiated this payment attempt, e.g. initial purchase, subscription renewal, or an automated dunning retry.
25951 25952 25953 |
# File 'lib/pago/v2026_04/models.rb', line 25951 def trigger @trigger end |
Class Method Details
.from_json(data) ⇒ GenericPayment?
26014 26015 26016 26017 26018 26019 26020 26021 26022 26023 26024 26025 26026 26027 26028 26029 26030 26031 26032 26033 26034 26035 26036 26037 26038 26039 |
# File 'lib/pago/v2026_04/models.rb', line 26014 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) ), data ) end |