Class: Pago::V2026_04::Models::CheckoutUpdate

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

Overview

Update an existing checkout session using an access token.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  custom_field_data: "custom_field_data",
  product_id: "product_id",
  product_price_id: "product_price_id",
  amount: "amount",
  seats: "seats",
  is_business_customer: "is_business_customer",
  customer_name: "customer_name",
  customer_email: "customer_email",
  customer_billing_name: "customer_billing_name",
  customer_billing_address: "customer_billing_address",
  customer_tax_id: "customer_tax_id",
  locale: "locale",
  trial_interval: "trial_interval",
  trial_interval_count: "trial_interval_count",
  metadata: "metadata",
  currency: "currency",
  discount_id: "discount_id",
  allow_discount_codes: "allow_discount_codes",
  require_billing_address: "require_billing_address",
  allow_trial: "allow_trial",
  customer_ip_address: "customer_ip_address",
  customer_metadata: "customer_metadata",
  success_url: "success_url",
  return_url: "return_url",
  embed_origin: "embed_origin"
}.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(custom_field_data: ::Pago::UNSET, product_id: ::Pago::UNSET, product_price_id: ::Pago::UNSET, amount: ::Pago::UNSET, seats: ::Pago::UNSET, is_business_customer: ::Pago::UNSET, customer_name: ::Pago::UNSET, customer_email: ::Pago::UNSET, customer_billing_name: ::Pago::UNSET, customer_billing_address: ::Pago::UNSET, customer_tax_id: ::Pago::UNSET, locale: ::Pago::UNSET, trial_interval: ::Pago::UNSET, trial_interval_count: ::Pago::UNSET, metadata: ::Pago::UNSET, currency: ::Pago::UNSET, discount_id: ::Pago::UNSET, allow_discount_codes: ::Pago::UNSET, require_billing_address: ::Pago::UNSET, allow_trial: ::Pago::UNSET, customer_ip_address: ::Pago::UNSET, customer_metadata: ::Pago::UNSET, success_url: ::Pago::UNSET, return_url: ::Pago::UNSET, embed_origin: ::Pago::UNSET) ⇒ CheckoutUpdate

Returns a new instance of CheckoutUpdate.

Parameters:

  • custom_field_data: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • product_id: (String, nil) (defaults to: ::Pago::UNSET)
  • product_price_id: (String, nil) (defaults to: ::Pago::UNSET)
  • amount: (Integer, nil) (defaults to: ::Pago::UNSET)
  • seats: (Integer, nil) (defaults to: ::Pago::UNSET)
  • is_business_customer: (Boolean, nil) (defaults to: ::Pago::UNSET)
  • customer_name: (String, nil) (defaults to: ::Pago::UNSET)
  • customer_email: (String, nil) (defaults to: ::Pago::UNSET)
  • customer_billing_name: (String, nil) (defaults to: ::Pago::UNSET)
  • customer_billing_address: (Models::AddressInput, nil) (defaults to: ::Pago::UNSET)
  • customer_tax_id: (String, nil) (defaults to: ::Pago::UNSET)
  • locale: (String, nil) (defaults to: ::Pago::UNSET)
  • 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)
  • currency: (String, nil) (defaults to: ::Pago::UNSET)
  • discount_id: (String, nil) (defaults to: ::Pago::UNSET)
  • allow_discount_codes: (Boolean, nil) (defaults to: ::Pago::UNSET)
  • require_billing_address: (Boolean, nil) (defaults to: ::Pago::UNSET)
  • allow_trial: (Boolean, nil) (defaults to: ::Pago::UNSET)
  • customer_ip_address: (String, nil) (defaults to: ::Pago::UNSET)
  • customer_metadata: (Hash[String, untyped], nil) (defaults to: ::Pago::UNSET)
  • success_url: (String, nil) (defaults to: ::Pago::UNSET)
  • return_url: (String, nil) (defaults to: ::Pago::UNSET)
  • embed_origin: (String, nil) (defaults to: ::Pago::UNSET)


12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
# File 'lib/pago/v2026_04/models.rb', line 12753

def initialize(
  custom_field_data: ::Pago::UNSET,
  product_id: ::Pago::UNSET,
  product_price_id: ::Pago::UNSET,
  amount: ::Pago::UNSET,
  seats: ::Pago::UNSET,
  is_business_customer: ::Pago::UNSET,
  customer_name: ::Pago::UNSET,
  customer_email: ::Pago::UNSET,
  customer_billing_name: ::Pago::UNSET,
  customer_billing_address: ::Pago::UNSET,
  customer_tax_id: ::Pago::UNSET,
  locale: ::Pago::UNSET,
  trial_interval: ::Pago::UNSET,
  trial_interval_count: ::Pago::UNSET,
  metadata: ::Pago::UNSET,
  currency: ::Pago::UNSET,
  discount_id: ::Pago::UNSET,
  allow_discount_codes: ::Pago::UNSET,
  require_billing_address: ::Pago::UNSET,
  allow_trial: ::Pago::UNSET,
  customer_ip_address: ::Pago::UNSET,
  customer_metadata: ::Pago::UNSET,
  success_url: ::Pago::UNSET,
  return_url: ::Pago::UNSET,
  embed_origin: ::Pago::UNSET
)
  super()
  assign(:custom_field_data, custom_field_data)
  assign(:product_id, product_id)
  assign(:product_price_id, product_price_id)
  assign(:amount, amount)
  assign(:seats, seats)
  assign(:is_business_customer, is_business_customer)
  assign(:customer_name, customer_name)
  assign(:customer_email, customer_email)
  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(:trial_interval, trial_interval)
  assign(:trial_interval_count, trial_interval_count)
  assign(:metadata, )
  assign(:currency, currency)
  assign(:discount_id, discount_id)
  assign(:allow_discount_codes, allow_discount_codes)
  assign(:require_billing_address, require_billing_address)
  assign(:allow_trial, allow_trial)
  assign(:customer_ip_address, customer_ip_address)
  assign(:customer_metadata, )
  assign(:success_url, success_url)
  assign(:return_url, return_url)
  assign(:embed_origin, embed_origin)
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)


12714
12715
12716
# File 'lib/pago/v2026_04/models.rb', line 12714

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)


12722
12723
12724
# File 'lib/pago/v2026_04/models.rb', line 12722

def allow_trial
  @allow_trial
end

#amountInteger? (readonly)

Returns:

  • (Integer, nil)


12656
12657
12658
# File 'lib/pago/v2026_04/models.rb', line 12656

def amount
  @amount
end

#currencyString? (readonly)

Returns:

  • (String, nil)


12706
12707
12708
# File 'lib/pago/v2026_04/models.rb', line 12706

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


12644
12645
12646
# File 'lib/pago/v2026_04/models.rb', line 12644

def custom_field_data
  @custom_field_data
end

#customer_billing_addressModels::AddressInput? (readonly)

Returns:



12675
12676
12677
# File 'lib/pago/v2026_04/models.rb', line 12675

def customer_billing_address
  @customer_billing_address
end

#customer_billing_nameString? (readonly)

Returns:

  • (String, nil)


12672
12673
12674
# File 'lib/pago/v2026_04/models.rb', line 12672

def customer_billing_name
  @customer_billing_name
end

#customer_emailString? (readonly)

Returns:

  • (String, nil)


12669
12670
12671
# File 'lib/pago/v2026_04/models.rb', line 12669

def customer_email
  @customer_email
end

#customer_ip_addressString? (readonly)

Returns:

  • (String, nil)


12725
12726
12727
# File 'lib/pago/v2026_04/models.rb', line 12725

def customer_ip_address
  @customer_ip_address
end

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

Key-value object allowing you to store additional information that'll be copied to the created customer.

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


12739
12740
12741
# File 'lib/pago/v2026_04/models.rb', line 12739

def 
  @customer_metadata
end

#customer_nameString? (readonly)

Returns:

  • (String, nil)


12666
12667
12668
# File 'lib/pago/v2026_04/models.rb', line 12666

def customer_name
  @customer_name
end

#customer_tax_idString? (readonly)

Returns:

  • (String, nil)


12678
12679
12680
# File 'lib/pago/v2026_04/models.rb', line 12678

def customer_tax_id
  @customer_tax_id
end

#discount_idString? (readonly)

ID of the discount to apply to the checkout.

Returns:

  • (String, nil)


12710
12711
12712
# File 'lib/pago/v2026_04/models.rb', line 12710

def discount_id
  @discount_id
end

#embed_originString? (readonly)

If you plan to embed the checkout session, set this to the Origin of the embedding page. It'll allow the Pago iframe to communicate with the parent page.

Returns:

  • (String, nil)


12751
12752
12753
# File 'lib/pago/v2026_04/models.rb', line 12751

def embed_origin
  @embed_origin
end

#is_business_customerBoolean? (readonly)

Returns:

  • (Boolean, nil)


12663
12664
12665
# File 'lib/pago/v2026_04/models.rb', line 12663

def is_business_customer
  @is_business_customer
end

#localeString? (readonly)

Returns:

  • (String, nil)


12681
12682
12683
# File 'lib/pago/v2026_04/models.rb', line 12681

def locale
  @locale
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})


12703
12704
12705
# File 'lib/pago/v2026_04/models.rb', line 12703

def 
  @metadata
end

#product_idString? (readonly)

ID of the product to checkout. Must be present in the checkout's product list.

Returns:

  • (String, nil)


12648
12649
12650
# File 'lib/pago/v2026_04/models.rb', line 12648

def product_id
  @product_id
end

#product_price_idString? (readonly)

Deprecated.

ID of the product price to checkout. Must correspond to a price present in the checkout's product list.

Returns:

  • (String, nil)


12653
12654
12655
# File 'lib/pago/v2026_04/models.rb', line 12653

def product_price_id
  @product_price_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. If you preset the billing address, this setting will be automatically set to true.

Returns:

  • (Boolean, nil)


12718
12719
12720
# File 'lib/pago/v2026_04/models.rb', line 12718

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)


12747
12748
12749
# File 'lib/pago/v2026_04/models.rb', line 12747

def return_url
  @return_url
end

#seatsInteger? (readonly)

Number of seats for seat-based pricing.

Returns:

  • (Integer, nil)


12660
12661
12662
# File 'lib/pago/v2026_04/models.rb', line 12660

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)


12743
12744
12745
# File 'lib/pago/v2026_04/models.rb', line 12743

def success_url
  @success_url
end

#trial_intervalString? (readonly)

The interval unit for the trial period.

Returns:

  • (String, nil)


12685
12686
12687
# File 'lib/pago/v2026_04/models.rb', line 12685

def trial_interval
  @trial_interval
end

#trial_interval_countInteger? (readonly)

The number of interval units for the trial period.

Returns:

  • (Integer, nil)


12689
12690
12691
# File 'lib/pago/v2026_04/models.rb', line 12689

def trial_interval_count
  @trial_interval_count
end

Class Method Details

.from_json(data) ⇒ CheckoutUpdate?

Parameters:

  • data (Hash, String, nil)

Returns:



12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
# File 'lib/pago/v2026_04/models.rb', line 12810

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(
      custom_field_data: (data.key?("custom_field_data") ? data["custom_field_data"] : ::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),
      amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET),
      seats: (data.key?("seats") ? data["seats"] : ::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_billing_name: (data.key?("customer_billing_name") ? data["customer_billing_name"] : ::Pago::UNSET),
      customer_billing_address: (data.key?("customer_billing_address") ? Models::AddressInput.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),
      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),
      currency: (data.key?("currency") ? data["currency"] : ::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),
      allow_trial: (data.key?("allow_trial") ? data["allow_trial"] : ::Pago::UNSET),
      customer_ip_address: (data.key?("customer_ip_address") ? data["customer_ip_address"] : ::Pago::UNSET),
      customer_metadata: (data.key?("customer_metadata") ? data["customer_metadata"] : ::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)
    ),
    data
  )
end