Class: Pago::V2026_04::Models::CheckoutLink
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Checkout link data.
Constant Summary collapse
- JSON_KEYS =
{ id: "id", created_at: "created_at", modified_at: "modified_at", trial_interval: "trial_interval", trial_interval_count: "trial_interval_count", metadata: "metadata", payment_processor: "payment_processor", client_secret: "client_secret", success_url: "success_url", return_url: "return_url", label: "label", allow_discount_codes: "allow_discount_codes", require_billing_address: "require_billing_address", discount_id: "discount_id", seats: "seats", organization_id: "organization_id", products: "products", discount: "discount", url: "url" }.freeze
- REQUIRED_KEYS =
["id", "created_at", "modified_at", "trial_interval", "trial_interval_count", "metadata", "payment_processor", "client_secret", "success_url", "return_url", "label", "allow_discount_codes", "require_billing_address", "discount_id", "seats", "organization_id", "products", "discount", "url"].freeze
Instance Attribute Summary collapse
-
#allow_discount_codes ⇒ Boolean
readonly
Whether to allow the customer to apply discount codes.
-
#client_secret ⇒ String
readonly
Client secret used to access the checkout link.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
- #discount ⇒ Models::DiscountFixedOnceForeverDurationBase, ... readonly
-
#discount_id ⇒ String?
readonly
ID of the discount to apply to the checkout.
-
#id ⇒ String
readonly
The ID of the object.
-
#label ⇒ String?
readonly
Optional label to distinguish links internally.
- #metadata ⇒ Hash{String => String, Integer, Float, Boolean} readonly
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#organization_id ⇒ String
readonly
The organization ID.
- #payment_processor ⇒ String readonly
- #products ⇒ Array<Models::CheckoutLinkProduct> 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.
-
#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.
- #url ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, created_at:, modified_at:, trial_interval:, trial_interval_count:, metadata:, payment_processor:, client_secret:, success_url:, return_url:, label:, allow_discount_codes:, require_billing_address:, discount_id:, seats:, organization_id:, products:, discount:, url:) ⇒ CheckoutLink
constructor
A new instance of CheckoutLink.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(id:, created_at:, modified_at:, trial_interval:, trial_interval_count:, metadata:, payment_processor:, client_secret:, success_url:, return_url:, label:, allow_discount_codes:, require_billing_address:, discount_id:, seats:, organization_id:, products:, discount:, url:) ⇒ CheckoutLink
Returns a new instance of CheckoutLink.
10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 |
# File 'lib/pago/v2026_04/models.rb', line 10660 def initialize( id:, created_at:, modified_at:, trial_interval:, trial_interval_count:, metadata:, payment_processor:, client_secret:, success_url:, return_url:, label:, allow_discount_codes:, require_billing_address:, discount_id:, seats:, organization_id:, products:, discount:, url: ) super() assign(:id, id) assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:trial_interval, trial_interval) assign(:trial_interval_count, trial_interval_count) assign(:metadata, ) assign(:payment_processor, payment_processor) assign(:client_secret, client_secret) assign(:success_url, success_url) assign(:return_url, return_url) 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(:organization_id, organization_id) assign(:products, products) assign(:discount, discount) assign(:url, url) 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.
10633 10634 10635 |
# File 'lib/pago/v2026_04/models.rb', line 10633 def allow_discount_codes @allow_discount_codes end |
#client_secret ⇒ String (readonly)
Client secret used to access the checkout link.
10617 10618 10619 |
# File 'lib/pago/v2026_04/models.rb', line 10617 def client_secret @client_secret end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
10595 10596 10597 |
# File 'lib/pago/v2026_04/models.rb', line 10595 def created_at @created_at end |
#discount ⇒ Models::DiscountFixedOnceForeverDurationBase, ... (readonly)
10655 10656 10657 |
# File 'lib/pago/v2026_04/models.rb', line 10655 def discount @discount 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.
10641 10642 10643 |
# File 'lib/pago/v2026_04/models.rb', line 10641 def discount_id @discount_id end |
#id ⇒ String (readonly)
The ID of the object.
10591 10592 10593 |
# File 'lib/pago/v2026_04/models.rb', line 10591 def id @id end |
#label ⇒ String? (readonly)
Optional label to distinguish links internally
10629 10630 10631 |
# File 'lib/pago/v2026_04/models.rb', line 10629 def label @label end |
#metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
10610 10611 10612 |
# File 'lib/pago/v2026_04/models.rb', line 10610 def @metadata end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
10599 10600 10601 |
# File 'lib/pago/v2026_04/models.rb', line 10599 def modified_at @modified_at end |
#organization_id ⇒ String (readonly)
The organization ID.
10649 10650 10651 |
# File 'lib/pago/v2026_04/models.rb', line 10649 def organization_id @organization_id end |
#payment_processor ⇒ String (readonly)
10613 10614 10615 |
# File 'lib/pago/v2026_04/models.rb', line 10613 def payment_processor @payment_processor end |
#products ⇒ Array<Models::CheckoutLinkProduct> (readonly)
10652 10653 10654 |
# File 'lib/pago/v2026_04/models.rb', line 10652 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.
10637 10638 10639 |
# File 'lib/pago/v2026_04/models.rb', line 10637 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.
10625 10626 10627 |
# File 'lib/pago/v2026_04/models.rb', line 10625 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.
10645 10646 10647 |
# File 'lib/pago/v2026_04/models.rb', line 10645 def seats @seats end |
#success_url ⇒ String? (readonly)
URL where the customer will be redirected after a successful payment.
10621 10622 10623 |
# File 'lib/pago/v2026_04/models.rb', line 10621 def success_url @success_url end |
#trial_interval ⇒ String? (readonly)
The interval unit for the trial period.
10603 10604 10605 |
# File 'lib/pago/v2026_04/models.rb', line 10603 def trial_interval @trial_interval end |
#trial_interval_count ⇒ Integer? (readonly)
The number of interval units for the trial period.
10607 10608 10609 |
# File 'lib/pago/v2026_04/models.rb', line 10607 def trial_interval_count @trial_interval_count end |
#url ⇒ String (readonly)
10658 10659 10660 |
# File 'lib/pago/v2026_04/models.rb', line 10658 def url @url end |
Class Method Details
.from_json(data) ⇒ CheckoutLink?
10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 |
# File 'lib/pago/v2026_04/models.rb', line 10705 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( id: (data.key?("id") ? data["id"] : ::Pago::UNSET), created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::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), payment_processor: (data.key?("payment_processor") ? data["payment_processor"] : ::Pago::UNSET), client_secret: (data.key?("client_secret") ? data["client_secret"] : ::Pago::UNSET), success_url: (data.key?("success_url") ? data["success_url"] : ::Pago::UNSET), return_url: (data.key?("return_url") ? data["return_url"] : ::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), organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET), products: (data.key?("products") ? ::Pago::Serde.array(data["products"]) { |item0| Models::CheckoutLinkProduct.from_json(item0) } : ::Pago::UNSET), discount: (data.key?("discount") ? ::Pago::Serde.union(data["discount"], variants: [Models::DiscountFixedOnceForeverDurationBase, Models::DiscountFixedRepeatDurationBase, Models::DiscountPercentageOnceForeverDurationBase, Models::DiscountPercentageRepeatDurationBase]) : ::Pago::UNSET), url: (data.key?("url") ? data["url"] : ::Pago::UNSET) ), data ) end |