Class: Pago::V2026_04::Models::CheckoutLinkUpdate

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

Overview

Schema to update an existing checkout link.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  trial_interval: "trial_interval",
  trial_interval_count: "trial_interval_count",
  metadata: "metadata",
  products: "products",
  label: "label",
  allow_discount_codes: "allow_discount_codes",
  require_billing_address: "require_billing_address",
  discount_id: "discount_id",
  seats: "seats",
  success_url: "success_url",
  return_url: "return_url"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
[].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(trial_interval: ::Pago::UNSET, trial_interval_count: ::Pago::UNSET, metadata: ::Pago::UNSET, products: ::Pago::UNSET, label: ::Pago::UNSET, allow_discount_codes: ::Pago::UNSET, require_billing_address: ::Pago::UNSET, discount_id: ::Pago::UNSET, seats: ::Pago::UNSET, success_url: ::Pago::UNSET, return_url: ::Pago::UNSET) ⇒ CheckoutLinkUpdate

Returns a new instance of CheckoutLinkUpdate.

Parameters:

  • trial_interval: (String, nil) (defaults to: ::Pago::UNSET)
  • trial_interval_count: (Integer, nil) (defaults to: ::Pago::UNSET)
  • metadata: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • products: (Array[String], nil) (defaults to: ::Pago::UNSET)
  • label: (String, nil) (defaults to: ::Pago::UNSET)
  • allow_discount_codes: (Boolean, nil) (defaults to: ::Pago::UNSET)
  • require_billing_address: (Boolean, nil) (defaults to: ::Pago::UNSET)
  • discount_id: (String, nil) (defaults to: ::Pago::UNSET)
  • seats: (Integer, nil) (defaults to: ::Pago::UNSET)
  • success_url: (String, nil) (defaults to: ::Pago::UNSET)
  • return_url: (String, nil) (defaults to: ::Pago::UNSET)


11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
# File 'lib/pago/v2026_04/models.rb', line 11381

def initialize(
  trial_interval: ::Pago::UNSET,
  trial_interval_count: ::Pago::UNSET,
  metadata: ::Pago::UNSET,
  products: ::Pago::UNSET,
  label: ::Pago::UNSET,
  allow_discount_codes: ::Pago::UNSET,
  require_billing_address: ::Pago::UNSET,
  discount_id: ::Pago::UNSET,
  seats: ::Pago::UNSET,
  success_url: ::Pago::UNSET,
  return_url: ::Pago::UNSET
)
  super()
  assign(:trial_interval, trial_interval)
  assign(:trial_interval_count, trial_interval_count)
  assign(:metadata, )
  assign(:products, products)
  assign(:label, label)
  assign(:allow_discount_codes, allow_discount_codes)
  assign(:require_billing_address, require_billing_address)
  assign(:discount_id, discount_id)
  assign(:seats, seats)
  assign(:success_url, success_url)
  assign(:return_url, return_url)
end

Instance Attribute Details

#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, nil)


11359
11360
11361
# File 'lib/pago/v2026_04/models.rb', line 11359

def allow_discount_codes
  @allow_discount_codes
end

#discount_idString? (readonly)

ID of the discount to apply to the checkout. If the discount is not applicable anymore when opening the checkout link, it'll be ignored.

Returns:

  • (String, nil)


11367
11368
11369
# File 'lib/pago/v2026_04/models.rb', line 11367

def discount_id
  @discount_id
end

#labelString? (readonly)

Returns:

  • (String, nil)


11355
11356
11357
# File 'lib/pago/v2026_04/models.rb', line 11355

def label
  @label
end

#metadataHash{String => String, Integer, Float, Boolean} (readonly)

Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters. The value must be either:

  • A string with a maximum length of 500 characters
  • An integer
  • A floating-point number
  • A boolean

You can store up to 50 key-value pairs.

Returns:

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


11348
11349
11350
# File 'lib/pago/v2026_04/models.rb', line 11348

def 
  @metadata
end

#productsArray<String>? (readonly)

List of products that will be available to select at checkout.

Returns:

  • (Array<String>, nil)


11352
11353
11354
# File 'lib/pago/v2026_04/models.rb', line 11352

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.

Returns:

  • (Boolean, nil)


11363
11364
11365
# File 'lib/pago/v2026_04/models.rb', line 11363

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)


11379
11380
11381
# File 'lib/pago/v2026_04/models.rb', line 11379

def return_url
  @return_url
end

#seatsInteger? (readonly)

Preconfigured number of seats for seat-based pricing. When set, checkout sessions created from this link are locked to this number of seats and the customer won't be able to change it. All products on the link must use seat-based pricing and allow this number of seats. If the products no longer accommodate this value when the link is opened, it'll be ignored.

Returns:

  • (Integer, nil)


11371
11372
11373
# File 'lib/pago/v2026_04/models.rb', line 11371

def seats
  @seats
end

#success_urlString? (readonly)

URL where the customer will be redirected after a successful payment.You can add the checkout_id={CHECKOUT_ID} query parameter to retrieve the checkout session id.

Returns:

  • (String, nil)


11375
11376
11377
# File 'lib/pago/v2026_04/models.rb', line 11375

def success_url
  @success_url
end

#trial_intervalString? (readonly)

The interval unit for the trial period.

Returns:

  • (String, nil)


11330
11331
11332
# File 'lib/pago/v2026_04/models.rb', line 11330

def trial_interval
  @trial_interval
end

#trial_interval_countInteger? (readonly)

The number of interval units for the trial period.

Returns:

  • (Integer, nil)


11334
11335
11336
# File 'lib/pago/v2026_04/models.rb', line 11334

def trial_interval_count
  @trial_interval_count
end

Class Method Details

.from_json(data) ⇒ CheckoutLinkUpdate?

Parameters:

  • data (Hash, String, nil)

Returns:



11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
# File 'lib/pago/v2026_04/models.rb', line 11410

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(
      trial_interval: (data.key?("trial_interval") ? data["trial_interval"] : ::Pago::UNSET),
      trial_interval_count: (data.key?("trial_interval_count") ? data["trial_interval_count"] : ::Pago::UNSET),
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      products: (data.key?("products") ? data["products"] : ::Pago::UNSET),
      label: (data.key?("label") ? data["label"] : ::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),
      discount_id: (data.key?("discount_id") ? data["discount_id"] : ::Pago::UNSET),
      seats: (data.key?("seats") ? data["seats"] : ::Pago::UNSET),
      success_url: (data.key?("success_url") ? data["success_url"] : ::Pago::UNSET),
      return_url: (data.key?("return_url") ? data["return_url"] : ::Pago::UNSET)
    ),
    data
  )
end