Class: Pago::V2026_04::Models::CheckoutLinkCreateProducts
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Schema to create a new checkout link.
Constant Summary collapse
- JSON_KEYS =
{ 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", products: "products" }.freeze
- REQUIRED_KEYS =
["payment_processor", "products"].freeze
Instance Attribute Summary collapse
-
#allow_discount_codes ⇒ Boolean
readonly
Whether to allow the customer to apply discount codes.
-
#discount_id ⇒ String?
readonly
ID of the discount to apply to the checkout.
-
#label ⇒ String?
readonly
Optional label to distinguish links internally.
-
#metadata ⇒ Hash{String => String, Integer, Float, Boolean}
readonly
Key-value object allowing you to store additional information.
-
#payment_processor ⇒ String
readonly
Payment processor to use.
-
#products ⇒ Array<String>
readonly
List of products that will be available to select at checkout.
-
#require_billing_address ⇒ Boolean
readonly
Whether to require the customer to fill their full billing address, instead of just the country.
-
#return_url ⇒ String?
readonly
When set, a back button will be shown in the checkout to return to this URL.
-
#seats ⇒ Integer?
readonly
Preconfigured number of seats for seat-based pricing.
-
#success_url ⇒ String?
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. -
#trial_interval ⇒ String?
readonly
The interval unit for the trial period.
-
#trial_interval_count ⇒ Integer?
readonly
The number of interval units for the trial period.
Class Method Summary collapse
Instance Method Summary collapse
-
#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, products:) ⇒ CheckoutLinkCreateProducts
constructor
A new instance of CheckoutLinkCreateProducts.
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, products:) ⇒ CheckoutLinkCreateProducts
Returns a new instance of CheckoutLinkCreateProducts.
11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 |
# File 'lib/pago/v2026_04/models.rb', line 11079 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, products: ) 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(:products, products) end |
Instance Attribute Details
#allow_discount_codes ⇒ Boolean (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.
11053 11054 11055 |
# File 'lib/pago/v2026_04/models.rb', line 11053 def allow_discount_codes @allow_discount_codes end |
#discount_id ⇒ String? (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.
11061 11062 11063 |
# File 'lib/pago/v2026_04/models.rb', line 11061 def discount_id @discount_id end |
#label ⇒ String? (readonly)
Optional label to distinguish links internally
11049 11050 11051 |
# File 'lib/pago/v2026_04/models.rb', line 11049 def label @label end |
#metadata ⇒ Hash{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.
11033 11034 11035 |
# File 'lib/pago/v2026_04/models.rb', line 11033 def @metadata end |
#payment_processor ⇒ String (readonly)
Payment processor to use. Currently only Stripe is supported.
11045 11046 11047 |
# File 'lib/pago/v2026_04/models.rb', line 11045 def payment_processor @payment_processor end |
#products ⇒ Array<String> (readonly)
List of products that will be available to select at checkout.
11077 11078 11079 |
# File 'lib/pago/v2026_04/models.rb', line 11077 def products @products end |
#require_billing_address ⇒ Boolean (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.
11057 11058 11059 |
# File 'lib/pago/v2026_04/models.rb', line 11057 def require_billing_address @require_billing_address end |
#return_url ⇒ String? (readonly)
When set, a back button will be shown in the checkout to return to this URL.
11073 11074 11075 |
# File 'lib/pago/v2026_04/models.rb', line 11073 def return_url @return_url end |
#seats ⇒ Integer? (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.
11065 11066 11067 |
# File 'lib/pago/v2026_04/models.rb', line 11065 def seats @seats end |
#success_url ⇒ String? (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.
11069 11070 11071 |
# File 'lib/pago/v2026_04/models.rb', line 11069 def success_url @success_url end |
#trial_interval ⇒ String? (readonly)
The interval unit for the trial period.
11037 11038 11039 |
# File 'lib/pago/v2026_04/models.rb', line 11037 def trial_interval @trial_interval end |
#trial_interval_count ⇒ Integer? (readonly)
The number of interval units for the trial period.
11041 11042 11043 |
# File 'lib/pago/v2026_04/models.rb', line 11041 def trial_interval_count @trial_interval_count end |
Class Method Details
.from_json(data) ⇒ CheckoutLinkCreateProducts?
11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 |
# File 'lib/pago/v2026_04/models.rb', line 11110 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), products: (data.key?("products") ? data["products"] : ::Pago::UNSET) ), data ) end |