Class: Pago::V2026_04::Models::CheckoutPublicConfirmed

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Checkout session data retrieved using the client secret after confirmation.

It contains a customer session token to retrieve order information right after the checkout.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  id: "id",
  created_at: "created_at",
  modified_at: "modified_at",
  custom_field_data: "custom_field_data",
  payment_processor: "payment_processor",
  status: "status",
  client_secret: "client_secret",
  url: "url",
  expires_at: "expires_at",
  success_url: "success_url",
  return_url: "return_url",
  embed_origin: "embed_origin",
  amount: "amount",
  seats: "seats",
  min_seats: "min_seats",
  max_seats: "max_seats",
  discount_amount: "discount_amount",
  net_amount: "net_amount",
  tax_amount: "tax_amount",
  tax_behavior: "tax_behavior",
  total_amount: "total_amount",
  currency: "currency",
  allow_trial: "allow_trial",
  active_trial_interval: "active_trial_interval",
  active_trial_interval_count: "active_trial_interval_count",
  trial_end: "trial_end",
  organization_id: "organization_id",
  product_id: "product_id",
  product_price_id: "product_price_id",
  discount_id: "discount_id",
  allow_discount_codes: "allow_discount_codes",
  require_billing_address: "require_billing_address",
  is_discount_applicable: "is_discount_applicable",
  is_free_product_price: "is_free_product_price",
  is_payment_required: "is_payment_required",
  is_payment_setup_required: "is_payment_setup_required",
  is_payment_form_required: "is_payment_form_required",
  customer_id: "customer_id",
  is_business_customer: "is_business_customer",
  customer_name: "customer_name",
  customer_email: "customer_email",
  customer_ip_address: "customer_ip_address",
  customer_billing_name: "customer_billing_name",
  customer_billing_address: "customer_billing_address",
  customer_tax_id: "customer_tax_id",
  locale: "locale",
  payment_processor_metadata: "payment_processor_metadata",
  billing_address_fields: "billing_address_fields",
  products: "products",
  product: "product",
  product_price: "product_price",
  prices: "prices",
  discount: "discount",
  organization: "organization",
  attached_custom_fields: "attached_custom_fields",
  customer_session_token: "customer_session_token"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "created_at", "modified_at", "payment_processor", "status", "client_secret", "url", "expires_at", "success_url", "return_url", "embed_origin", "amount", "discount_amount", "net_amount", "tax_amount", "tax_behavior", "total_amount", "currency", "allow_trial", "active_trial_interval", "active_trial_interval_count", "trial_end", "organization_id", "product_id", "product_price_id", "discount_id", "allow_discount_codes", "require_billing_address", "is_discount_applicable", "is_free_product_price", "is_payment_required", "is_payment_setup_required", "is_payment_form_required", "customer_id", "is_business_customer", "customer_name", "customer_email", "customer_ip_address", "customer_billing_name", "customer_billing_address", "customer_tax_id", "payment_processor_metadata", "billing_address_fields", "products", "product", "product_price", "prices", "discount", "organization", "attached_custom_fields", "customer_session_token"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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:, custom_field_data: ::Pago::UNSET, payment_processor:, status:, client_secret:, url:, expires_at:, success_url:, return_url:, embed_origin:, amount:, seats: ::Pago::UNSET, min_seats: ::Pago::UNSET, max_seats: ::Pago::UNSET, discount_amount:, net_amount:, tax_amount:, tax_behavior:, total_amount:, currency:, allow_trial:, active_trial_interval:, active_trial_interval_count:, trial_end:, organization_id:, product_id:, product_price_id:, discount_id:, allow_discount_codes:, require_billing_address:, is_discount_applicable:, is_free_product_price:, is_payment_required:, is_payment_setup_required:, is_payment_form_required:, customer_id:, is_business_customer:, customer_name:, customer_email:, customer_ip_address:, customer_billing_name:, customer_billing_address:, customer_tax_id:, locale: ::Pago::UNSET, payment_processor_metadata:, billing_address_fields:, products:, product:, product_price:, prices:, discount:, organization:, attached_custom_fields:, customer_session_token:) ⇒ CheckoutPublicConfirmed

Returns a new instance of CheckoutPublicConfirmed.

Parameters:

  • id: (String)
  • created_at: (String)
  • modified_at: (String, nil)
  • custom_field_data: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • payment_processor: (String)
  • status: (String)
  • client_secret: (String)
  • url: (String)
  • expires_at: (String)
  • success_url: (String)
  • return_url: (String, nil)
  • embed_origin: (String, nil)
  • amount: (Integer)
  • seats: (Integer, nil) (defaults to: ::Pago::UNSET)
  • min_seats: (Integer, nil) (defaults to: ::Pago::UNSET)
  • max_seats: (Integer, nil) (defaults to: ::Pago::UNSET)
  • discount_amount: (Integer)
  • net_amount: (Integer)
  • tax_amount: (Integer, nil)
  • tax_behavior: (String, nil)
  • total_amount: (Integer)
  • currency: (String)
  • allow_trial: (Boolean, nil)
  • active_trial_interval: (String, nil)
  • active_trial_interval_count: (Integer, nil)
  • trial_end: (String, nil)
  • organization_id: (String)
  • product_id: (String, nil)
  • product_price_id: (String, nil)
  • discount_id: (String, nil)
  • allow_discount_codes: (Boolean)
  • require_billing_address: (Boolean)
  • is_discount_applicable: (Boolean)
  • is_free_product_price: (Boolean)
  • is_payment_required: (Boolean)
  • is_payment_setup_required: (Boolean)
  • is_payment_form_required: (Boolean)
  • customer_id: (String, nil)
  • is_business_customer: (Boolean)
  • customer_name: (String, nil)
  • customer_email: (String, nil)
  • customer_ip_address: (String, nil)
  • customer_billing_name: (String, nil)
  • customer_billing_address: (Models::Address, nil)
  • customer_tax_id: (String, nil)
  • locale: (String, nil) (defaults to: ::Pago::UNSET)
  • payment_processor_metadata: (Hash[String, String])
  • billing_address_fields: (Models::CheckoutBillingAddressFields)
  • products: (Array[Models::CheckoutProduct])
  • product: (Models::CheckoutProduct, nil)
  • product_price: (Object)
  • prices: (Hash[String, Array[untyped]], nil)
  • discount: (Object)
  • organization: (Models::CheckoutOrganization)
  • attached_custom_fields: (Array[Models::AttachedCustomField], nil)
  • customer_session_token: (String, nil)


12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
# File 'lib/pago/v2026_04/models.rb', line 12423

def initialize(
  id:,
  created_at:,
  modified_at:,
  custom_field_data: ::Pago::UNSET,
  payment_processor:,
  status:,
  client_secret:,
  url:,
  expires_at:,
  success_url:,
  return_url:,
  embed_origin:,
  amount:,
  seats: ::Pago::UNSET,
  min_seats: ::Pago::UNSET,
  max_seats: ::Pago::UNSET,
  discount_amount:,
  net_amount:,
  tax_amount:,
  tax_behavior:,
  total_amount:,
  currency:,
  allow_trial:,
  active_trial_interval:,
  active_trial_interval_count:,
  trial_end:,
  organization_id:,
  product_id:,
  product_price_id:,
  discount_id:,
  allow_discount_codes:,
  require_billing_address:,
  is_discount_applicable:,
  is_free_product_price:,
  is_payment_required:,
  is_payment_setup_required:,
  is_payment_form_required:,
  customer_id:,
  is_business_customer:,
  customer_name:,
  customer_email:,
  customer_ip_address:,
  customer_billing_name:,
  customer_billing_address:,
  customer_tax_id:,
  locale: ::Pago::UNSET,
  payment_processor_metadata:,
  billing_address_fields:,
  products:,
  product:,
  product_price:,
  prices:,
  discount:,
  organization:,
  attached_custom_fields:,
  customer_session_token:
)
  super()
  assign(:id, id)
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:custom_field_data, custom_field_data)
  assign(:payment_processor, payment_processor)
  assign(:status, status)
  assign(:client_secret, client_secret)
  assign(:url, url)
  assign(:expires_at, expires_at)
  assign(:success_url, success_url)
  assign(:return_url, return_url)
  assign(:embed_origin, embed_origin)
  assign(:amount, amount)
  assign(:seats, seats)
  assign(:min_seats, min_seats)
  assign(:max_seats, max_seats)
  assign(:discount_amount, discount_amount)
  assign(:net_amount, net_amount)
  assign(:tax_amount, tax_amount)
  assign(:tax_behavior, tax_behavior)
  assign(:total_amount, total_amount)
  assign(:currency, currency)
  assign(:allow_trial, allow_trial)
  assign(:active_trial_interval, active_trial_interval)
  assign(:active_trial_interval_count, active_trial_interval_count)
  assign(:trial_end, trial_end)
  assign(:organization_id, organization_id)
  assign(:product_id, product_id)
  assign(:product_price_id, product_price_id)
  assign(:discount_id, discount_id)
  assign(:allow_discount_codes, allow_discount_codes)
  assign(:require_billing_address, require_billing_address)
  assign(:is_discount_applicable, is_discount_applicable)
  assign(:is_free_product_price, is_free_product_price)
  assign(:is_payment_required, is_payment_required)
  assign(:is_payment_setup_required, is_payment_setup_required)
  assign(:is_payment_form_required, is_payment_form_required)
  assign(:customer_id, customer_id)
  assign(:is_business_customer, is_business_customer)
  assign(:customer_name, customer_name)
  assign(:customer_email, customer_email)
  assign(:customer_ip_address, customer_ip_address)
  assign(:customer_billing_name, customer_billing_name)
  assign(:customer_billing_address, customer_billing_address)
  assign(:customer_tax_id, customer_tax_id)
  assign(:locale, locale)
  assign(:payment_processor_metadata, )
  assign(:billing_address_fields, billing_address_fields)
  assign(:products, products)
  assign(:product, product)
  assign(:product_price, product_price)
  assign(:prices, prices)
  assign(:discount, discount)
  assign(:organization, organization)
  assign(:attached_custom_fields, attached_custom_fields)
  assign(:customer_session_token, customer_session_token)
end

Instance Attribute Details

#active_trial_intervalString? (readonly)

Interval unit of the trial period, if any. This value is either set from the checkout, if trial_interval is set, or from the selected product.

Returns:

  • (String, nil)


12303
12304
12305
# File 'lib/pago/v2026_04/models.rb', line 12303

def active_trial_interval
  @active_trial_interval
end

#active_trial_interval_countInteger? (readonly)

Number of interval units of the trial period, if any. This value is either set from the checkout, if trial_interval_count is set, or from the selected product.

Returns:

  • (Integer, nil)


12307
12308
12309
# File 'lib/pago/v2026_04/models.rb', line 12307

def active_trial_interval_count
  @active_trial_interval_count
end

#allow_discount_codesBoolean (readonly)

Whether to allow the customer to apply discount codes. If you apply a discount through discount_id, it'll still be applied, but the customer won't be able to change it.

Returns:

  • (Boolean)


12332
12333
12334
# File 'lib/pago/v2026_04/models.rb', line 12332

def allow_discount_codes
  @allow_discount_codes
end

#allow_trialBoolean? (readonly)

Whether to enable the trial period for the checkout session. If false, the trial period will be disabled, even if the selected product has a trial configured.

Returns:

  • (Boolean, nil)


12299
12300
12301
# File 'lib/pago/v2026_04/models.rb', line 12299

def allow_trial
  @allow_trial
end

#amountInteger (readonly)

Amount in cents, before discounts and taxes.

Returns:

  • (Integer)


12259
12260
12261
# File 'lib/pago/v2026_04/models.rb', line 12259

def amount
  @amount
end

#attached_custom_fieldsArray<Models::AttachedCustomField>? (readonly)

Returns:



12418
12419
12420
# File 'lib/pago/v2026_04/models.rb', line 12418

def attached_custom_fields
  @attached_custom_fields
end

#billing_address_fieldsModels::CheckoutBillingAddressFields (readonly)



12392
12393
12394
# File 'lib/pago/v2026_04/models.rb', line 12392

def billing_address_fields
  @billing_address_fields
end

#client_secretString (readonly)

Client secret used to update and complete the checkout session from the client.

Returns:

  • (String)


12235
12236
12237
# File 'lib/pago/v2026_04/models.rb', line 12235

def client_secret
  @client_secret
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


12217
12218
12219
# File 'lib/pago/v2026_04/models.rb', line 12217

def created_at
  @created_at
end

#currencyString (readonly)

Currency code of the checkout session.

Returns:

  • (String)


12295
12296
12297
# File 'lib/pago/v2026_04/models.rb', line 12295

def currency
  @currency
end

#custom_field_dataHash{String => String, Integer, Boolean, nil} (readonly)

Key-value object storing custom field values.

Returns:

  • (Hash{String => String, Integer, Boolean, nil})


12225
12226
12227
# File 'lib/pago/v2026_04/models.rb', line 12225

def custom_field_data
  @custom_field_data
end

#customer_billing_addressModels::Address? (readonly)

Returns:



12380
12381
12382
# File 'lib/pago/v2026_04/models.rb', line 12380

def customer_billing_address
  @customer_billing_address
end

#customer_billing_nameString? (readonly)

Returns:

  • (String, nil)


12377
12378
12379
# File 'lib/pago/v2026_04/models.rb', line 12377

def customer_billing_name
  @customer_billing_name
end

#customer_emailString? (readonly)

Email address of the customer.

Returns:

  • (String, nil)


12371
12372
12373
# File 'lib/pago/v2026_04/models.rb', line 12371

def customer_email
  @customer_email
end

#customer_idString? (readonly)

Returns:

  • (String, nil)


12359
12360
12361
# File 'lib/pago/v2026_04/models.rb', line 12359

def customer_id
  @customer_id
end

#customer_ip_addressString? (readonly)

Returns:

  • (String, nil)


12374
12375
12376
# File 'lib/pago/v2026_04/models.rb', line 12374

def customer_ip_address
  @customer_ip_address
end

#customer_nameString? (readonly)

Name of the customer.

Returns:

  • (String, nil)


12367
12368
12369
# File 'lib/pago/v2026_04/models.rb', line 12367

def customer_name
  @customer_name
end

#customer_session_tokenString? (readonly)

Returns:

  • (String, nil)


12421
12422
12423
# File 'lib/pago/v2026_04/models.rb', line 12421

def customer_session_token
  @customer_session_token
end

#customer_tax_idString? (readonly)

Returns:

  • (String, nil)


12383
12384
12385
# File 'lib/pago/v2026_04/models.rb', line 12383

def customer_tax_id
  @customer_tax_id
end

#discount_amountInteger (readonly)

Discount amount in cents.

Returns:

  • (Integer)


12275
12276
12277
# File 'lib/pago/v2026_04/models.rb', line 12275

def discount_amount
  @discount_amount
end

#discount_idString? (readonly)

ID of the discount applied to the checkout.

Returns:

  • (String, nil)


12328
12329
12330
# File 'lib/pago/v2026_04/models.rb', line 12328

def discount_id
  @discount_id
end

#embed_originString? (readonly)

When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page.

Returns:

  • (String, nil)


12255
12256
12257
# File 'lib/pago/v2026_04/models.rb', line 12255

def embed_origin
  @embed_origin
end

#expires_atString (readonly)

Expiration date and time of the checkout session.

Returns:

  • (String)


12243
12244
12245
# File 'lib/pago/v2026_04/models.rb', line 12243

def expires_at
  @expires_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


12213
12214
12215
# File 'lib/pago/v2026_04/models.rb', line 12213

def id
  @id
end

#is_business_customerBoolean (readonly)

Whether the customer is a business or an individual. If true, the customer will be required to fill their full billing address and billing name.

Returns:

  • (Boolean)


12363
12364
12365
# File 'lib/pago/v2026_04/models.rb', line 12363

def is_business_customer
  @is_business_customer
end

#is_discount_applicableBoolean (readonly)

Whether the discount is applicable to the checkout. Typically, free and custom prices are not discountable.

Returns:

  • (Boolean)


12340
12341
12342
# File 'lib/pago/v2026_04/models.rb', line 12340

def is_discount_applicable
  @is_discount_applicable
end

#is_free_product_priceBoolean (readonly)

Whether the product price is free, regardless of discounts.

Returns:

  • (Boolean)


12344
12345
12346
# File 'lib/pago/v2026_04/models.rb', line 12344

def is_free_product_price
  @is_free_product_price
end

#is_payment_form_requiredBoolean (readonly)

Whether the checkout requires a payment form, whether because of a payment or payment method setup.

Returns:

  • (Boolean)


12356
12357
12358
# File 'lib/pago/v2026_04/models.rb', line 12356

def is_payment_form_required
  @is_payment_form_required
end

#is_payment_requiredBoolean (readonly)

Whether the checkout requires payment, e.g. in case of free products or discounts that cover the total amount.

Returns:

  • (Boolean)


12348
12349
12350
# File 'lib/pago/v2026_04/models.rb', line 12348

def is_payment_required
  @is_payment_required
end

#is_payment_setup_requiredBoolean (readonly)

Whether the checkout requires setting up a payment method, regardless of the amount, e.g. subscriptions that have first free cycles.

Returns:

  • (Boolean)


12352
12353
12354
# File 'lib/pago/v2026_04/models.rb', line 12352

def is_payment_setup_required
  @is_payment_setup_required
end

#localeString? (readonly)

Returns:

  • (String, nil)


12386
12387
12388
# File 'lib/pago/v2026_04/models.rb', line 12386

def locale
  @locale
end

#max_seatsInteger? (readonly)

Maximum number of seats (works with seat-based pricing only)

Returns:

  • (Integer, nil)


12271
12272
12273
# File 'lib/pago/v2026_04/models.rb', line 12271

def max_seats
  @max_seats
end

#min_seatsInteger? (readonly)

Minimum number of seats (works with seat-based pricing only)

Returns:

  • (Integer, nil)


12267
12268
12269
# File 'lib/pago/v2026_04/models.rb', line 12267

def min_seats
  @min_seats
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


12221
12222
12223
# File 'lib/pago/v2026_04/models.rb', line 12221

def modified_at
  @modified_at
end

#net_amountInteger (readonly)

Amount in cents, after discounts but before taxes.

Returns:

  • (Integer)


12279
12280
12281
# File 'lib/pago/v2026_04/models.rb', line 12279

def net_amount
  @net_amount
end

#organizationModels::CheckoutOrganization (readonly)



12415
12416
12417
# File 'lib/pago/v2026_04/models.rb', line 12415

def organization
  @organization
end

#organization_idString (readonly)

ID of the organization owning the checkout session.

Returns:

  • (String)


12315
12316
12317
# File 'lib/pago/v2026_04/models.rb', line 12315

def organization_id
  @organization_id
end

#payment_processorString (readonly)

Returns:

  • (String)


12228
12229
12230
# File 'lib/pago/v2026_04/models.rb', line 12228

def payment_processor
  @payment_processor
end

#payment_processor_metadataHash{String => String} (readonly)

Returns:

  • (Hash{String => String})


12389
12390
12391
# File 'lib/pago/v2026_04/models.rb', line 12389

def 
  @payment_processor_metadata
end

#pricesHash{String => Array<Object>}? (readonly)

Mapping of product IDs to their list of prices.

Returns:

  • (Hash{String => Array<Object>}, nil)


12409
12410
12411
# File 'lib/pago/v2026_04/models.rb', line 12409

def prices
  @prices
end

#productModels::CheckoutProduct? (readonly)

Product selected to checkout.

Returns:



12400
12401
12402
# File 'lib/pago/v2026_04/models.rb', line 12400

def product
  @product
end

#product_idString? (readonly)

ID of the product to checkout.

Returns:

  • (String, nil)


12319
12320
12321
# File 'lib/pago/v2026_04/models.rb', line 12319

def product_id
  @product_id
end

#product_priceObject? (readonly)

Deprecated.

Price of the selected product.

Returns:

  • (Object, nil)


12405
12406
12407
# File 'lib/pago/v2026_04/models.rb', line 12405

def product_price
  @product_price
end

#product_price_idString? (readonly)

Deprecated.

ID of the product price to checkout.

Returns:

  • (String, nil)


12324
12325
12326
# File 'lib/pago/v2026_04/models.rb', line 12324

def product_price_id
  @product_price_id
end

#productsArray<Models::CheckoutProduct> (readonly)

List of products available to select.

Returns:



12396
12397
12398
# File 'lib/pago/v2026_04/models.rb', line 12396

def products
  @products
end

#require_billing_addressBoolean (readonly)

Whether to require the customer to fill their full billing address, instead of just the country. Customers in the US will always be required to fill their full address, regardless of this setting. If you preset the billing address, this setting will be automatically set to true.

Returns:

  • (Boolean)


12336
12337
12338
# File 'lib/pago/v2026_04/models.rb', line 12336

def require_billing_address
  @require_billing_address
end

#return_urlString? (readonly)

When set, a back button will be shown in the checkout to return to this URL.

Returns:

  • (String, nil)


12251
12252
12253
# File 'lib/pago/v2026_04/models.rb', line 12251

def return_url
  @return_url
end

#seatsInteger? (readonly)

Predefined number of seats (works with seat-based pricing only)

Returns:

  • (Integer, nil)


12263
12264
12265
# File 'lib/pago/v2026_04/models.rb', line 12263

def seats
  @seats
end

#statusString (readonly)

Returns:

  • (String)


12231
12232
12233
# File 'lib/pago/v2026_04/models.rb', line 12231

def status
  @status
end

#success_urlString (readonly)

URL where the customer will be redirected after a successful payment.

Returns:

  • (String)


12247
12248
12249
# File 'lib/pago/v2026_04/models.rb', line 12247

def success_url
  @success_url
end

#tax_amountInteger? (readonly)

Sales tax amount in cents. If null, it means there is no enough information yet to calculate it.

Returns:

  • (Integer, nil)


12283
12284
12285
# File 'lib/pago/v2026_04/models.rb', line 12283

def tax_amount
  @tax_amount
end

#tax_behaviorString? (readonly)

Tax behavior of the checkout. inclusive means the price includes tax, exclusive means tax is added on top. If null, tax is not yet calculated.

Returns:

  • (String, nil)


12287
12288
12289
# File 'lib/pago/v2026_04/models.rb', line 12287

def tax_behavior
  @tax_behavior
end

#total_amountInteger (readonly)

Amount in cents, after discounts and taxes.

Returns:

  • (Integer)


12291
12292
12293
# File 'lib/pago/v2026_04/models.rb', line 12291

def total_amount
  @total_amount
end

#trial_endString? (readonly)

End date and time of the trial period, if any.

Returns:

  • (String, nil)


12311
12312
12313
# File 'lib/pago/v2026_04/models.rb', line 12311

def trial_end
  @trial_end
end

#urlString (readonly)

URL where the customer can access the checkout session.

Returns:

  • (String)


12239
12240
12241
# File 'lib/pago/v2026_04/models.rb', line 12239

def url
  @url
end

Class Method Details

.from_json(data) ⇒ CheckoutPublicConfirmed?

Parameters:

  • data (Hash, String, nil)

Returns:



12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
# File 'lib/pago/v2026_04/models.rb', line 12542

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),
      custom_field_data: (data.key?("custom_field_data") ? data["custom_field_data"] : ::Pago::UNSET),
      payment_processor: (data.key?("payment_processor") ? data["payment_processor"] : ::Pago::UNSET),
      status: (data.key?("status") ? data["status"] : ::Pago::UNSET),
      client_secret: (data.key?("client_secret") ? data["client_secret"] : ::Pago::UNSET),
      url: (data.key?("url") ? data["url"] : ::Pago::UNSET),
      expires_at: (data.key?("expires_at") ? data["expires_at"] : ::Pago::UNSET),
      success_url: (data.key?("success_url") ? data["success_url"] : ::Pago::UNSET),
      return_url: (data.key?("return_url") ? data["return_url"] : ::Pago::UNSET),
      embed_origin: (data.key?("embed_origin") ? data["embed_origin"] : ::Pago::UNSET),
      amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET),
      seats: (data.key?("seats") ? data["seats"] : ::Pago::UNSET),
      min_seats: (data.key?("min_seats") ? data["min_seats"] : ::Pago::UNSET),
      max_seats: (data.key?("max_seats") ? data["max_seats"] : ::Pago::UNSET),
      discount_amount: (data.key?("discount_amount") ? data["discount_amount"] : ::Pago::UNSET),
      net_amount: (data.key?("net_amount") ? data["net_amount"] : ::Pago::UNSET),
      tax_amount: (data.key?("tax_amount") ? data["tax_amount"] : ::Pago::UNSET),
      tax_behavior: (data.key?("tax_behavior") ? data["tax_behavior"] : ::Pago::UNSET),
      total_amount: (data.key?("total_amount") ? data["total_amount"] : ::Pago::UNSET),
      currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET),
      allow_trial: (data.key?("allow_trial") ? data["allow_trial"] : ::Pago::UNSET),
      active_trial_interval: (data.key?("active_trial_interval") ? data["active_trial_interval"] : ::Pago::UNSET),
      active_trial_interval_count: (data.key?("active_trial_interval_count") ? data["active_trial_interval_count"] : ::Pago::UNSET),
      trial_end: (data.key?("trial_end") ? data["trial_end"] : ::Pago::UNSET),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET),
      product_price_id: (data.key?("product_price_id") ? data["product_price_id"] : ::Pago::UNSET),
      discount_id: (data.key?("discount_id") ? data["discount_id"] : ::Pago::UNSET),
      allow_discount_codes: (data.key?("allow_discount_codes") ? data["allow_discount_codes"] : ::Pago::UNSET),
      require_billing_address: (data.key?("require_billing_address") ? data["require_billing_address"] : ::Pago::UNSET),
      is_discount_applicable: (data.key?("is_discount_applicable") ? data["is_discount_applicable"] : ::Pago::UNSET),
      is_free_product_price: (data.key?("is_free_product_price") ? data["is_free_product_price"] : ::Pago::UNSET),
      is_payment_required: (data.key?("is_payment_required") ? data["is_payment_required"] : ::Pago::UNSET),
      is_payment_setup_required: (data.key?("is_payment_setup_required") ? data["is_payment_setup_required"] : ::Pago::UNSET),
      is_payment_form_required: (data.key?("is_payment_form_required") ? data["is_payment_form_required"] : ::Pago::UNSET),
      customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET),
      is_business_customer: (data.key?("is_business_customer") ? data["is_business_customer"] : ::Pago::UNSET),
      customer_name: (data.key?("customer_name") ? data["customer_name"] : ::Pago::UNSET),
      customer_email: (data.key?("customer_email") ? data["customer_email"] : ::Pago::UNSET),
      customer_ip_address: (data.key?("customer_ip_address") ? data["customer_ip_address"] : ::Pago::UNSET),
      customer_billing_name: (data.key?("customer_billing_name") ? data["customer_billing_name"] : ::Pago::UNSET),
      customer_billing_address: (data.key?("customer_billing_address") ? Models::Address.from_json(data["customer_billing_address"]) : ::Pago::UNSET),
      customer_tax_id: (data.key?("customer_tax_id") ? data["customer_tax_id"] : ::Pago::UNSET),
      locale: (data.key?("locale") ? data["locale"] : ::Pago::UNSET),
      payment_processor_metadata: (data.key?("payment_processor_metadata") ? data["payment_processor_metadata"] : ::Pago::UNSET),
      billing_address_fields: (data.key?("billing_address_fields") ? Models::CheckoutBillingAddressFields.from_json(data["billing_address_fields"]) : ::Pago::UNSET),
      products: (data.key?("products") ? ::Pago::Serde.array(data["products"]) { |item0| Models::CheckoutProduct.from_json(item0) } : ::Pago::UNSET),
      product: (data.key?("product") ? Models::CheckoutProduct.from_json(data["product"]) : ::Pago::UNSET),
      product_price: (data.key?("product_price") ? ::Pago::Serde.union(data["product_price"], variants: [Unions::LegacyRecurringProductPrice, Unions::ProductPrice]) : ::Pago::UNSET),
      prices: (data.key?("prices") ? ::Pago::Serde.map(data["prices"]) { |value0| ::Pago::Serde.array(value0) { |item1| ::Pago::Serde.union(item1, variants: [Unions::LegacyRecurringProductPrice, Unions::ProductPrice]) } } : ::Pago::UNSET),
      discount: (data.key?("discount") ? ::Pago::Serde.union(data["discount"], variants: [Models::CheckoutDiscountFixedOnceForeverDuration, Models::CheckoutDiscountFixedRepeatDuration, Models::CheckoutDiscountPercentageOnceForeverDuration, Models::CheckoutDiscountPercentageRepeatDuration]) : ::Pago::UNSET),
      organization: (data.key?("organization") ? Models::CheckoutOrganization.from_json(data["organization"]) : ::Pago::UNSET),
      attached_custom_fields: (data.key?("attached_custom_fields") ? ::Pago::Serde.array(data["attached_custom_fields"]) { |item0| Models::AttachedCustomField.from_json(item0) } : ::Pago::UNSET),
      customer_session_token: (data.key?("customer_session_token") ? data["customer_session_token"] : ::Pago::UNSET)
    ),
    data
  )
end