Class: Pago::V2026_04::Models::WebhookOrderCreatedPayload
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Sent when a new order is created.
A new order is created when:
- A customer purchases a one-time product. In this case,
billing_reasonis set topurchase. - A customer starts a subscription. In this case,
billing_reasonis set tosubscription_create. - A subscription is renewed. In this case,
billing_reasonis set tosubscription_cycle. - A subscription is upgraded or downgraded with an immediate proration invoice. In this case,
billing_reasonis set tosubscription_update.
[!WARNING] The order might not be paid yet, so the
statusfield might bepending.
Discord & Slack support: Full
Constant Summary collapse
- JSON_KEYS =
{ type: "type", timestamp: "timestamp", data: "data" }.freeze
- REQUIRED_KEYS =
["type", "timestamp", "data"].freeze
Instance Attribute Summary collapse
- #data ⇒ Models::Order readonly
- #timestamp ⇒ String readonly
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, timestamp:, data:) ⇒ WebhookOrderCreatedPayload
constructor
A new instance of WebhookOrderCreatedPayload.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(type:, timestamp:, data:) ⇒ WebhookOrderCreatedPayload
Returns a new instance of WebhookOrderCreatedPayload.
45448 45449 45450 45451 45452 45453 45454 45455 45456 45457 |
# File 'lib/pago/v2026_04/models.rb', line 45448 def initialize( type:, timestamp:, data: ) super() assign(:type, type) assign(:timestamp, ) assign(:data, data) end |
Instance Attribute Details
#data ⇒ Models::Order (readonly)
45446 45447 45448 |
# File 'lib/pago/v2026_04/models.rb', line 45446 def data @data end |
#timestamp ⇒ String (readonly)
45443 45444 45445 |
# File 'lib/pago/v2026_04/models.rb', line 45443 def @timestamp end |
#type ⇒ String (readonly)
45440 45441 45442 |
# File 'lib/pago/v2026_04/models.rb', line 45440 def type @type end |
Class Method Details
.from_json(data) ⇒ WebhookOrderCreatedPayload?
45461 45462 45463 45464 45465 45466 45467 45468 45469 45470 45471 45472 45473 45474 |
# File 'lib/pago/v2026_04/models.rb', line 45461 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( type: (data.key?("type") ? data["type"] : ::Pago::UNSET), timestamp: (data.key?("timestamp") ? data["timestamp"] : ::Pago::UNSET), data: (data.key?("data") ? Models::Order.from_json(data["data"]) : ::Pago::UNSET) ), data ) end |