Class: Pago::V2026_04::Models::CheckoutLinkCreateProduct

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

Overview

Schema to create a new checkout link from a a single product.

Deprecated: Use CheckoutLinkCreateProducts instead.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  metadata: "metadata",
  trial_interval: "trial_interval",
  trial_interval_count: "trial_interval_count",
  payment_processor: "payment_processor",
  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",
  product_id: "product_id"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["payment_processor", "product_id"].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(metadata: ::Pago::UNSET, trial_interval: ::Pago::UNSET, trial_interval_count: ::Pago::UNSET, payment_processor:, 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, product_id:) ⇒ CheckoutLinkCreateProduct

Returns a new instance of CheckoutLinkCreateProduct.

Parameters:

  • metadata: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • trial_interval: (String, nil) (defaults to: ::Pago::UNSET)
  • trial_interval_count: (Integer, nil) (defaults to: ::Pago::UNSET)
  • payment_processor: (String)
  • 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)
  • product_id: (String)


10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
# File 'lib/pago/v2026_04/models.rb', line 10814

def initialize(
  metadata: ::Pago::UNSET,
  trial_interval: ::Pago::UNSET,
  trial_interval_count: ::Pago::UNSET,
  payment_processor:,
  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,
  product_id:
)
  super()
  assign(:metadata, )
  assign(:trial_interval, trial_interval)
  assign(:trial_interval_count, trial_interval_count)
  assign(:payment_processor, payment_processor)
  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)
  assign(:product_id, product_id)
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)


10789
10790
10791
# File 'lib/pago/v2026_04/models.rb', line 10789

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)


10797
10798
10799
# File 'lib/pago/v2026_04/models.rb', line 10797

def discount_id
  @discount_id
end

#labelString? (readonly)

Optional label to distinguish links internally

Returns:

  • (String, nil)


10785
10786
10787
# File 'lib/pago/v2026_04/models.rb', line 10785

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})


10769
10770
10771
# File 'lib/pago/v2026_04/models.rb', line 10769

def 
  @metadata
end

#payment_processorString (readonly)

Payment processor to use. Currently only Stripe is supported.

Returns:

  • (String)


10781
10782
10783
# File 'lib/pago/v2026_04/models.rb', line 10781

def payment_processor
  @payment_processor
end

#product_idString (readonly)

Returns:

  • (String)


10812
10813
10814
# File 'lib/pago/v2026_04/models.rb', line 10812

def product_id
  @product_id
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)


10793
10794
10795
# File 'lib/pago/v2026_04/models.rb', line 10793

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)


10809
10810
10811
# File 'lib/pago/v2026_04/models.rb', line 10809

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)


10801
10802
10803
# File 'lib/pago/v2026_04/models.rb', line 10801

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)


10805
10806
10807
# File 'lib/pago/v2026_04/models.rb', line 10805

def success_url
  @success_url
end

#trial_intervalString? (readonly)

The interval unit for the trial period.

Returns:

  • (String, nil)


10773
10774
10775
# File 'lib/pago/v2026_04/models.rb', line 10773

def trial_interval
  @trial_interval
end

#trial_interval_countInteger? (readonly)

The number of interval units for the trial period.

Returns:

  • (Integer, nil)


10777
10778
10779
# File 'lib/pago/v2026_04/models.rb', line 10777

def trial_interval_count
  @trial_interval_count
end

Class Method Details

.from_json(data) ⇒ CheckoutLinkCreateProduct?

Parameters:

  • data (Hash, String, nil)

Returns:



10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
# File 'lib/pago/v2026_04/models.rb', line 10845

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(
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      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),
      payment_processor: (data.key?("payment_processor") ? data["payment_processor"] : ::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),
      product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET)
    ),
    data
  )
end