Class: Pago::V2026_04::Models::CheckoutLinkCreateProductPrice
- 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 price.
Deprecated: Use CheckoutLinkCreateProducts instead.
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", product_price_id: "product_price_id" }.freeze
- REQUIRED_KEYS =
["payment_processor", "product_price_id"].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.
- #product_price_id ⇒ String readonly
-
#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, product_price_id:) ⇒ CheckoutLinkCreateProductPrice
constructor
A new instance of CheckoutLinkCreateProductPrice.
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_price_id:) ⇒ CheckoutLinkCreateProductPrice
Returns a new instance of CheckoutLinkCreateProductPrice.
10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 |
# File 'lib/pago/v2026_04/models.rb', line 10947 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_price_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_price_id, product_price_id) 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.
10922 10923 10924 |
# File 'lib/pago/v2026_04/models.rb', line 10922 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.
10930 10931 10932 |
# File 'lib/pago/v2026_04/models.rb', line 10930 def discount_id @discount_id end |
#label ⇒ String? (readonly)
Optional label to distinguish links internally
10918 10919 10920 |
# File 'lib/pago/v2026_04/models.rb', line 10918 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.
10902 10903 10904 |
# File 'lib/pago/v2026_04/models.rb', line 10902 def @metadata end |
#payment_processor ⇒ String (readonly)
Payment processor to use. Currently only Stripe is supported.
10914 10915 10916 |
# File 'lib/pago/v2026_04/models.rb', line 10914 def payment_processor @payment_processor end |
#product_price_id ⇒ String (readonly)
10945 10946 10947 |
# File 'lib/pago/v2026_04/models.rb', line 10945 def product_price_id @product_price_id 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.
10926 10927 10928 |
# File 'lib/pago/v2026_04/models.rb', line 10926 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.
10942 10943 10944 |
# File 'lib/pago/v2026_04/models.rb', line 10942 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.
10934 10935 10936 |
# File 'lib/pago/v2026_04/models.rb', line 10934 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.
10938 10939 10940 |
# File 'lib/pago/v2026_04/models.rb', line 10938 def success_url @success_url end |
#trial_interval ⇒ String? (readonly)
The interval unit for the trial period.
10906 10907 10908 |
# File 'lib/pago/v2026_04/models.rb', line 10906 def trial_interval @trial_interval end |
#trial_interval_count ⇒ Integer? (readonly)
The number of interval units for the trial period.
10910 10911 10912 |
# File 'lib/pago/v2026_04/models.rb', line 10910 def trial_interval_count @trial_interval_count end |
Class Method Details
.from_json(data) ⇒ CheckoutLinkCreateProductPrice?
10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 |
# File 'lib/pago/v2026_04/models.rb', line 10978 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_price_id: (data.key?("product_price_id") ? data["product_price_id"] : ::Pago::UNSET) ), data ) end |