diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cacb3a0e..423c69fc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.36" + ".": "0.0.37" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index beca1d95..fc1b6001 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 191 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-dbc99b95f02e6b568750045987763dbdafa1edc5a7ac425e3831e61929d7ecec.yml -openapi_spec_hash: d2ec900df5b29b03d1d1786336d1daf5 -config_hash: 1a836d20bb988f001cc66d1526f71306 +configured_endpoints: 195 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-58749e1928f402cc3e236d38b53bce3b10530bfaccbe426181bba9b1bfc42498.yml +openapi_spec_hash: ecea6e6c4b93665aee5554839a26ded8 +config_hash: 2ceaf6cd488db626c181a1ca9460ace6 diff --git a/CHANGELOG.md b/CHANGELOG.md index a4c61df1..8f9e8c7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 0.0.37 (2026-04-10) + +Full Changelog: [v0.0.36...v0.0.37](https://github.com/whopio/whopsdk-ruby/compare/v0.0.36...v0.0.37) + +### Features + +* **api:** api update ([4130e50](https://github.com/whopio/whopsdk-ruby/commit/4130e501162d6ba1a80de15a056950aca35508ad)) +* **api:** api update ([1bac626](https://github.com/whopio/whopsdk-ruby/commit/1bac6269c3270ac68a86e36e9fedba945b43084c)) +* **api:** api update ([cd88f35](https://github.com/whopio/whopsdk-ruby/commit/cd88f351641bdca8bb65efea98998f80590ccf8f)) +* **api:** api update ([346d6ab](https://github.com/whopio/whopsdk-ruby/commit/346d6ab266c7382e3e17e5afcd6823558b155a81)) +* **api:** api update ([25ceb03](https://github.com/whopio/whopsdk-ruby/commit/25ceb03fe003bcc96db811fd444989cd7266d37f)) +* **api:** manual updates ([df60228](https://github.com/whopio/whopsdk-ruby/commit/df6022818f7e90ff309bf0c54d278f6244e981b9)) +* **api:** manual updates ([a3ed550](https://github.com/whopio/whopsdk-ruby/commit/a3ed550169ba398cfc6581d9281eb81fce212802)) + + +### Bug Fixes + +* multipart encoding for file arrays ([feee3d1](https://github.com/whopio/whopsdk-ruby/commit/feee3d1be0bb3f387d1c5cb7c61459442c762d94)) + ## 0.0.36 (2026-04-01) Full Changelog: [v0.0.35...v0.0.36](https://github.com/whopio/whopsdk-ruby/compare/v0.0.35...v0.0.36) diff --git a/Gemfile.lock b/Gemfile.lock index 6b1e00f1..9260ba2b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - whop_sdk (0.0.36) + whop_sdk (0.0.37) cgi connection_pool standardwebhooks diff --git a/README.md b/README.md index 759c64eb..ee101424 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "whop_sdk", "~> 0.0.36" +gem "whop_sdk", "~> 0.0.37" ``` diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index c6e15900..76e3a150 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -132,7 +132,9 @@ require_relative "whop_sdk/models/checkout_configuration_list_params" require_relative "whop_sdk/models/checkout_configuration_list_response" require_relative "whop_sdk/models/checkout_configuration_retrieve_params" +require_relative "whop_sdk/models/checkout_font" require_relative "whop_sdk/models/checkout_modes" +require_relative "whop_sdk/models/checkout_shape" require_relative "whop_sdk/models/collection_method" require_relative "whop_sdk/models/company" require_relative "whop_sdk/models/company_create_params" @@ -275,13 +277,20 @@ require_relative "whop_sdk/models/invoice" require_relative "whop_sdk/models/invoice_created_webhook_event" require_relative "whop_sdk/models/invoice_create_params" +require_relative "whop_sdk/models/invoice_delete_params" +require_relative "whop_sdk/models/invoice_delete_response" require_relative "whop_sdk/models/invoice_list_item" require_relative "whop_sdk/models/invoice_list_params" require_relative "whop_sdk/models/invoice_marked_uncollectible_webhook_event" +require_relative "whop_sdk/models/invoice_mark_paid_params" +require_relative "whop_sdk/models/invoice_mark_paid_response" +require_relative "whop_sdk/models/invoice_mark_uncollectible_params" +require_relative "whop_sdk/models/invoice_mark_uncollectible_response" require_relative "whop_sdk/models/invoice_paid_webhook_event" require_relative "whop_sdk/models/invoice_past_due_webhook_event" require_relative "whop_sdk/models/invoice_retrieve_params" require_relative "whop_sdk/models/invoice_status" +require_relative "whop_sdk/models/invoice_update_params" require_relative "whop_sdk/models/invoice_voided_webhook_event" require_relative "whop_sdk/models/invoice_void_params" require_relative "whop_sdk/models/invoice_void_response" @@ -445,6 +454,7 @@ require_relative "whop_sdk/models/support_channel_list_params" require_relative "whop_sdk/models/support_channel_list_response" require_relative "whop_sdk/models/support_channel_retrieve_params" +require_relative "whop_sdk/models/tax_identifier_type" require_relative "whop_sdk/models/tax_type" require_relative "whop_sdk/models/topup_create_params" require_relative "whop_sdk/models/topup_create_response" diff --git a/lib/whop_sdk/internal/util.rb b/lib/whop_sdk/internal/util.rb index cd82ed28..e17b4109 100644 --- a/lib/whop_sdk/internal/util.rb +++ b/lib/whop_sdk/internal/util.rb @@ -610,6 +610,7 @@ def encode_query_params(query) # # @return [Array(String, Enumerable)] private def encode_multipart_streaming(body) + # rubocop:disable Style/CaseEquality # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length boundary = SecureRandom.urlsafe_base64(46) @@ -619,7 +620,7 @@ def encode_query_params(query) in Hash body.each do |key, val| case val - in Array if val.all? { primitive?(_1) } + in Array if val.all? { primitive?(_1) || WhopSDK::Internal::Type::FileInput === _1 } val.each do |v| write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing) end @@ -635,6 +636,7 @@ def encode_query_params(query) fused_io = fused_enum(strio) { closing.each(&:call) } [boundary, fused_io] + # rubocop:enable Style/CaseEquality end # @api private diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index c2895a70..218eb441 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -141,8 +141,12 @@ module WhopSDK CheckoutConfigurationRetrieveParams = WhopSDK::Models::CheckoutConfigurationRetrieveParams + CheckoutFont = WhopSDK::Models::CheckoutFont + CheckoutModes = WhopSDK::Models::CheckoutModes + CheckoutShape = WhopSDK::Models::CheckoutShape + CollectionMethod = WhopSDK::Models::CollectionMethod Company = WhopSDK::Models::Company @@ -366,12 +370,18 @@ module WhopSDK InvoiceCreateParams = WhopSDK::Models::InvoiceCreateParams + InvoiceDeleteParams = WhopSDK::Models::InvoiceDeleteParams + InvoiceListItem = WhopSDK::Models::InvoiceListItem InvoiceListParams = WhopSDK::Models::InvoiceListParams InvoiceMarkedUncollectibleWebhookEvent = WhopSDK::Models::InvoiceMarkedUncollectibleWebhookEvent + InvoiceMarkPaidParams = WhopSDK::Models::InvoiceMarkPaidParams + + InvoiceMarkUncollectibleParams = WhopSDK::Models::InvoiceMarkUncollectibleParams + InvoicePaidWebhookEvent = WhopSDK::Models::InvoicePaidWebhookEvent InvoicePastDueWebhookEvent = WhopSDK::Models::InvoicePastDueWebhookEvent @@ -380,6 +390,8 @@ module WhopSDK InvoiceStatus = WhopSDK::Models::InvoiceStatus + InvoiceUpdateParams = WhopSDK::Models::InvoiceUpdateParams + InvoiceVoidedWebhookEvent = WhopSDK::Models::InvoiceVoidedWebhookEvent InvoiceVoidParams = WhopSDK::Models::InvoiceVoidParams @@ -643,6 +655,8 @@ module WhopSDK SupportChannelRetrieveParams = WhopSDK::Models::SupportChannelRetrieveParams + TaxIdentifierType = WhopSDK::Models::TaxIdentifierType + TaxType = WhopSDK::Models::TaxType TopupCreateParams = WhopSDK::Models::TopupCreateParams diff --git a/lib/whop_sdk/models/checkout_configuration_create_params.rb b/lib/whop_sdk/models/checkout_configuration_create_params.rb index de1dba72..b5a37385 100644 --- a/lib/whop_sdk/models/checkout_configuration_create_params.rb +++ b/lib/whop_sdk/models/checkout_configuration_create_params.rb @@ -45,6 +45,17 @@ class CreateCheckoutSessionInputModePaymentWithPlan < WhopSDK::Internal::Type::B # @return [String, nil] optional :affiliate_code, String, nil?: true + # @!attribute checkout_styling + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + # + # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling, nil] + optional :checkout_styling, + -> { + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling + }, + nil?: true + # @!attribute currency # The available currencies on the platform # @@ -86,7 +97,7 @@ class CreateCheckoutSessionInputModePaymentWithPlan < WhopSDK::Internal::Type::B # @return [String, nil] optional :source_url, String, nil?: true - # @!method initialize(plan:, affiliate_code: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, redirect_url: nil, source_url: nil) + # @!method initialize(plan:, affiliate_code: nil, checkout_styling: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, redirect_url: nil, source_url: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan} # for more details. @@ -97,6 +108,8 @@ class CreateCheckoutSessionInputModePaymentWithPlan < WhopSDK::Internal::Type::B # # @param affiliate_code [String, nil] An affiliate tracking code to attribute the checkout to a specific affiliate. # + # @param checkout_styling [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling, nil] Checkout styling overrides for this session. Overrides plan and company defaults + # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform # # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value metadata to attach to the checkout configuration. @@ -550,6 +563,37 @@ class Product < WhopSDK::Internal::Type::BaseModel end end + # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan#checkout_styling + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + # @!attribute border_style + # The different border-radius styles available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutShape, nil] + optional :border_style, enum: -> { WhopSDK::CheckoutShape }, nil?: true + + # @!attribute button_color + # A hex color code for the button color (e.g. #FF5733). + # + # @return [String, nil] + optional :button_color, String, nil?: true + + # @!attribute font_family + # The different font families available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutFont, nil] + optional :font_family, enum: -> { WhopSDK::CheckoutFont }, nil?: true + + # @!method initialize(border_style: nil, button_color: nil, font_family: nil) + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + # + # @param border_style [Symbol, WhopSDK::Models::CheckoutShape, nil] The different border-radius styles available for checkout pages. + # + # @param button_color [String, nil] A hex color code for the button color (e.g. #FF5733). + # + # @param font_family [Symbol, WhopSDK::Models::CheckoutFont, nil] The different font families available for checkout pages. + end + # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan#mode module Mode extend WhopSDK::Internal::Type::Enum @@ -616,6 +660,17 @@ class CreateCheckoutSessionInputModePaymentWithPlanID < WhopSDK::Internal::Type: # @return [String, nil] optional :affiliate_code, String, nil?: true + # @!attribute checkout_styling + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + # + # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling, nil] + optional :checkout_styling, + -> { + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling + }, + nil?: true + # @!attribute currency # The available currencies on the platform # @@ -657,7 +712,7 @@ class CreateCheckoutSessionInputModePaymentWithPlanID < WhopSDK::Internal::Type: # @return [String, nil] optional :source_url, String, nil?: true - # @!method initialize(plan_id:, affiliate_code: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, redirect_url: nil, source_url: nil) + # @!method initialize(plan_id:, affiliate_code: nil, checkout_styling: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, redirect_url: nil, source_url: nil) # Some parameter documentations has been truncated, see # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID} # for more details. @@ -668,6 +723,8 @@ class CreateCheckoutSessionInputModePaymentWithPlanID < WhopSDK::Internal::Type: # # @param affiliate_code [String, nil] An affiliate tracking code to attribute the checkout to a specific affiliate. # + # @param checkout_styling [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling, nil] Checkout styling overrides for this session. Overrides plan and company defaults + # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform # # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value metadata to attach to the checkout configuration. @@ -680,6 +737,37 @@ class CreateCheckoutSessionInputModePaymentWithPlanID < WhopSDK::Internal::Type: # # @param source_url [String, nil] The URL of the page where the checkout is being initiated from. + # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID#checkout_styling + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + # @!attribute border_style + # The different border-radius styles available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutShape, nil] + optional :border_style, enum: -> { WhopSDK::CheckoutShape }, nil?: true + + # @!attribute button_color + # A hex color code for the button color (e.g. #FF5733). + # + # @return [String, nil] + optional :button_color, String, nil?: true + + # @!attribute font_family + # The different font families available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutFont, nil] + optional :font_family, enum: -> { WhopSDK::CheckoutFont }, nil?: true + + # @!method initialize(border_style: nil, button_color: nil, font_family: nil) + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + # + # @param border_style [Symbol, WhopSDK::Models::CheckoutShape, nil] The different border-radius styles available for checkout pages. + # + # @param button_color [String, nil] A hex color code for the button color (e.g. #FF5733). + # + # @param font_family [Symbol, WhopSDK::Models::CheckoutFont, nil] The different font families available for checkout pages. + end + # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID#mode module Mode extend WhopSDK::Internal::Type::Enum @@ -745,6 +833,17 @@ class CreateCheckoutSessionInputModeSetup < WhopSDK::Internal::Type::BaseModel # @return [Symbol, :setup] required :mode, const: :setup + # @!attribute checkout_styling + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + # + # @return [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling, nil] + optional :checkout_styling, + -> { + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling + }, + nil?: true + # @!attribute currency # The available currencies on the platform # @@ -780,7 +879,7 @@ class CreateCheckoutSessionInputModeSetup < WhopSDK::Internal::Type::BaseModel # @return [String, nil] optional :source_url, String, nil?: true - # @!method initialize(company_id:, currency: nil, metadata: nil, payment_method_configuration: nil, redirect_url: nil, source_url: nil, mode: :setup) + # @!method initialize(company_id:, checkout_styling: nil, currency: nil, metadata: nil, payment_method_configuration: nil, redirect_url: nil, source_url: nil, mode: :setup) # Some parameter documentations has been truncated, see # {WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup} # for more details. @@ -789,6 +888,8 @@ class CreateCheckoutSessionInputModeSetup < WhopSDK::Internal::Type::BaseModel # # @param company_id [String] The unique identifier of the company to create the checkout configuration for. O # + # @param checkout_styling [WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling, nil] Checkout styling overrides for this session. Overrides plan and company defaults + # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform # # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value metadata to attach to the checkout configuration. @@ -801,6 +902,37 @@ class CreateCheckoutSessionInputModeSetup < WhopSDK::Internal::Type::BaseModel # # @param mode [Symbol, :setup] + # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup#checkout_styling + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + # @!attribute border_style + # The different border-radius styles available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutShape, nil] + optional :border_style, enum: -> { WhopSDK::CheckoutShape }, nil?: true + + # @!attribute button_color + # A hex color code for the button color (e.g. #FF5733). + # + # @return [String, nil] + optional :button_color, String, nil?: true + + # @!attribute font_family + # The different font families available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutFont, nil] + optional :font_family, enum: -> { WhopSDK::CheckoutFont }, nil?: true + + # @!method initialize(border_style: nil, button_color: nil, font_family: nil) + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + # + # @param border_style [Symbol, WhopSDK::Models::CheckoutShape, nil] The different border-radius styles available for checkout pages. + # + # @param button_color [String, nil] A hex color code for the button color (e.g. #FF5733). + # + # @param font_family [Symbol, WhopSDK::Models::CheckoutFont, nil] The different font families available for checkout pages. + end + # @see WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup#payment_method_configuration class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel # @!attribute disabled diff --git a/lib/whop_sdk/models/checkout_font.rb b/lib/whop_sdk/models/checkout_font.rb new file mode 100644 index 00000000..863fbdd8 --- /dev/null +++ b/lib/whop_sdk/models/checkout_font.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # The different font families available for checkout pages. + module CheckoutFont + extend WhopSDK::Internal::Type::Enum + + SYSTEM = :system + ROBOTO = :roboto + OPEN_SANS = :open_sans + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/whop_sdk/models/checkout_shape.rb b/lib/whop_sdk/models/checkout_shape.rb new file mode 100644 index 00000000..d80a7627 --- /dev/null +++ b/lib/whop_sdk/models/checkout_shape.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # The different border-radius styles available for checkout pages. + module CheckoutShape + extend WhopSDK::Internal::Type::Enum + + ROUNDED = :rounded + PILL = :pill + RECTANGULAR = :rectangular + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/whop_sdk/models/invoice_create_params.rb b/lib/whop_sdk/models/invoice_create_params.rb index b0b4e573..fadb31f4 100644 --- a/lib/whop_sdk/models/invoice_create_params.rb +++ b/lib/whop_sdk/models/invoice_create_params.rb @@ -10,11 +10,11 @@ class InvoiceCreateParams < WhopSDK::Internal::Type::BaseModel # @!attribute body # Parameters for CreateInvoice # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress] + # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID] required :body, union: -> { WhopSDK::InvoiceCreateParams::Body } # @!method initialize(body:, request_options: {}) - # @param body [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress] Parameters for CreateInvoice + # @param body [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID] Parameters for CreateInvoice # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] @@ -23,18 +23,12 @@ module Body extend WhopSDK::Internal::Type::Union # Autogenerated input type of CreateInvoice - variant -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID } + variant -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct } # Autogenerated input type of CreateInvoice - variant -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress } + variant -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID } - # Autogenerated input type of CreateInvoice - variant -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID } - - # Autogenerated input type of CreateInvoice - variant -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress } - - class CreateInvoiceInputWithProductAndMemberID < WhopSDK::Internal::Type::BaseModel + class CreateInvoiceInputWithProduct < WhopSDK::Internal::Type::BaseModel # @!attribute collection_method # How the invoice should be collected. Use charge_automatically to charge a stored # payment method, or send_invoice to email the customer. @@ -48,33 +42,19 @@ class CreateInvoiceInputWithProductAndMemberID < WhopSDK::Internal::Type::BaseMo # @return [String] required :company_id, String - # @!attribute due_date - # The date by which the invoice must be paid. - # - # @return [Time] - required :due_date, Time - - # @!attribute member_id - # The unique identifier of an existing member to create this invoice for. If not - # provided, you must supply an email_address and customer_name. - # - # @return [String] - required :member_id, String - # @!attribute plan # The plan attributes defining the price, currency, and billing interval for this # invoice. # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan] - required :plan, -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan } + # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan] + required :plan, -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan } # @!attribute product # The properties of the product to create for this invoice. Provide this to create # a new product inline. # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product] - required :product, - -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product } + # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product] + required :product, -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product } # @!attribute automatically_finalizes_at # The date and time when the invoice will be automatically finalized and charged. @@ -88,11 +68,9 @@ class CreateInvoiceInputWithProductAndMemberID < WhopSDK::Internal::Type::BaseMo # Inline billing address to create a new mailing address for this invoice. Cannot # be used together with mailing_address_id. # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress, nil] + # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress, nil] optional :billing_address, - -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress - }, + -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress }, nil?: true # @!attribute charge_buyer_fee @@ -108,14 +86,28 @@ class CreateInvoiceInputWithProductAndMemberID < WhopSDK::Internal::Type::BaseMo # @return [String, nil] optional :customer_name, String, nil?: true + # @!attribute due_date + # The date by which the invoice must be paid. Required unless save_as_draft is + # true. + # + # @return [Time, nil] + optional :due_date, Time, nil?: true + + # @!attribute email_address + # The email address of the customer. Required when creating an invoice for a + # customer who is not yet a member of the company. + # + # @return [String, nil] + optional :email_address, String, nil?: true + # @!attribute line_items # Optional line items that break down the invoice total. When provided, the sum of # (quantity \* unit_price) for all items must equal the plan price. # - # @return [Array, nil] + # @return [Array, nil] optional :line_items, -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem] + WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem] }, nil?: true @@ -126,6 +118,13 @@ class CreateInvoiceInputWithProductAndMemberID < WhopSDK::Internal::Type::BaseMo # @return [String, nil] optional :mailing_address_id, String, nil?: true + # @!attribute member_id + # The unique identifier of an existing member to create this invoice for. If not + # provided, you must supply an email_address and customer_name. + # + # @return [String, nil] + optional :member_id, String, nil?: true + # @!attribute payment_method_id # The unique identifier of the payment method to charge. Required when # collection_method is charge_automatically. @@ -140,10 +139,17 @@ class CreateInvoiceInputWithProductAndMemberID < WhopSDK::Internal::Type::BaseMo # @return [String, nil] optional :payment_token_id, String, nil?: true - # @!method initialize(collection_method:, company_id:, due_date:, member_id:, plan:, product:, automatically_finalizes_at: nil, billing_address: nil, charge_buyer_fee: nil, customer_name: nil, line_items: nil, mailing_address_id: nil, payment_method_id: nil, payment_token_id: nil) + # @!attribute save_as_draft + # When true, creates the invoice as a draft without sending or charging. Relaxes + # customer and due date requirements. + # + # @return [Boolean, nil] + optional :save_as_draft, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!method initialize(collection_method:, company_id:, plan:, product:, automatically_finalizes_at: nil, billing_address: nil, charge_buyer_fee: nil, customer_name: nil, due_date: nil, email_address: nil, line_items: nil, mailing_address_id: nil, member_id: nil, payment_method_id: nil, payment_token_id: nil, save_as_draft: nil) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID} - # for more details. + # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct} for + # more details. # # Autogenerated input type of CreateInvoice # @@ -151,32 +157,36 @@ class CreateInvoiceInputWithProductAndMemberID < WhopSDK::Internal::Type::BaseMo # # @param company_id [String] The unique identifier of the company to create this invoice for. # - # @param due_date [Time] The date by which the invoice must be paid. - # - # @param member_id [String] The unique identifier of an existing member to create this invoice for. If not p + # @param plan [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan] The plan attributes defining the price, currency, and billing interval for this # - # @param plan [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan] The plan attributes defining the price, currency, and billing interval for this - # - # @param product [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product] The properties of the product to create for this invoice. Provide this to create + # @param product [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product] The properties of the product to create for this invoice. Provide this to create # # @param automatically_finalizes_at [Time, nil] The date and time when the invoice will be automatically finalized and charged. # - # @param billing_address [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress, nil] Inline billing address to create a new mailing address for this invoice. Cannot + # @param billing_address [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress, nil] Inline billing address to create a new mailing address for this invoice. Cannot # # @param charge_buyer_fee [Boolean, nil] Whether to charge the customer a buyer fee on this invoice. # # @param customer_name [String, nil] The name of the customer. Required when creating an invoice for a customer who i # - # @param line_items [Array, nil] Optional line items that break down the invoice total. When provided, the sum of + # @param due_date [Time, nil] The date by which the invoice must be paid. Required unless save_as_draft is tru + # + # @param email_address [String, nil] The email address of the customer. Required when creating an invoice for a custo + # + # @param line_items [Array, nil] Optional line items that break down the invoice total. When provided, the sum of # # @param mailing_address_id [String, nil] The unique identifier of an existing mailing address to attach to this invoice. # + # @param member_id [String, nil] The unique identifier of an existing member to create this invoice for. If not p + # # @param payment_method_id [String, nil] The unique identifier of the payment method to charge. Required when # collection\_ # # @param payment_token_id [String, nil] The payment token ID to use for this invoice. If using charge_automatically, you + # + # @param save_as_draft [Boolean, nil] When true, creates the invoice as a draft without sending or charging. Relaxes c - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID#plan + # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct#plan class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute billing_period # The interval in days at which the plan charges (renewal plans). @@ -187,10 +197,10 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute custom_fields # An array of custom field objects. # - # @return [Array, nil] + # @return [Array, nil] optional :custom_fields, -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::CustomField] + WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField] }, nil?: true @@ -231,10 +241,10 @@ class Plan < WhopSDK::Internal::Type::BaseModel # The explicit payment method configuration for the plan. If not provided, the # platform or company's defaults will apply. # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration, nil] + # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration, nil] optional :payment_method_configuration, -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration }, nil?: true @@ -284,7 +294,7 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!method initialize(billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan} + # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan} # for more details. # # The plan attributes defining the price, currency, and billing interval for this @@ -292,7 +302,7 @@ class Plan < WhopSDK::Internal::Type::BaseModel # # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans). # - # @param custom_fields [Array, nil] An array of custom field objects. + # @param custom_fields [Array, nil] An array of custom field objects. # # @param description [String, nil] The description of the plan. # @@ -304,7 +314,7 @@ class Plan < WhopSDK::Internal::Type::BaseModel # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls # - # @param payment_method_configuration [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the plan. If not provided, the pla + # @param payment_method_configuration [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the plan. If not provided, the pla # # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product # @@ -371,7 +381,7 @@ class CustomField < WhopSDK::Internal::Type::BaseModel # @param field_type [Symbol, :text] The type of the custom field. end - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan#payment_method_configuration + # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan#payment_method_configuration class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel # @!attribute disabled # An array of payment method identifiers that are explicitly disabled. Only @@ -399,7 +409,7 @@ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel # @!method initialize(disabled:, enabled:, include_platform_defaults:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration} + # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration} # for more details. # # The explicit payment method configuration for the plan. If not provided, the @@ -413,7 +423,7 @@ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel end end - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID#product + # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct#product class Product < WhopSDK::Internal::Type::BaseModel # @!attribute title # The title of the product. @@ -436,7 +446,7 @@ class Product < WhopSDK::Internal::Type::BaseModel # @param product_tax_code_id [String, nil] The ID of the product tax code to apply to this product. end - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID#billing_address + # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct#billing_address class BillingAddress < WhopSDK::Internal::Type::BaseModel # @!attribute city # The city of the address. @@ -489,12 +499,8 @@ class BillingAddress < WhopSDK::Internal::Type::BaseModel # @!attribute tax_id_type # The type of tax identifier # - # @return [Symbol, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType, nil] - optional :tax_id_type, - enum: -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType - }, - nil?: true + # @return [Symbol, WhopSDK::Models::TaxIdentifierType, nil] + optional :tax_id_type, enum: -> { WhopSDK::TaxIdentifierType }, nil?: true # @!attribute tax_id_value # The value of the tax identifier. @@ -522,131 +528,9 @@ class BillingAddress < WhopSDK::Internal::Type::BaseModel # # @param state [String, nil] The state of the address. # - # @param tax_id_type [Symbol, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType, nil] The type of tax identifier + # @param tax_id_type [Symbol, WhopSDK::Models::TaxIdentifierType, nil] The type of tax identifier # # @param tax_id_value [String, nil] The value of the tax identifier. - - # The type of tax identifier - # - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress#tax_id_type - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - AD_NRT = :ad_nrt - AO_TIN = :ao_tin - AR_CUIT = :ar_cuit - AM_TIN = :am_tin - AW_TIN = :aw_tin - AU_ABN = :au_abn - AU_ARN = :au_arn - EU_VAT = :eu_vat - AZ_TIN = :az_tin - BS_TIN = :bs_tin - BH_VAT = :bh_vat - BD_BIN = :bd_bin - BB_TIN = :bb_tin - BY_TIN = :by_tin - BJ_IFU = :bj_ifu - BO_TIN = :bo_tin - BA_TIN = :ba_tin - BR_CNPJ = :br_cnpj - BR_CPF = :br_cpf - BG_UIC = :bg_uic - BF_IFU = :bf_ifu - KH_TIN = :kh_tin - CM_NIU = :cm_niu - CA_BN = :ca_bn - CA_GST_HST = :ca_gst_hst - CA_PST_BC = :ca_pst_bc - CA_PST_MB = :ca_pst_mb - CA_PST_SK = :ca_pst_sk - CA_QST = :ca_qst - CV_NIF = :cv_nif - CL_TIN = :cl_tin - CN_TIN = :cn_tin - CO_NIT = :co_nit - CD_NIF = :cd_nif - CR_TIN = :cr_tin - HR_OIB = :hr_oib - DO_RCN = :do_rcn - EC_RUC = :ec_ruc - EG_TIN = :eg_tin - SV_NIT = :sv_nit - ET_TIN = :et_tin - EU_OSS_VAT = :eu_oss_vat - GE_VAT = :ge_vat - DE_STN = :de_stn - GB_VAT = :gb_vat - GN_NIF = :gn_nif - HK_BR = :hk_br - HU_TIN = :hu_tin - IS_VAT = :is_vat - IN_GST = :in_gst - ID_NPWP = :id_npwp - IL_VAT = :il_vat - JP_CN = :jp_cn - JP_RN = :jp_rn - JP_TRN = :jp_trn - KZ_BIN = :kz_bin - KE_PIN = :ke_pin - KG_TIN = :kg_tin - LA_TIN = :la_tin - LI_UID = :li_uid - LI_VAT = :li_vat - MY_FRP = :my_frp - MY_ITN = :my_itn - MY_SST = :my_sst - MR_NIF = :mr_nif - MX_RFC = :mx_rfc - MD_VAT = :md_vat - ME_PIB = :me_pib - MA_VAT = :ma_vat - NP_PAN = :np_pan - NZ_GST = :nz_gst - NG_TIN = :ng_tin - MK_VAT = :mk_vat - NO_VAT = :no_vat - NO_VOEC = :no_voec - OM_VAT = :om_vat - PE_RUC = :pe_ruc - PH_TIN = :ph_tin - PL_NIP = :pl_nip - RO_TIN = :ro_tin - RU_INN = :ru_inn - RU_KPP = :ru_kpp - SA_VAT = :sa_vat - SN_NINEA = :sn_ninea - RS_PIB = :rs_pib - SG_GST = :sg_gst - SG_UEN = :sg_uen - SI_TIN = :si_tin - ZA_VAT = :za_vat - KR_BRN = :kr_brn - ES_CIF = :es_cif - CH_UID = :ch_uid - CH_VAT = :ch_vat - TW_VAT = :tw_vat - TJ_TIN = :tj_tin - TZ_VAT = :tz_vat - TH_VAT = :th_vat - TR_TIN = :tr_tin - UG_TIN = :ug_tin - UA_VAT = :ua_vat - AE_TRN = :ae_trn - US_EIN = :us_ein - UY_RUC = :uy_ruc - UZ_TIN = :uz_tin - UZ_VAT = :uz_vat - VE_RIF = :ve_rif - VN_TIN = :vn_tin - ZM_TIN = :zm_tin - ZW_TIN = :zw_tin - SR_FIN = :sr_fin - XI_VAT = :xi_vat - - # @!method self.values - # @return [Array] - end end class LineItem < WhopSDK::Internal::Type::BaseModel @@ -671,7 +555,7 @@ class LineItem < WhopSDK::Internal::Type::BaseModel # @!method initialize(label:, unit_price:, quantity: nil) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem} + # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem} # for more details. # # A single line item to include on the invoice, with a label, quantity, and unit @@ -685,7 +569,7 @@ class LineItem < WhopSDK::Internal::Type::BaseModel end end - class CreateInvoiceInputWithProductAndEmailAddress < WhopSDK::Internal::Type::BaseModel + class CreateInvoiceInputWithProductID < WhopSDK::Internal::Type::BaseModel # @!attribute collection_method # How the invoice should be collected. Use charge_automatically to charge a stored # payment method, or send_invoice to email the customer. @@ -699,34 +583,18 @@ class CreateInvoiceInputWithProductAndEmailAddress < WhopSDK::Internal::Type::Ba # @return [String] required :company_id, String - # @!attribute due_date - # The date by which the invoice must be paid. - # - # @return [Time] - required :due_date, Time - - # @!attribute email_address - # The email address of the customer. Required when creating an invoice for a - # customer who is not yet a member of the company. - # - # @return [String] - required :email_address, String - # @!attribute plan # The plan attributes defining the price, currency, and billing interval for this # invoice. # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan] - required :plan, - -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan } + # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan] + required :plan, -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan } - # @!attribute product - # The properties of the product to create for this invoice. Provide this to create - # a new product inline. + # @!attribute product_id + # The unique identifier of an existing product to create this invoice for. # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product] - required :product, - -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product } + # @return [String] + required :product_id, String # @!attribute automatically_finalizes_at # The date and time when the invoice will be automatically finalized and charged. @@ -740,11 +608,9 @@ class CreateInvoiceInputWithProductAndEmailAddress < WhopSDK::Internal::Type::Ba # Inline billing address to create a new mailing address for this invoice. Cannot # be used together with mailing_address_id. # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress, nil] + # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress, nil] optional :billing_address, - -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress - }, + -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress }, nil?: true # @!attribute charge_buyer_fee @@ -760,14 +626,28 @@ class CreateInvoiceInputWithProductAndEmailAddress < WhopSDK::Internal::Type::Ba # @return [String, nil] optional :customer_name, String, nil?: true + # @!attribute due_date + # The date by which the invoice must be paid. Required unless save_as_draft is + # true. + # + # @return [Time, nil] + optional :due_date, Time, nil?: true + + # @!attribute email_address + # The email address of the customer. Required when creating an invoice for a + # customer who is not yet a member of the company. + # + # @return [String, nil] + optional :email_address, String, nil?: true + # @!attribute line_items # Optional line items that break down the invoice total. When provided, the sum of # (quantity \* unit_price) for all items must equal the plan price. # - # @return [Array, nil] + # @return [Array, nil] optional :line_items, -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem] + WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem] }, nil?: true @@ -778,6 +658,13 @@ class CreateInvoiceInputWithProductAndEmailAddress < WhopSDK::Internal::Type::Ba # @return [String, nil] optional :mailing_address_id, String, nil?: true + # @!attribute member_id + # The unique identifier of an existing member to create this invoice for. If not + # provided, you must supply an email_address and customer_name. + # + # @return [String, nil] + optional :member_id, String, nil?: true + # @!attribute payment_method_id # The unique identifier of the payment method to charge. Required when # collection_method is charge_automatically. @@ -792,9 +679,16 @@ class CreateInvoiceInputWithProductAndEmailAddress < WhopSDK::Internal::Type::Ba # @return [String, nil] optional :payment_token_id, String, nil?: true - # @!method initialize(collection_method:, company_id:, due_date:, email_address:, plan:, product:, automatically_finalizes_at: nil, billing_address: nil, charge_buyer_fee: nil, customer_name: nil, line_items: nil, mailing_address_id: nil, payment_method_id: nil, payment_token_id: nil) + # @!attribute save_as_draft + # When true, creates the invoice as a draft without sending or charging. Relaxes + # customer and due date requirements. + # + # @return [Boolean, nil] + optional :save_as_draft, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!method initialize(collection_method:, company_id:, plan:, product_id:, automatically_finalizes_at: nil, billing_address: nil, charge_buyer_fee: nil, customer_name: nil, due_date: nil, email_address: nil, line_items: nil, mailing_address_id: nil, member_id: nil, payment_method_id: nil, payment_token_id: nil, save_as_draft: nil) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress} + # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID} # for more details. # # Autogenerated input type of CreateInvoice @@ -803,32 +697,36 @@ class CreateInvoiceInputWithProductAndEmailAddress < WhopSDK::Internal::Type::Ba # # @param company_id [String] The unique identifier of the company to create this invoice for. # - # @param due_date [Time] The date by which the invoice must be paid. - # - # @param email_address [String] The email address of the customer. Required when creating an invoice for a custo - # - # @param plan [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan] The plan attributes defining the price, currency, and billing interval for this + # @param plan [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan] The plan attributes defining the price, currency, and billing interval for this # - # @param product [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product] The properties of the product to create for this invoice. Provide this to create + # @param product_id [String] The unique identifier of an existing product to create this invoice for. # # @param automatically_finalizes_at [Time, nil] The date and time when the invoice will be automatically finalized and charged. # - # @param billing_address [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress, nil] Inline billing address to create a new mailing address for this invoice. Cannot + # @param billing_address [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress, nil] Inline billing address to create a new mailing address for this invoice. Cannot # # @param charge_buyer_fee [Boolean, nil] Whether to charge the customer a buyer fee on this invoice. # # @param customer_name [String, nil] The name of the customer. Required when creating an invoice for a customer who i # - # @param line_items [Array, nil] Optional line items that break down the invoice total. When provided, the sum of + # @param due_date [Time, nil] The date by which the invoice must be paid. Required unless save_as_draft is tru + # + # @param email_address [String, nil] The email address of the customer. Required when creating an invoice for a custo + # + # @param line_items [Array, nil] Optional line items that break down the invoice total. When provided, the sum of # # @param mailing_address_id [String, nil] The unique identifier of an existing mailing address to attach to this invoice. # + # @param member_id [String, nil] The unique identifier of an existing member to create this invoice for. If not p + # # @param payment_method_id [String, nil] The unique identifier of the payment method to charge. Required when # collection\_ # # @param payment_token_id [String, nil] The payment token ID to use for this invoice. If using charge_automatically, you + # + # @param save_as_draft [Boolean, nil] When true, creates the invoice as a draft without sending or charging. Relaxes c - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress#plan + # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID#plan class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute billing_period # The interval in days at which the plan charges (renewal plans). @@ -839,10 +737,10 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!attribute custom_fields # An array of custom field objects. # - # @return [Array, nil] + # @return [Array, nil] optional :custom_fields, -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::CustomField] + WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField] }, nil?: true @@ -883,10 +781,10 @@ class Plan < WhopSDK::Internal::Type::BaseModel # The explicit payment method configuration for the plan. If not provided, the # platform or company's defaults will apply. # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration, nil] + # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration, nil] optional :payment_method_configuration, -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration }, nil?: true @@ -936,7 +834,7 @@ class Plan < WhopSDK::Internal::Type::BaseModel # @!method initialize(billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan} + # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan} # for more details. # # The plan attributes defining the price, currency, and billing interval for this @@ -944,7 +842,7 @@ class Plan < WhopSDK::Internal::Type::BaseModel # # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans). # - # @param custom_fields [Array, nil] An array of custom field objects. + # @param custom_fields [Array, nil] An array of custom field objects. # # @param description [String, nil] The description of the plan. # @@ -956,7 +854,7 @@ class Plan < WhopSDK::Internal::Type::BaseModel # # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls # - # @param payment_method_configuration [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the plan. If not provided, the pla + # @param payment_method_configuration [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the plan. If not provided, the pla # # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product # @@ -1023,7 +921,7 @@ class CustomField < WhopSDK::Internal::Type::BaseModel # @param field_type [Symbol, :text] The type of the custom field. end - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan#payment_method_configuration + # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan#payment_method_configuration class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel # @!attribute disabled # An array of payment method identifiers that are explicitly disabled. Only @@ -1051,7 +949,7 @@ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel # @!method initialize(disabled:, enabled:, include_platform_defaults:) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration} + # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration} # for more details. # # The explicit payment method configuration for the plan. If not provided, the @@ -1065,30 +963,7 @@ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel end end - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress#product - class Product < WhopSDK::Internal::Type::BaseModel - # @!attribute title - # The title of the product. - # - # @return [String] - required :title, String - - # @!attribute product_tax_code_id - # The ID of the product tax code to apply to this product. - # - # @return [String, nil] - optional :product_tax_code_id, String, nil?: true - - # @!method initialize(title:, product_tax_code_id: nil) - # The properties of the product to create for this invoice. Provide this to create - # a new product inline. - # - # @param title [String] The title of the product. - # - # @param product_tax_code_id [String, nil] The ID of the product tax code to apply to this product. - end - - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress#billing_address + # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID#billing_address class BillingAddress < WhopSDK::Internal::Type::BaseModel # @!attribute city # The city of the address. @@ -1141,12 +1016,8 @@ class BillingAddress < WhopSDK::Internal::Type::BaseModel # @!attribute tax_id_type # The type of tax identifier # - # @return [Symbol, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType, nil] - optional :tax_id_type, - enum: -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType - }, - nil?: true + # @return [Symbol, WhopSDK::Models::TaxIdentifierType, nil] + optional :tax_id_type, enum: -> { WhopSDK::TaxIdentifierType }, nil?: true # @!attribute tax_id_value # The value of the tax identifier. @@ -1174,1385 +1045,9 @@ class BillingAddress < WhopSDK::Internal::Type::BaseModel # # @param state [String, nil] The state of the address. # - # @param tax_id_type [Symbol, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType, nil] The type of tax identifier + # @param tax_id_type [Symbol, WhopSDK::Models::TaxIdentifierType, nil] The type of tax identifier # # @param tax_id_value [String, nil] The value of the tax identifier. - - # The type of tax identifier - # - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress#tax_id_type - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - AD_NRT = :ad_nrt - AO_TIN = :ao_tin - AR_CUIT = :ar_cuit - AM_TIN = :am_tin - AW_TIN = :aw_tin - AU_ABN = :au_abn - AU_ARN = :au_arn - EU_VAT = :eu_vat - AZ_TIN = :az_tin - BS_TIN = :bs_tin - BH_VAT = :bh_vat - BD_BIN = :bd_bin - BB_TIN = :bb_tin - BY_TIN = :by_tin - BJ_IFU = :bj_ifu - BO_TIN = :bo_tin - BA_TIN = :ba_tin - BR_CNPJ = :br_cnpj - BR_CPF = :br_cpf - BG_UIC = :bg_uic - BF_IFU = :bf_ifu - KH_TIN = :kh_tin - CM_NIU = :cm_niu - CA_BN = :ca_bn - CA_GST_HST = :ca_gst_hst - CA_PST_BC = :ca_pst_bc - CA_PST_MB = :ca_pst_mb - CA_PST_SK = :ca_pst_sk - CA_QST = :ca_qst - CV_NIF = :cv_nif - CL_TIN = :cl_tin - CN_TIN = :cn_tin - CO_NIT = :co_nit - CD_NIF = :cd_nif - CR_TIN = :cr_tin - HR_OIB = :hr_oib - DO_RCN = :do_rcn - EC_RUC = :ec_ruc - EG_TIN = :eg_tin - SV_NIT = :sv_nit - ET_TIN = :et_tin - EU_OSS_VAT = :eu_oss_vat - GE_VAT = :ge_vat - DE_STN = :de_stn - GB_VAT = :gb_vat - GN_NIF = :gn_nif - HK_BR = :hk_br - HU_TIN = :hu_tin - IS_VAT = :is_vat - IN_GST = :in_gst - ID_NPWP = :id_npwp - IL_VAT = :il_vat - JP_CN = :jp_cn - JP_RN = :jp_rn - JP_TRN = :jp_trn - KZ_BIN = :kz_bin - KE_PIN = :ke_pin - KG_TIN = :kg_tin - LA_TIN = :la_tin - LI_UID = :li_uid - LI_VAT = :li_vat - MY_FRP = :my_frp - MY_ITN = :my_itn - MY_SST = :my_sst - MR_NIF = :mr_nif - MX_RFC = :mx_rfc - MD_VAT = :md_vat - ME_PIB = :me_pib - MA_VAT = :ma_vat - NP_PAN = :np_pan - NZ_GST = :nz_gst - NG_TIN = :ng_tin - MK_VAT = :mk_vat - NO_VAT = :no_vat - NO_VOEC = :no_voec - OM_VAT = :om_vat - PE_RUC = :pe_ruc - PH_TIN = :ph_tin - PL_NIP = :pl_nip - RO_TIN = :ro_tin - RU_INN = :ru_inn - RU_KPP = :ru_kpp - SA_VAT = :sa_vat - SN_NINEA = :sn_ninea - RS_PIB = :rs_pib - SG_GST = :sg_gst - SG_UEN = :sg_uen - SI_TIN = :si_tin - ZA_VAT = :za_vat - KR_BRN = :kr_brn - ES_CIF = :es_cif - CH_UID = :ch_uid - CH_VAT = :ch_vat - TW_VAT = :tw_vat - TJ_TIN = :tj_tin - TZ_VAT = :tz_vat - TH_VAT = :th_vat - TR_TIN = :tr_tin - UG_TIN = :ug_tin - UA_VAT = :ua_vat - AE_TRN = :ae_trn - US_EIN = :us_ein - UY_RUC = :uy_ruc - UZ_TIN = :uz_tin - UZ_VAT = :uz_vat - VE_RIF = :ve_rif - VN_TIN = :vn_tin - ZM_TIN = :zm_tin - ZW_TIN = :zw_tin - SR_FIN = :sr_fin - XI_VAT = :xi_vat - - # @!method self.values - # @return [Array] - end - end - - class LineItem < WhopSDK::Internal::Type::BaseModel - # @!attribute label - # The label or description for this line item. - # - # @return [String] - required :label, String - - # @!attribute unit_price - # The unit price for this line item. Provided as a number in the specified - # currency. Eg: 10.43 for $10.43 - # - # @return [Float] - required :unit_price, Float - - # @!attribute quantity - # The quantity of this line item. Defaults to 1. - # - # @return [Float, nil] - optional :quantity, Float, nil?: true - - # @!method initialize(label:, unit_price:, quantity: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem} - # for more details. - # - # A single line item to include on the invoice, with a label, quantity, and unit - # price. - # - # @param label [String] The label or description for this line item. - # - # @param unit_price [Float] The unit price for this line item. Provided as a number in the specified currenc - # - # @param quantity [Float, nil] The quantity of this line item. Defaults to 1. - end - end - - class CreateInvoiceInputWithProductIDAndMemberID < WhopSDK::Internal::Type::BaseModel - # @!attribute collection_method - # How the invoice should be collected. Use charge_automatically to charge a stored - # payment method, or send_invoice to email the customer. - # - # @return [Symbol, WhopSDK::Models::CollectionMethod] - required :collection_method, enum: -> { WhopSDK::CollectionMethod } - - # @!attribute company_id - # The unique identifier of the company to create this invoice for. - # - # @return [String] - required :company_id, String - - # @!attribute due_date - # The date by which the invoice must be paid. - # - # @return [Time] - required :due_date, Time - - # @!attribute member_id - # The unique identifier of an existing member to create this invoice for. If not - # provided, you must supply an email_address and customer_name. - # - # @return [String] - required :member_id, String - - # @!attribute plan - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan] - required :plan, - -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan } - - # @!attribute product_id - # The unique identifier of an existing product to create this invoice for. - # - # @return [String] - required :product_id, String - - # @!attribute automatically_finalizes_at - # The date and time when the invoice will be automatically finalized and charged. - # Only valid when collection_method is charge_automatically. If not provided, the - # charge will be processed immediately. - # - # @return [Time, nil] - optional :automatically_finalizes_at, Time, nil?: true - - # @!attribute billing_address - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress, nil] - optional :billing_address, - -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress - }, - nil?: true - - # @!attribute charge_buyer_fee - # Whether to charge the customer a buyer fee on this invoice. - # - # @return [Boolean, nil] - optional :charge_buyer_fee, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute customer_name - # The name of the customer. Required when creating an invoice for a customer who - # is not yet a member of the company. - # - # @return [String, nil] - optional :customer_name, String, nil?: true - - # @!attribute line_items - # Optional line items that break down the invoice total. When provided, the sum of - # (quantity \* unit_price) for all items must equal the plan price. - # - # @return [Array, nil] - optional :line_items, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem] - }, - nil?: true - - # @!attribute mailing_address_id - # The unique identifier of an existing mailing address to attach to this invoice. - # Cannot be used together with billing_address. - # - # @return [String, nil] - optional :mailing_address_id, String, nil?: true - - # @!attribute payment_method_id - # The unique identifier of the payment method to charge. Required when - # collection_method is charge_automatically. - # - # @return [String, nil] - optional :payment_method_id, String, nil?: true - - # @!attribute payment_token_id - # The payment token ID to use for this invoice. If using charge_automatically, you - # must provide a payment_token. - # - # @return [String, nil] - optional :payment_token_id, String, nil?: true - - # @!method initialize(collection_method:, company_id:, due_date:, member_id:, plan:, product_id:, automatically_finalizes_at: nil, billing_address: nil, charge_buyer_fee: nil, customer_name: nil, line_items: nil, mailing_address_id: nil, payment_method_id: nil, payment_token_id: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID} - # for more details. - # - # Autogenerated input type of CreateInvoice - # - # @param collection_method [Symbol, WhopSDK::Models::CollectionMethod] How the invoice should be collected. Use charge_automatically to charge a stored - # - # @param company_id [String] The unique identifier of the company to create this invoice for. - # - # @param due_date [Time] The date by which the invoice must be paid. - # - # @param member_id [String] The unique identifier of an existing member to create this invoice for. If not p - # - # @param plan [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan] The plan attributes defining the price, currency, and billing interval for this - # - # @param product_id [String] The unique identifier of an existing product to create this invoice for. - # - # @param automatically_finalizes_at [Time, nil] The date and time when the invoice will be automatically finalized and charged. - # - # @param billing_address [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress, nil] Inline billing address to create a new mailing address for this invoice. Cannot - # - # @param charge_buyer_fee [Boolean, nil] Whether to charge the customer a buyer fee on this invoice. - # - # @param customer_name [String, nil] The name of the customer. Required when creating an invoice for a customer who i - # - # @param line_items [Array, nil] Optional line items that break down the invoice total. When provided, the sum of - # - # @param mailing_address_id [String, nil] The unique identifier of an existing mailing address to attach to this invoice. - # - # @param payment_method_id [String, nil] The unique identifier of the payment method to charge. Required when - # collection\_ - # - # @param payment_token_id [String, nil] The payment token ID to use for this invoice. If using charge_automatically, you - - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID#plan - class Plan < WhopSDK::Internal::Type::BaseModel - # @!attribute billing_period - # The interval in days at which the plan charges (renewal plans). - # - # @return [Integer, nil] - optional :billing_period, Integer, nil?: true - - # @!attribute custom_fields - # An array of custom field objects. - # - # @return [Array, nil] - optional :custom_fields, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::CustomField] - }, - nil?: true - - # @!attribute description - # The description of the plan. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute expiration_days - # The number of days until the membership expires and revokes access (expiration - # plans). For example, 365 for a one-year access period. - # - # @return [Integer, nil] - optional :expiration_days, Integer, nil?: true - - # @!attribute initial_price - # An additional amount charged upon first purchase. Use only if a one time payment - # OR you want to charge an additional amount on top of the renewal price. Provided - # as a number in the specified currency. Eg: 10.43 for $10.43 - # - # @return [Float, nil] - optional :initial_price, Float, nil?: true - - # @!attribute internal_notes - # A personal description or notes section for the business. - # - # @return [String, nil] - optional :internal_notes, String, nil?: true - - # @!attribute legacy_payment_method_controls - # Whether this plan uses legacy payment method controls - # - # @return [Boolean, nil] - optional :legacy_payment_method_controls, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute payment_method_configuration - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration, nil] - optional :payment_method_configuration, - -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration - }, - nil?: true - - # @!attribute plan_type - # The type of plan that can be attached to a product - # - # @return [Symbol, WhopSDK::Models::PlanType, nil] - optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true - - # @!attribute release_method - # The methods of how a plan can be released. - # - # @return [Symbol, WhopSDK::Models::ReleaseMethod, nil] - optional :release_method, enum: -> { WhopSDK::ReleaseMethod }, nil?: true - - # @!attribute renewal_price - # The amount the customer is charged every billing period. Use only if a recurring - # payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43 - # - # @return [Float, nil] - optional :renewal_price, Float, nil?: true - - # @!attribute stock - # The number of units available for purchase. - # - # @return [Integer, nil] - optional :stock, Integer, nil?: true - - # @!attribute trial_period_days - # The number of free trial days added before a renewal plan. - # - # @return [Integer, nil] - optional :trial_period_days, Integer, nil?: true - - # @!attribute unlimited_stock - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. - # - # @return [Boolean, nil] - optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute visibility - # Visibility of a resource - # - # @return [Symbol, WhopSDK::Models::Visibility, nil] - optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - - # @!method initialize(billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan} - # for more details. - # - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - # - # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans). - # - # @param custom_fields [Array, nil] An array of custom field objects. - # - # @param description [String, nil] The description of the plan. - # - # @param expiration_days [Integer, nil] The number of days until the membership expires and revokes access (expiration p - # - # @param initial_price [Float, nil] An additional amount charged upon first purchase. Use only if a one time payment - # - # @param internal_notes [String, nil] A personal description or notes section for the business. - # - # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls - # - # @param payment_method_configuration [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the plan. If not provided, the pla - # - # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product - # - # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod, nil] The methods of how a plan can be released. - # - # @param renewal_price [Float, nil] The amount the customer is charged every billing period. Use only if a recurring - # - # @param stock [Integer, nil] The number of units available for purchase. - # - # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan. - # - # @param unlimited_stock [Boolean, nil] When true, the plan has unlimited stock (stock field is ignored). When false, pu - # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource - - class CustomField < WhopSDK::Internal::Type::BaseModel - # @!attribute field_type - # The type of the custom field. - # - # @return [Symbol, :text] - required :field_type, const: :text - - # @!attribute name - # The name of the custom field. - # - # @return [String] - required :name, String - - # @!attribute id - # The ID of the custom field (if being updated) - # - # @return [String, nil] - optional :id, String, nil?: true - - # @!attribute order - # The order of the field. - # - # @return [Integer, nil] - optional :order, Integer, nil?: true - - # @!attribute placeholder - # The placeholder value of the field. - # - # @return [String, nil] - optional :placeholder, String, nil?: true - - # @!attribute required - # Whether or not the field is required. - # - # @return [Boolean, nil] - optional :required, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!method initialize(name:, id: nil, order: nil, placeholder: nil, required: nil, field_type: :text) - # @param name [String] The name of the custom field. - # - # @param id [String, nil] The ID of the custom field (if being updated) - # - # @param order [Integer, nil] The order of the field. - # - # @param placeholder [String, nil] The placeholder value of the field. - # - # @param required [Boolean, nil] Whether or not the field is required. - # - # @param field_type [Symbol, :text] The type of the custom field. - end - - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan#payment_method_configuration - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - # @!attribute disabled - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - # - # @return [Array] - required :disabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } - - # @!attribute enabled - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - # - # @return [Array] - required :enabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } - - # @!attribute include_platform_defaults - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - # - # @return [Boolean] - required :include_platform_defaults, WhopSDK::Internal::Type::Boolean - - # @!method initialize(disabled:, enabled:, include_platform_defaults:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration} - # for more details. - # - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - # - # @param disabled [Array] An array of payment method identifiers that are explicitly disabled. Only applie - # - # @param enabled [Array] An array of payment method identifiers that are explicitly enabled. This means t - # - # @param include_platform_defaults [Boolean] Whether Whop's platform default payment method enablement settings are included - end - end - - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID#billing_address - class BillingAddress < WhopSDK::Internal::Type::BaseModel - # @!attribute city - # The city of the address. - # - # @return [String, nil] - optional :city, String, nil?: true - - # @!attribute country - # The country of the address. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute line1 - # The line 1 of the address. - # - # @return [String, nil] - optional :line1, String, nil?: true - - # @!attribute line2 - # The line 2 of the address. - # - # @return [String, nil] - optional :line2, String, nil?: true - - # @!attribute name - # The name of the customer. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute phone - # The phone number of the customer. - # - # @return [String, nil] - optional :phone, String, nil?: true - - # @!attribute postal_code - # The postal code of the address. - # - # @return [String, nil] - optional :postal_code, String, nil?: true - - # @!attribute state - # The state of the address. - # - # @return [String, nil] - optional :state, String, nil?: true - - # @!attribute tax_id_type - # The type of tax identifier - # - # @return [Symbol, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType, nil] - optional :tax_id_type, - enum: -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType - }, - nil?: true - - # @!attribute tax_id_value - # The value of the tax identifier. - # - # @return [String, nil] - optional :tax_id_value, String, nil?: true - - # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, name: nil, phone: nil, postal_code: nil, state: nil, tax_id_type: nil, tax_id_value: nil) - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - # - # @param city [String, nil] The city of the address. - # - # @param country [String, nil] The country of the address. - # - # @param line1 [String, nil] The line 1 of the address. - # - # @param line2 [String, nil] The line 2 of the address. - # - # @param name [String, nil] The name of the customer. - # - # @param phone [String, nil] The phone number of the customer. - # - # @param postal_code [String, nil] The postal code of the address. - # - # @param state [String, nil] The state of the address. - # - # @param tax_id_type [Symbol, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType, nil] The type of tax identifier - # - # @param tax_id_value [String, nil] The value of the tax identifier. - - # The type of tax identifier - # - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress#tax_id_type - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - AD_NRT = :ad_nrt - AO_TIN = :ao_tin - AR_CUIT = :ar_cuit - AM_TIN = :am_tin - AW_TIN = :aw_tin - AU_ABN = :au_abn - AU_ARN = :au_arn - EU_VAT = :eu_vat - AZ_TIN = :az_tin - BS_TIN = :bs_tin - BH_VAT = :bh_vat - BD_BIN = :bd_bin - BB_TIN = :bb_tin - BY_TIN = :by_tin - BJ_IFU = :bj_ifu - BO_TIN = :bo_tin - BA_TIN = :ba_tin - BR_CNPJ = :br_cnpj - BR_CPF = :br_cpf - BG_UIC = :bg_uic - BF_IFU = :bf_ifu - KH_TIN = :kh_tin - CM_NIU = :cm_niu - CA_BN = :ca_bn - CA_GST_HST = :ca_gst_hst - CA_PST_BC = :ca_pst_bc - CA_PST_MB = :ca_pst_mb - CA_PST_SK = :ca_pst_sk - CA_QST = :ca_qst - CV_NIF = :cv_nif - CL_TIN = :cl_tin - CN_TIN = :cn_tin - CO_NIT = :co_nit - CD_NIF = :cd_nif - CR_TIN = :cr_tin - HR_OIB = :hr_oib - DO_RCN = :do_rcn - EC_RUC = :ec_ruc - EG_TIN = :eg_tin - SV_NIT = :sv_nit - ET_TIN = :et_tin - EU_OSS_VAT = :eu_oss_vat - GE_VAT = :ge_vat - DE_STN = :de_stn - GB_VAT = :gb_vat - GN_NIF = :gn_nif - HK_BR = :hk_br - HU_TIN = :hu_tin - IS_VAT = :is_vat - IN_GST = :in_gst - ID_NPWP = :id_npwp - IL_VAT = :il_vat - JP_CN = :jp_cn - JP_RN = :jp_rn - JP_TRN = :jp_trn - KZ_BIN = :kz_bin - KE_PIN = :ke_pin - KG_TIN = :kg_tin - LA_TIN = :la_tin - LI_UID = :li_uid - LI_VAT = :li_vat - MY_FRP = :my_frp - MY_ITN = :my_itn - MY_SST = :my_sst - MR_NIF = :mr_nif - MX_RFC = :mx_rfc - MD_VAT = :md_vat - ME_PIB = :me_pib - MA_VAT = :ma_vat - NP_PAN = :np_pan - NZ_GST = :nz_gst - NG_TIN = :ng_tin - MK_VAT = :mk_vat - NO_VAT = :no_vat - NO_VOEC = :no_voec - OM_VAT = :om_vat - PE_RUC = :pe_ruc - PH_TIN = :ph_tin - PL_NIP = :pl_nip - RO_TIN = :ro_tin - RU_INN = :ru_inn - RU_KPP = :ru_kpp - SA_VAT = :sa_vat - SN_NINEA = :sn_ninea - RS_PIB = :rs_pib - SG_GST = :sg_gst - SG_UEN = :sg_uen - SI_TIN = :si_tin - ZA_VAT = :za_vat - KR_BRN = :kr_brn - ES_CIF = :es_cif - CH_UID = :ch_uid - CH_VAT = :ch_vat - TW_VAT = :tw_vat - TJ_TIN = :tj_tin - TZ_VAT = :tz_vat - TH_VAT = :th_vat - TR_TIN = :tr_tin - UG_TIN = :ug_tin - UA_VAT = :ua_vat - AE_TRN = :ae_trn - US_EIN = :us_ein - UY_RUC = :uy_ruc - UZ_TIN = :uz_tin - UZ_VAT = :uz_vat - VE_RIF = :ve_rif - VN_TIN = :vn_tin - ZM_TIN = :zm_tin - ZW_TIN = :zw_tin - SR_FIN = :sr_fin - XI_VAT = :xi_vat - - # @!method self.values - # @return [Array] - end - end - - class LineItem < WhopSDK::Internal::Type::BaseModel - # @!attribute label - # The label or description for this line item. - # - # @return [String] - required :label, String - - # @!attribute unit_price - # The unit price for this line item. Provided as a number in the specified - # currency. Eg: 10.43 for $10.43 - # - # @return [Float] - required :unit_price, Float - - # @!attribute quantity - # The quantity of this line item. Defaults to 1. - # - # @return [Float, nil] - optional :quantity, Float, nil?: true - - # @!method initialize(label:, unit_price:, quantity: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem} - # for more details. - # - # A single line item to include on the invoice, with a label, quantity, and unit - # price. - # - # @param label [String] The label or description for this line item. - # - # @param unit_price [Float] The unit price for this line item. Provided as a number in the specified currenc - # - # @param quantity [Float, nil] The quantity of this line item. Defaults to 1. - end - end - - class CreateInvoiceInputWithProductIDAndEmailAddress < WhopSDK::Internal::Type::BaseModel - # @!attribute collection_method - # How the invoice should be collected. Use charge_automatically to charge a stored - # payment method, or send_invoice to email the customer. - # - # @return [Symbol, WhopSDK::Models::CollectionMethod] - required :collection_method, enum: -> { WhopSDK::CollectionMethod } - - # @!attribute company_id - # The unique identifier of the company to create this invoice for. - # - # @return [String] - required :company_id, String - - # @!attribute due_date - # The date by which the invoice must be paid. - # - # @return [Time] - required :due_date, Time - - # @!attribute email_address - # The email address of the customer. Required when creating an invoice for a - # customer who is not yet a member of the company. - # - # @return [String] - required :email_address, String - - # @!attribute plan - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan] - required :plan, - -> { WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan } - - # @!attribute product_id - # The unique identifier of an existing product to create this invoice for. - # - # @return [String] - required :product_id, String - - # @!attribute automatically_finalizes_at - # The date and time when the invoice will be automatically finalized and charged. - # Only valid when collection_method is charge_automatically. If not provided, the - # charge will be processed immediately. - # - # @return [Time, nil] - optional :automatically_finalizes_at, Time, nil?: true - - # @!attribute billing_address - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress, nil] - optional :billing_address, - -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress - }, - nil?: true - - # @!attribute charge_buyer_fee - # Whether to charge the customer a buyer fee on this invoice. - # - # @return [Boolean, nil] - optional :charge_buyer_fee, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute customer_name - # The name of the customer. Required when creating an invoice for a customer who - # is not yet a member of the company. - # - # @return [String, nil] - optional :customer_name, String, nil?: true - - # @!attribute line_items - # Optional line items that break down the invoice total. When provided, the sum of - # (quantity \* unit_price) for all items must equal the plan price. - # - # @return [Array, nil] - optional :line_items, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem] - }, - nil?: true - - # @!attribute mailing_address_id - # The unique identifier of an existing mailing address to attach to this invoice. - # Cannot be used together with billing_address. - # - # @return [String, nil] - optional :mailing_address_id, String, nil?: true - - # @!attribute payment_method_id - # The unique identifier of the payment method to charge. Required when - # collection_method is charge_automatically. - # - # @return [String, nil] - optional :payment_method_id, String, nil?: true - - # @!attribute payment_token_id - # The payment token ID to use for this invoice. If using charge_automatically, you - # must provide a payment_token. - # - # @return [String, nil] - optional :payment_token_id, String, nil?: true - - # @!method initialize(collection_method:, company_id:, due_date:, email_address:, plan:, product_id:, automatically_finalizes_at: nil, billing_address: nil, charge_buyer_fee: nil, customer_name: nil, line_items: nil, mailing_address_id: nil, payment_method_id: nil, payment_token_id: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress} - # for more details. - # - # Autogenerated input type of CreateInvoice - # - # @param collection_method [Symbol, WhopSDK::Models::CollectionMethod] How the invoice should be collected. Use charge_automatically to charge a stored - # - # @param company_id [String] The unique identifier of the company to create this invoice for. - # - # @param due_date [Time] The date by which the invoice must be paid. - # - # @param email_address [String] The email address of the customer. Required when creating an invoice for a custo - # - # @param plan [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan] The plan attributes defining the price, currency, and billing interval for this - # - # @param product_id [String] The unique identifier of an existing product to create this invoice for. - # - # @param automatically_finalizes_at [Time, nil] The date and time when the invoice will be automatically finalized and charged. - # - # @param billing_address [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress, nil] Inline billing address to create a new mailing address for this invoice. Cannot - # - # @param charge_buyer_fee [Boolean, nil] Whether to charge the customer a buyer fee on this invoice. - # - # @param customer_name [String, nil] The name of the customer. Required when creating an invoice for a customer who i - # - # @param line_items [Array, nil] Optional line items that break down the invoice total. When provided, the sum of - # - # @param mailing_address_id [String, nil] The unique identifier of an existing mailing address to attach to this invoice. - # - # @param payment_method_id [String, nil] The unique identifier of the payment method to charge. Required when - # collection\_ - # - # @param payment_token_id [String, nil] The payment token ID to use for this invoice. If using charge_automatically, you - - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress#plan - class Plan < WhopSDK::Internal::Type::BaseModel - # @!attribute billing_period - # The interval in days at which the plan charges (renewal plans). - # - # @return [Integer, nil] - optional :billing_period, Integer, nil?: true - - # @!attribute custom_fields - # An array of custom field objects. - # - # @return [Array, nil] - optional :custom_fields, - -> { - WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::CustomField] - }, - nil?: true - - # @!attribute description - # The description of the plan. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute expiration_days - # The number of days until the membership expires and revokes access (expiration - # plans). For example, 365 for a one-year access period. - # - # @return [Integer, nil] - optional :expiration_days, Integer, nil?: true - - # @!attribute initial_price - # An additional amount charged upon first purchase. Use only if a one time payment - # OR you want to charge an additional amount on top of the renewal price. Provided - # as a number in the specified currency. Eg: 10.43 for $10.43 - # - # @return [Float, nil] - optional :initial_price, Float, nil?: true - - # @!attribute internal_notes - # A personal description or notes section for the business. - # - # @return [String, nil] - optional :internal_notes, String, nil?: true - - # @!attribute legacy_payment_method_controls - # Whether this plan uses legacy payment method controls - # - # @return [Boolean, nil] - optional :legacy_payment_method_controls, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute payment_method_configuration - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - # - # @return [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration, nil] - optional :payment_method_configuration, - -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration - }, - nil?: true - - # @!attribute plan_type - # The type of plan that can be attached to a product - # - # @return [Symbol, WhopSDK::Models::PlanType, nil] - optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true - - # @!attribute release_method - # The methods of how a plan can be released. - # - # @return [Symbol, WhopSDK::Models::ReleaseMethod, nil] - optional :release_method, enum: -> { WhopSDK::ReleaseMethod }, nil?: true - - # @!attribute renewal_price - # The amount the customer is charged every billing period. Use only if a recurring - # payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43 - # - # @return [Float, nil] - optional :renewal_price, Float, nil?: true - - # @!attribute stock - # The number of units available for purchase. - # - # @return [Integer, nil] - optional :stock, Integer, nil?: true - - # @!attribute trial_period_days - # The number of free trial days added before a renewal plan. - # - # @return [Integer, nil] - optional :trial_period_days, Integer, nil?: true - - # @!attribute unlimited_stock - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. - # - # @return [Boolean, nil] - optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!attribute visibility - # Visibility of a resource - # - # @return [Symbol, WhopSDK::Models::Visibility, nil] - optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - - # @!method initialize(billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan} - # for more details. - # - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - # - # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans). - # - # @param custom_fields [Array, nil] An array of custom field objects. - # - # @param description [String, nil] The description of the plan. - # - # @param expiration_days [Integer, nil] The number of days until the membership expires and revokes access (expiration p - # - # @param initial_price [Float, nil] An additional amount charged upon first purchase. Use only if a one time payment - # - # @param internal_notes [String, nil] A personal description or notes section for the business. - # - # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls - # - # @param payment_method_configuration [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the plan. If not provided, the pla - # - # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product - # - # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod, nil] The methods of how a plan can be released. - # - # @param renewal_price [Float, nil] The amount the customer is charged every billing period. Use only if a recurring - # - # @param stock [Integer, nil] The number of units available for purchase. - # - # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan. - # - # @param unlimited_stock [Boolean, nil] When true, the plan has unlimited stock (stock field is ignored). When false, pu - # - # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource - - class CustomField < WhopSDK::Internal::Type::BaseModel - # @!attribute field_type - # The type of the custom field. - # - # @return [Symbol, :text] - required :field_type, const: :text - - # @!attribute name - # The name of the custom field. - # - # @return [String] - required :name, String - - # @!attribute id - # The ID of the custom field (if being updated) - # - # @return [String, nil] - optional :id, String, nil?: true - - # @!attribute order - # The order of the field. - # - # @return [Integer, nil] - optional :order, Integer, nil?: true - - # @!attribute placeholder - # The placeholder value of the field. - # - # @return [String, nil] - optional :placeholder, String, nil?: true - - # @!attribute required - # Whether or not the field is required. - # - # @return [Boolean, nil] - optional :required, WhopSDK::Internal::Type::Boolean, nil?: true - - # @!method initialize(name:, id: nil, order: nil, placeholder: nil, required: nil, field_type: :text) - # @param name [String] The name of the custom field. - # - # @param id [String, nil] The ID of the custom field (if being updated) - # - # @param order [Integer, nil] The order of the field. - # - # @param placeholder [String, nil] The placeholder value of the field. - # - # @param required [Boolean, nil] Whether or not the field is required. - # - # @param field_type [Symbol, :text] The type of the custom field. - end - - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan#payment_method_configuration - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - # @!attribute disabled - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - # - # @return [Array] - required :disabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } - - # @!attribute enabled - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - # - # @return [Array] - required :enabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } - - # @!attribute include_platform_defaults - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - # - # @return [Boolean] - required :include_platform_defaults, WhopSDK::Internal::Type::Boolean - - # @!method initialize(disabled:, enabled:, include_platform_defaults:) - # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration} - # for more details. - # - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - # - # @param disabled [Array] An array of payment method identifiers that are explicitly disabled. Only applie - # - # @param enabled [Array] An array of payment method identifiers that are explicitly enabled. This means t - # - # @param include_platform_defaults [Boolean] Whether Whop's platform default payment method enablement settings are included - end - end - - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress#billing_address - class BillingAddress < WhopSDK::Internal::Type::BaseModel - # @!attribute city - # The city of the address. - # - # @return [String, nil] - optional :city, String, nil?: true - - # @!attribute country - # The country of the address. - # - # @return [String, nil] - optional :country, String, nil?: true - - # @!attribute line1 - # The line 1 of the address. - # - # @return [String, nil] - optional :line1, String, nil?: true - - # @!attribute line2 - # The line 2 of the address. - # - # @return [String, nil] - optional :line2, String, nil?: true - - # @!attribute name - # The name of the customer. - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute phone - # The phone number of the customer. - # - # @return [String, nil] - optional :phone, String, nil?: true - - # @!attribute postal_code - # The postal code of the address. - # - # @return [String, nil] - optional :postal_code, String, nil?: true - - # @!attribute state - # The state of the address. - # - # @return [String, nil] - optional :state, String, nil?: true - - # @!attribute tax_id_type - # The type of tax identifier - # - # @return [Symbol, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType, nil] - optional :tax_id_type, - enum: -> { - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType - }, - nil?: true - - # @!attribute tax_id_value - # The value of the tax identifier. - # - # @return [String, nil] - optional :tax_id_value, String, nil?: true - - # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, name: nil, phone: nil, postal_code: nil, state: nil, tax_id_type: nil, tax_id_value: nil) - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - # - # @param city [String, nil] The city of the address. - # - # @param country [String, nil] The country of the address. - # - # @param line1 [String, nil] The line 1 of the address. - # - # @param line2 [String, nil] The line 2 of the address. - # - # @param name [String, nil] The name of the customer. - # - # @param phone [String, nil] The phone number of the customer. - # - # @param postal_code [String, nil] The postal code of the address. - # - # @param state [String, nil] The state of the address. - # - # @param tax_id_type [Symbol, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType, nil] The type of tax identifier - # - # @param tax_id_value [String, nil] The value of the tax identifier. - - # The type of tax identifier - # - # @see WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress#tax_id_type - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - AD_NRT = :ad_nrt - AO_TIN = :ao_tin - AR_CUIT = :ar_cuit - AM_TIN = :am_tin - AW_TIN = :aw_tin - AU_ABN = :au_abn - AU_ARN = :au_arn - EU_VAT = :eu_vat - AZ_TIN = :az_tin - BS_TIN = :bs_tin - BH_VAT = :bh_vat - BD_BIN = :bd_bin - BB_TIN = :bb_tin - BY_TIN = :by_tin - BJ_IFU = :bj_ifu - BO_TIN = :bo_tin - BA_TIN = :ba_tin - BR_CNPJ = :br_cnpj - BR_CPF = :br_cpf - BG_UIC = :bg_uic - BF_IFU = :bf_ifu - KH_TIN = :kh_tin - CM_NIU = :cm_niu - CA_BN = :ca_bn - CA_GST_HST = :ca_gst_hst - CA_PST_BC = :ca_pst_bc - CA_PST_MB = :ca_pst_mb - CA_PST_SK = :ca_pst_sk - CA_QST = :ca_qst - CV_NIF = :cv_nif - CL_TIN = :cl_tin - CN_TIN = :cn_tin - CO_NIT = :co_nit - CD_NIF = :cd_nif - CR_TIN = :cr_tin - HR_OIB = :hr_oib - DO_RCN = :do_rcn - EC_RUC = :ec_ruc - EG_TIN = :eg_tin - SV_NIT = :sv_nit - ET_TIN = :et_tin - EU_OSS_VAT = :eu_oss_vat - GE_VAT = :ge_vat - DE_STN = :de_stn - GB_VAT = :gb_vat - GN_NIF = :gn_nif - HK_BR = :hk_br - HU_TIN = :hu_tin - IS_VAT = :is_vat - IN_GST = :in_gst - ID_NPWP = :id_npwp - IL_VAT = :il_vat - JP_CN = :jp_cn - JP_RN = :jp_rn - JP_TRN = :jp_trn - KZ_BIN = :kz_bin - KE_PIN = :ke_pin - KG_TIN = :kg_tin - LA_TIN = :la_tin - LI_UID = :li_uid - LI_VAT = :li_vat - MY_FRP = :my_frp - MY_ITN = :my_itn - MY_SST = :my_sst - MR_NIF = :mr_nif - MX_RFC = :mx_rfc - MD_VAT = :md_vat - ME_PIB = :me_pib - MA_VAT = :ma_vat - NP_PAN = :np_pan - NZ_GST = :nz_gst - NG_TIN = :ng_tin - MK_VAT = :mk_vat - NO_VAT = :no_vat - NO_VOEC = :no_voec - OM_VAT = :om_vat - PE_RUC = :pe_ruc - PH_TIN = :ph_tin - PL_NIP = :pl_nip - RO_TIN = :ro_tin - RU_INN = :ru_inn - RU_KPP = :ru_kpp - SA_VAT = :sa_vat - SN_NINEA = :sn_ninea - RS_PIB = :rs_pib - SG_GST = :sg_gst - SG_UEN = :sg_uen - SI_TIN = :si_tin - ZA_VAT = :za_vat - KR_BRN = :kr_brn - ES_CIF = :es_cif - CH_UID = :ch_uid - CH_VAT = :ch_vat - TW_VAT = :tw_vat - TJ_TIN = :tj_tin - TZ_VAT = :tz_vat - TH_VAT = :th_vat - TR_TIN = :tr_tin - UG_TIN = :ug_tin - UA_VAT = :ua_vat - AE_TRN = :ae_trn - US_EIN = :us_ein - UY_RUC = :uy_ruc - UZ_TIN = :uz_tin - UZ_VAT = :uz_vat - VE_RIF = :ve_rif - VN_TIN = :vn_tin - ZM_TIN = :zm_tin - ZW_TIN = :zw_tin - SR_FIN = :sr_fin - XI_VAT = :xi_vat - - # @!method self.values - # @return [Array] - end end class LineItem < WhopSDK::Internal::Type::BaseModel @@ -2577,7 +1072,7 @@ class LineItem < WhopSDK::Internal::Type::BaseModel # @!method initialize(label:, unit_price:, quantity: nil) # Some parameter documentations has been truncated, see - # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem} + # {WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem} # for more details. # # A single line item to include on the invoice, with a label, quantity, and unit @@ -2592,7 +1087,7 @@ class LineItem < WhopSDK::Internal::Type::BaseModel end # @!method self.variants - # @return [Array(WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress)] + # @return [Array(WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID)] end end end diff --git a/lib/whop_sdk/models/invoice_delete_params.rb b/lib/whop_sdk/models/invoice_delete_params.rb new file mode 100644 index 00000000..40cfa3d5 --- /dev/null +++ b/lib/whop_sdk/models/invoice_delete_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Invoices#delete + class InvoiceDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/invoice_delete_response.rb b/lib/whop_sdk/models/invoice_delete_response.rb new file mode 100644 index 00000000..1811c1be --- /dev/null +++ b/lib/whop_sdk/models/invoice_delete_response.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @type [WhopSDK::Internal::Type::Converter] + InvoiceDeleteResponse = WhopSDK::Internal::Type::Boolean + end +end diff --git a/lib/whop_sdk/models/invoice_mark_paid_params.rb b/lib/whop_sdk/models/invoice_mark_paid_params.rb new file mode 100644 index 00000000..e63d0de0 --- /dev/null +++ b/lib/whop_sdk/models/invoice_mark_paid_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Invoices#mark_paid + class InvoiceMarkPaidParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/invoice_mark_paid_response.rb b/lib/whop_sdk/models/invoice_mark_paid_response.rb new file mode 100644 index 00000000..b767d393 --- /dev/null +++ b/lib/whop_sdk/models/invoice_mark_paid_response.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @type [WhopSDK::Internal::Type::Converter] + InvoiceMarkPaidResponse = WhopSDK::Internal::Type::Boolean + end +end diff --git a/lib/whop_sdk/models/invoice_mark_uncollectible_params.rb b/lib/whop_sdk/models/invoice_mark_uncollectible_params.rb new file mode 100644 index 00000000..fe347971 --- /dev/null +++ b/lib/whop_sdk/models/invoice_mark_uncollectible_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Invoices#mark_uncollectible + class InvoiceMarkUncollectibleParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:, request_options: {}) + # @param id [String] + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/invoice_mark_uncollectible_response.rb b/lib/whop_sdk/models/invoice_mark_uncollectible_response.rb new file mode 100644 index 00000000..9e5879ed --- /dev/null +++ b/lib/whop_sdk/models/invoice_mark_uncollectible_response.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @type [WhopSDK::Internal::Type::Converter] + InvoiceMarkUncollectibleResponse = WhopSDK::Internal::Type::Boolean + end +end diff --git a/lib/whop_sdk/models/invoice_update_params.rb b/lib/whop_sdk/models/invoice_update_params.rb new file mode 100644 index 00000000..30f0c7e9 --- /dev/null +++ b/lib/whop_sdk/models/invoice_update_params.rb @@ -0,0 +1,468 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Invoices#update + class InvoiceUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute automatically_finalizes_at + # The date and time when the invoice will be automatically finalized and charged. + # + # @return [Time, nil] + optional :automatically_finalizes_at, Time, nil?: true + + # @!attribute billing_address + # Inline billing address to create or update a mailing address for this invoice. + # + # @return [WhopSDK::Models::InvoiceUpdateParams::BillingAddress, nil] + optional :billing_address, -> { WhopSDK::InvoiceUpdateParams::BillingAddress }, nil?: true + + # @!attribute charge_buyer_fee + # Whether to charge the customer a buyer fee on this invoice. + # + # @return [Boolean, nil] + optional :charge_buyer_fee, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!attribute collection_method + # The method of collection for an invoice. + # + # @return [Symbol, WhopSDK::Models::CollectionMethod, nil] + optional :collection_method, enum: -> { WhopSDK::CollectionMethod }, nil?: true + + # @!attribute customer_name + # The name of the customer. + # + # @return [String, nil] + optional :customer_name, String, nil?: true + + # @!attribute due_date + # The date by which the invoice must be paid. + # + # @return [Time, nil] + optional :due_date, Time, nil?: true + + # @!attribute email_address + # The email address of the customer. + # + # @return [String, nil] + optional :email_address, String, nil?: true + + # @!attribute line_items + # Line items that break down the invoice total. + # + # @return [Array, nil] + optional :line_items, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceUpdateParams::LineItem] }, + nil?: true + + # @!attribute mailing_address_id + # The unique identifier of an existing mailing address to attach. + # + # @return [String, nil] + optional :mailing_address_id, String, nil?: true + + # @!attribute member_id + # The unique identifier of a member to assign as the customer. + # + # @return [String, nil] + optional :member_id, String, nil?: true + + # @!attribute payment_method_id + # The unique identifier of the payment method to charge. + # + # @return [String, nil] + optional :payment_method_id, String, nil?: true + + # @!attribute plan + # Updated plan attributes. + # + # @return [WhopSDK::Models::InvoiceUpdateParams::Plan, nil] + optional :plan, -> { WhopSDK::InvoiceUpdateParams::Plan }, nil?: true + + # @!method initialize(id:, automatically_finalizes_at: nil, billing_address: nil, charge_buyer_fee: nil, collection_method: nil, customer_name: nil, due_date: nil, email_address: nil, line_items: nil, mailing_address_id: nil, member_id: nil, payment_method_id: nil, plan: nil, request_options: {}) + # @param id [String] + # + # @param automatically_finalizes_at [Time, nil] The date and time when the invoice will be automatically finalized and charged. + # + # @param billing_address [WhopSDK::Models::InvoiceUpdateParams::BillingAddress, nil] Inline billing address to create or update a mailing address for this invoice. + # + # @param charge_buyer_fee [Boolean, nil] Whether to charge the customer a buyer fee on this invoice. + # + # @param collection_method [Symbol, WhopSDK::Models::CollectionMethod, nil] The method of collection for an invoice. + # + # @param customer_name [String, nil] The name of the customer. + # + # @param due_date [Time, nil] The date by which the invoice must be paid. + # + # @param email_address [String, nil] The email address of the customer. + # + # @param line_items [Array, nil] Line items that break down the invoice total. + # + # @param mailing_address_id [String, nil] The unique identifier of an existing mailing address to attach. + # + # @param member_id [String, nil] The unique identifier of a member to assign as the customer. + # + # @param payment_method_id [String, nil] The unique identifier of the payment method to charge. + # + # @param plan [WhopSDK::Models::InvoiceUpdateParams::Plan, nil] Updated plan attributes. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + + class BillingAddress < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city of the address. + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # The country of the address. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute line1 + # The line 1 of the address. + # + # @return [String, nil] + optional :line1, String, nil?: true + + # @!attribute line2 + # The line 2 of the address. + # + # @return [String, nil] + optional :line2, String, nil?: true + + # @!attribute name + # The name of the customer. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute phone + # The phone number of the customer. + # + # @return [String, nil] + optional :phone, String, nil?: true + + # @!attribute postal_code + # The postal code of the address. + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!attribute state + # The state of the address. + # + # @return [String, nil] + optional :state, String, nil?: true + + # @!attribute tax_id_type + # The type of tax identifier + # + # @return [Symbol, WhopSDK::Models::TaxIdentifierType, nil] + optional :tax_id_type, enum: -> { WhopSDK::TaxIdentifierType }, nil?: true + + # @!attribute tax_id_value + # The value of the tax identifier. + # + # @return [String, nil] + optional :tax_id_value, String, nil?: true + + # @!method initialize(city: nil, country: nil, line1: nil, line2: nil, name: nil, phone: nil, postal_code: nil, state: nil, tax_id_type: nil, tax_id_value: nil) + # Inline billing address to create or update a mailing address for this invoice. + # + # @param city [String, nil] The city of the address. + # + # @param country [String, nil] The country of the address. + # + # @param line1 [String, nil] The line 1 of the address. + # + # @param line2 [String, nil] The line 2 of the address. + # + # @param name [String, nil] The name of the customer. + # + # @param phone [String, nil] The phone number of the customer. + # + # @param postal_code [String, nil] The postal code of the address. + # + # @param state [String, nil] The state of the address. + # + # @param tax_id_type [Symbol, WhopSDK::Models::TaxIdentifierType, nil] The type of tax identifier + # + # @param tax_id_value [String, nil] The value of the tax identifier. + end + + class LineItem < WhopSDK::Internal::Type::BaseModel + # @!attribute label + # The label or description for this line item. + # + # @return [String] + required :label, String + + # @!attribute unit_price + # The unit price for this line item. Provided as a number in the specified + # currency. Eg: 10.43 for $10.43 + # + # @return [Float] + required :unit_price, Float + + # @!attribute quantity + # The quantity of this line item. Defaults to 1. + # + # @return [Float, nil] + optional :quantity, Float, nil?: true + + # @!method initialize(label:, unit_price:, quantity: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::InvoiceUpdateParams::LineItem} for more details. + # + # A single line item to include on the invoice, with a label, quantity, and unit + # price. + # + # @param label [String] The label or description for this line item. + # + # @param unit_price [Float] The unit price for this line item. Provided as a number in the specified currenc + # + # @param quantity [Float, nil] The quantity of this line item. Defaults to 1. + end + + class Plan < WhopSDK::Internal::Type::BaseModel + # @!attribute billing_period + # The interval in days at which the plan charges (renewal plans). + # + # @return [Integer, nil] + optional :billing_period, Integer, nil?: true + + # @!attribute custom_fields + # An array of custom field objects. + # + # @return [Array, nil] + optional :custom_fields, + -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::InvoiceUpdateParams::Plan::CustomField] }, + nil?: true + + # @!attribute description + # The description of the plan. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute expiration_days + # The number of days until the membership expires and revokes access (expiration + # plans). For example, 365 for a one-year access period. + # + # @return [Integer, nil] + optional :expiration_days, Integer, nil?: true + + # @!attribute initial_price + # An additional amount charged upon first purchase. Use only if a one time payment + # OR you want to charge an additional amount on top of the renewal price. Provided + # as a number in the specified currency. Eg: 10.43 for $10.43 + # + # @return [Float, nil] + optional :initial_price, Float, nil?: true + + # @!attribute internal_notes + # A personal description or notes section for the business. + # + # @return [String, nil] + optional :internal_notes, String, nil?: true + + # @!attribute legacy_payment_method_controls + # Whether this plan uses legacy payment method controls + # + # @return [Boolean, nil] + optional :legacy_payment_method_controls, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!attribute payment_method_configuration + # The explicit payment method configuration for the plan. If not provided, the + # platform or company's defaults will apply. + # + # @return [WhopSDK::Models::InvoiceUpdateParams::Plan::PaymentMethodConfiguration, nil] + optional :payment_method_configuration, + -> { WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration }, + nil?: true + + # @!attribute plan_type + # The type of plan that can be attached to a product + # + # @return [Symbol, WhopSDK::Models::PlanType, nil] + optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true + + # @!attribute release_method + # The methods of how a plan can be released. + # + # @return [Symbol, WhopSDK::Models::ReleaseMethod, nil] + optional :release_method, enum: -> { WhopSDK::ReleaseMethod }, nil?: true + + # @!attribute renewal_price + # The amount the customer is charged every billing period. Use only if a recurring + # payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43 + # + # @return [Float, nil] + optional :renewal_price, Float, nil?: true + + # @!attribute stock + # The number of units available for purchase. + # + # @return [Integer, nil] + optional :stock, Integer, nil?: true + + # @!attribute trial_period_days + # The number of free trial days added before a renewal plan. + # + # @return [Integer, nil] + optional :trial_period_days, Integer, nil?: true + + # @!attribute unlimited_stock + # When true, the plan has unlimited stock (stock field is ignored). When false, + # purchases are limited by the stock field. + # + # @return [Boolean, nil] + optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!attribute visibility + # Visibility of a resource + # + # @return [Symbol, WhopSDK::Models::Visibility, nil] + optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true + + # @!method initialize(billing_period: nil, custom_fields: nil, description: nil, expiration_days: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::InvoiceUpdateParams::Plan} for more details. + # + # Updated plan attributes. + # + # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans). + # + # @param custom_fields [Array, nil] An array of custom field objects. + # + # @param description [String, nil] The description of the plan. + # + # @param expiration_days [Integer, nil] The number of days until the membership expires and revokes access (expiration p + # + # @param initial_price [Float, nil] An additional amount charged upon first purchase. Use only if a one time payment + # + # @param internal_notes [String, nil] A personal description or notes section for the business. + # + # @param legacy_payment_method_controls [Boolean, nil] Whether this plan uses legacy payment method controls + # + # @param payment_method_configuration [WhopSDK::Models::InvoiceUpdateParams::Plan::PaymentMethodConfiguration, nil] The explicit payment method configuration for the plan. If not provided, the pla + # + # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product + # + # @param release_method [Symbol, WhopSDK::Models::ReleaseMethod, nil] The methods of how a plan can be released. + # + # @param renewal_price [Float, nil] The amount the customer is charged every billing period. Use only if a recurring + # + # @param stock [Integer, nil] The number of units available for purchase. + # + # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan. + # + # @param unlimited_stock [Boolean, nil] When true, the plan has unlimited stock (stock field is ignored). When false, pu + # + # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource + + class CustomField < WhopSDK::Internal::Type::BaseModel + # @!attribute field_type + # The type of the custom field. + # + # @return [Symbol, :text] + required :field_type, const: :text + + # @!attribute name + # The name of the custom field. + # + # @return [String] + required :name, String + + # @!attribute id + # The ID of the custom field (if being updated) + # + # @return [String, nil] + optional :id, String, nil?: true + + # @!attribute order + # The order of the field. + # + # @return [Integer, nil] + optional :order, Integer, nil?: true + + # @!attribute placeholder + # The placeholder value of the field. + # + # @return [String, nil] + optional :placeholder, String, nil?: true + + # @!attribute required + # Whether or not the field is required. + # + # @return [Boolean, nil] + optional :required, WhopSDK::Internal::Type::Boolean, nil?: true + + # @!method initialize(name:, id: nil, order: nil, placeholder: nil, required: nil, field_type: :text) + # @param name [String] The name of the custom field. + # + # @param id [String, nil] The ID of the custom field (if being updated) + # + # @param order [Integer, nil] The order of the field. + # + # @param placeholder [String, nil] The placeholder value of the field. + # + # @param required [Boolean, nil] Whether or not the field is required. + # + # @param field_type [Symbol, :text] The type of the custom field. + end + + # @see WhopSDK::Models::InvoiceUpdateParams::Plan#payment_method_configuration + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + # @!attribute disabled + # An array of payment method identifiers that are explicitly disabled. Only + # applies if the include_platform_defaults is true. + # + # @return [Array] + required :disabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } + + # @!attribute enabled + # An array of payment method identifiers that are explicitly enabled. This means + # these payment methods will be shown on checkout. Example use case is to only + # enable a specific payment method like cashapp, or extending the platform + # defaults with additional methods. + # + # @return [Array] + required :enabled, -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentMethodTypes] } + + # @!attribute include_platform_defaults + # Whether Whop's platform default payment method enablement settings are included + # in this configuration. The full list of default payment methods can be found in + # the documentation at docs.whop.com/payments. + # + # @return [Boolean] + required :include_platform_defaults, WhopSDK::Internal::Type::Boolean + + # @!method initialize(disabled:, enabled:, include_platform_defaults:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::InvoiceUpdateParams::Plan::PaymentMethodConfiguration} for + # more details. + # + # The explicit payment method configuration for the plan. If not provided, the + # platform or company's defaults will apply. + # + # @param disabled [Array] An array of payment method identifiers that are explicitly disabled. Only applie + # + # @param enabled [Array] An array of payment method identifiers that are explicitly enabled. This means t + # + # @param include_platform_defaults [Boolean] Whether Whop's platform default payment method enablement settings are included + end + end + end + end +end diff --git a/lib/whop_sdk/models/membership.rb b/lib/whop_sdk/models/membership.rb index c8e9b939..cf9e6cab 100644 --- a/lib/whop_sdk/models/membership.rb +++ b/lib/whop_sdk/models/membership.rb @@ -95,8 +95,8 @@ class Membership < WhopSDK::Internal::Type::BaseModel # Custom key-value pairs for the membership (commonly used for software licensing, # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. # - # @return [Hash{Symbol=>Object}] - required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] + # @return [Hash{Symbol=>Object}, nil] + required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true # @!attribute payment_collection_paused # Whether recurring payment collection for this membership is temporarily paused @@ -190,7 +190,7 @@ class Membership < WhopSDK::Internal::Type::BaseModel # # @param member [WhopSDK::Models::Membership::Member, nil] The member record linking the user to the company for this membership. Null if t # - # @param metadata [Hash{Symbol=>Object}] Custom key-value pairs for the membership (commonly used for software licensing, + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs for the membership (commonly used for software licensing, # # @param payment_collection_paused [Boolean] Whether recurring payment collection for this membership is temporarily paused b # diff --git a/lib/whop_sdk/models/membership_list_response.rb b/lib/whop_sdk/models/membership_list_response.rb index 692267b6..eacd1d59 100644 --- a/lib/whop_sdk/models/membership_list_response.rb +++ b/lib/whop_sdk/models/membership_list_response.rb @@ -88,8 +88,8 @@ class MembershipListResponse < WhopSDK::Internal::Type::BaseModel # Custom key-value pairs for the membership (commonly used for software licensing, # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. # - # @return [Hash{Symbol=>Object}] - required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown] + # @return [Hash{Symbol=>Object}, nil] + required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true # @!attribute payment_collection_paused # Whether recurring payment collection for this membership is temporarily paused @@ -181,7 +181,7 @@ class MembershipListResponse < WhopSDK::Internal::Type::BaseModel # # @param member [WhopSDK::Models::MembershipListResponse::Member, nil] The member record linking the user to the company for this membership. Null if t # - # @param metadata [Hash{Symbol=>Object}] Custom key-value pairs for the membership (commonly used for software licensing, + # @param metadata [Hash{Symbol=>Object}, nil] Custom key-value pairs for the membership (commonly used for software licensing, # # @param payment_collection_paused [Boolean] Whether recurring payment collection for this membership is temporarily paused b # diff --git a/lib/whop_sdk/models/payment_method_types.rb b/lib/whop_sdk/models/payment_method_types.rb index 159bbc01..ab0d622f 100644 --- a/lib/whop_sdk/models/payment_method_types.rb +++ b/lib/whop_sdk/models/payment_method_types.rb @@ -16,6 +16,7 @@ module PaymentMethodTypes APPLE_PAY = :apple_pay AU_BECS_DEBIT = :au_becs_debit BACS_DEBIT = :bacs_debit + BANCOLOMBIA = :bancolombia BANCONTACT = :bancontact BILLIE = :billie BIZUM = :bizum @@ -30,6 +31,7 @@ module PaymentMethodTypes CUSTOM = :custom CUSTOMER_BALANCE = :customer_balance DEMO_PAY = :demo_pay + EFECTY = :efecty EPS = :eps EU_BANK_TRANSFER = :eu_bank_transfer FPX = :fpx @@ -48,10 +50,12 @@ module PaymentMethodTypes KRIYA = :kriya LINK = :link MB_WAY = :mb_way + MERCADO_PAGO = :mercado_pago MOBILEPAY = :mobilepay MONDU = :mondu MULTIBANCO = :multibanco NAVER_PAY = :naver_pay + NEQUI = :nequi NETBANKING = :netbanking NG_BANK = :ng_bank NG_BANK_TRANSFER = :ng_bank_transfer @@ -62,6 +66,7 @@ module PaymentMethodTypes NZ_BANK_ACCOUNT = :nz_bank_account OXXO = :oxxo P24 = :p24 + PSE = :pse PAY_BY_BANK = :pay_by_bank PAYCO = :payco PAYNOW = :paynow @@ -84,6 +89,7 @@ module PaymentMethodTypes SHOPEEPAY = :shopeepay SOFORT = :sofort SOUTH_KOREA_MARKET = :south_korea_market + SPEI = :spei SPLITIT = :splitit SUNBIT = :sunbit SWISH = :swish diff --git a/lib/whop_sdk/models/payment_provider.rb b/lib/whop_sdk/models/payment_provider.rb index 4a7e584f..27cf78ff 100644 --- a/lib/whop_sdk/models/payment_provider.rb +++ b/lib/whop_sdk/models/payment_provider.rb @@ -20,6 +20,7 @@ module PaymentProvider AIRWALLEX = :airwallex COINFLOW = :coinflow SEQURA = :sequra + DLOCAL = :dlocal # @!method self.values # @return [Array] diff --git a/lib/whop_sdk/models/plan_create_params.rb b/lib/whop_sdk/models/plan_create_params.rb index 22eecbf6..6d64da63 100644 --- a/lib/whop_sdk/models/plan_create_params.rb +++ b/lib/whop_sdk/models/plan_create_params.rb @@ -26,6 +26,13 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # @return [Integer, nil] optional :billing_period, Integer, nil?: true + # @!attribute checkout_styling + # Checkout styling overrides for this plan. Pass null to inherit from the company + # default. + # + # @return [WhopSDK::Models::PlanCreateParams::CheckoutStyling, nil] + optional :checkout_styling, -> { WhopSDK::PlanCreateParams::CheckoutStyling }, nil?: true + # @!attribute currency # The available currencies on the platform # @@ -152,7 +159,7 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Visibility, nil] optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - # @!method initialize(company_id:, product_id:, billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) + # @!method initialize(company_id:, product_id:, billing_period: nil, checkout_styling: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::PlanCreateParams} for more details. # @@ -162,6 +169,8 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # # @param billing_period [Integer, nil] The number of days between recurring charges. For example, 30 for monthly or 365 # + # @param checkout_styling [WhopSDK::Models::PlanCreateParams::CheckoutStyling, nil] Checkout styling overrides for this plan. Pass null to inherit from the company + # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform # # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. @@ -202,6 +211,36 @@ class PlanCreateParams < WhopSDK::Internal::Type::BaseModel # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + # @!attribute border_style + # The different border-radius styles available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutShape, nil] + optional :border_style, enum: -> { WhopSDK::CheckoutShape }, nil?: true + + # @!attribute button_color + # A hex color code for the button color (e.g. #FF5733). + # + # @return [String, nil] + optional :button_color, String, nil?: true + + # @!attribute font_family + # The different font families available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutFont, nil] + optional :font_family, enum: -> { WhopSDK::CheckoutFont }, nil?: true + + # @!method initialize(border_style: nil, button_color: nil, font_family: nil) + # Checkout styling overrides for this plan. Pass null to inherit from the company + # default. + # + # @param border_style [Symbol, WhopSDK::Models::CheckoutShape, nil] The different border-radius styles available for checkout pages. + # + # @param button_color [String, nil] A hex color code for the button color (e.g. #FF5733). + # + # @param font_family [Symbol, WhopSDK::Models::CheckoutFont, nil] The different font families available for checkout pages. + end + class CustomField < WhopSDK::Internal::Type::BaseModel # @!attribute field_type # The type of the custom field. diff --git a/lib/whop_sdk/models/plan_update_params.rb b/lib/whop_sdk/models/plan_update_params.rb index a65173ff..759315aa 100644 --- a/lib/whop_sdk/models/plan_update_params.rb +++ b/lib/whop_sdk/models/plan_update_params.rb @@ -19,6 +19,13 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Integer, nil] optional :billing_period, Integer, nil?: true + # @!attribute checkout_styling + # Checkout styling overrides for this plan. Pass null to remove all overrides and + # inherit from the company default. + # + # @return [WhopSDK::Models::PlanUpdateParams::CheckoutStyling, nil] + optional :checkout_styling, -> { WhopSDK::PlanUpdateParams::CheckoutStyling }, nil?: true + # @!attribute currency # The available currencies on the platform # @@ -145,7 +152,7 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # @return [Symbol, WhopSDK::Models::Visibility, nil] optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true - # @!method initialize(id:, billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, offer_cancel_discount: nil, override_tax_type: nil, payment_method_configuration: nil, renewal_price: nil, stock: nil, strike_through_initial_price: nil, strike_through_renewal_price: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) + # @!method initialize(id:, billing_period: nil, checkout_styling: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, offer_cancel_discount: nil, override_tax_type: nil, payment_method_configuration: nil, renewal_price: nil, stock: nil, strike_through_initial_price: nil, strike_through_renewal_price: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) # Some parameter documentations has been truncated, see # {WhopSDK::Models::PlanUpdateParams} for more details. # @@ -153,6 +160,8 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param billing_period [Integer, nil] The number of days between recurring charges. For example, 30 for monthly or 365 # + # @param checkout_styling [WhopSDK::Models::PlanUpdateParams::CheckoutStyling, nil] Checkout styling overrides for this plan. Pass null to remove all overrides and + # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform # # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. @@ -193,6 +202,36 @@ class PlanUpdateParams < WhopSDK::Internal::Type::BaseModel # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + # @!attribute border_style + # The different border-radius styles available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutShape, nil] + optional :border_style, enum: -> { WhopSDK::CheckoutShape }, nil?: true + + # @!attribute button_color + # A hex color code for the button color (e.g. #FF5733). + # + # @return [String, nil] + optional :button_color, String, nil?: true + + # @!attribute font_family + # The different font families available for checkout pages. + # + # @return [Symbol, WhopSDK::Models::CheckoutFont, nil] + optional :font_family, enum: -> { WhopSDK::CheckoutFont }, nil?: true + + # @!method initialize(border_style: nil, button_color: nil, font_family: nil) + # Checkout styling overrides for this plan. Pass null to remove all overrides and + # inherit from the company default. + # + # @param border_style [Symbol, WhopSDK::Models::CheckoutShape, nil] The different border-radius styles available for checkout pages. + # + # @param button_color [String, nil] A hex color code for the button color (e.g. #FF5733). + # + # @param font_family [Symbol, WhopSDK::Models::CheckoutFont, nil] The different font families available for checkout pages. + end + class CustomField < WhopSDK::Internal::Type::BaseModel # @!attribute field_type # The type of the custom field. diff --git a/lib/whop_sdk/models/tax_identifier_type.rb b/lib/whop_sdk/models/tax_identifier_type.rb new file mode 100644 index 00000000..e658fd6d --- /dev/null +++ b/lib/whop_sdk/models/tax_identifier_type.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # The type of tax identifier + module TaxIdentifierType + extend WhopSDK::Internal::Type::Enum + + AD_NRT = :ad_nrt + AO_TIN = :ao_tin + AR_CUIT = :ar_cuit + AM_TIN = :am_tin + AW_TIN = :aw_tin + AU_ABN = :au_abn + AU_ARN = :au_arn + EU_VAT = :eu_vat + AZ_TIN = :az_tin + BS_TIN = :bs_tin + BH_VAT = :bh_vat + BD_BIN = :bd_bin + BB_TIN = :bb_tin + BY_TIN = :by_tin + BJ_IFU = :bj_ifu + BO_TIN = :bo_tin + BA_TIN = :ba_tin + BR_CNPJ = :br_cnpj + BR_CPF = :br_cpf + BG_UIC = :bg_uic + BF_IFU = :bf_ifu + KH_TIN = :kh_tin + CM_NIU = :cm_niu + CA_BN = :ca_bn + CA_GST_HST = :ca_gst_hst + CA_PST_BC = :ca_pst_bc + CA_PST_MB = :ca_pst_mb + CA_PST_SK = :ca_pst_sk + CA_QST = :ca_qst + CV_NIF = :cv_nif + CL_TIN = :cl_tin + CN_TIN = :cn_tin + CO_NIT = :co_nit + CD_NIF = :cd_nif + CR_TIN = :cr_tin + HR_OIB = :hr_oib + DO_RCN = :do_rcn + EC_RUC = :ec_ruc + EG_TIN = :eg_tin + SV_NIT = :sv_nit + ET_TIN = :et_tin + EU_OSS_VAT = :eu_oss_vat + GE_VAT = :ge_vat + DE_STN = :de_stn + GB_VAT = :gb_vat + GN_NIF = :gn_nif + HK_BR = :hk_br + HU_TIN = :hu_tin + IS_VAT = :is_vat + IN_GST = :in_gst + ID_NPWP = :id_npwp + IL_VAT = :il_vat + JP_CN = :jp_cn + JP_RN = :jp_rn + JP_TRN = :jp_trn + KZ_BIN = :kz_bin + KE_PIN = :ke_pin + KG_TIN = :kg_tin + LA_TIN = :la_tin + LI_UID = :li_uid + LI_VAT = :li_vat + MY_FRP = :my_frp + MY_ITN = :my_itn + MY_SST = :my_sst + MR_NIF = :mr_nif + MX_RFC = :mx_rfc + MD_VAT = :md_vat + ME_PIB = :me_pib + MA_VAT = :ma_vat + NP_PAN = :np_pan + NZ_GST = :nz_gst + NG_TIN = :ng_tin + MK_VAT = :mk_vat + NO_VAT = :no_vat + NO_VOEC = :no_voec + OM_VAT = :om_vat + PE_RUC = :pe_ruc + PH_TIN = :ph_tin + PL_NIP = :pl_nip + RO_TIN = :ro_tin + RU_INN = :ru_inn + RU_KPP = :ru_kpp + SA_VAT = :sa_vat + SN_NINEA = :sn_ninea + RS_PIB = :rs_pib + SG_GST = :sg_gst + SG_UEN = :sg_uen + SI_TIN = :si_tin + ZA_VAT = :za_vat + KR_BRN = :kr_brn + ES_CIF = :es_cif + CH_UID = :ch_uid + CH_VAT = :ch_vat + TW_VAT = :tw_vat + TJ_TIN = :tj_tin + TZ_VAT = :tz_vat + TH_VAT = :th_vat + TR_TIN = :tr_tin + UG_TIN = :ug_tin + UA_VAT = :ua_vat + AE_TRN = :ae_trn + US_EIN = :us_ein + UY_RUC = :uy_ruc + UZ_TIN = :uz_tin + UZ_VAT = :uz_vat + VE_RIF = :ve_rif + VN_TIN = :vn_tin + ZM_TIN = :zm_tin + ZW_TIN = :zw_tin + SR_FIN = :sr_fin + XI_VAT = :xi_vat + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/whop_sdk/resources/invoices.rb b/lib/whop_sdk/resources/invoices.rb index 4469cafa..e0988b27 100644 --- a/lib/whop_sdk/resources/invoices.rb +++ b/lib/whop_sdk/resources/invoices.rb @@ -13,7 +13,7 @@ class Invoices # # @overload create(body:, request_options: {}) # - # @param body [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress] Parameters for CreateInvoice + # @param body [WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct, WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID] Parameters for CreateInvoice # # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -55,6 +55,56 @@ def retrieve(id, params = {}) ) end + # Update a draft invoice's details. + # + # Required permissions: + # + # - `invoice:update` + # + # @overload update(id, automatically_finalizes_at: nil, billing_address: nil, charge_buyer_fee: nil, collection_method: nil, customer_name: nil, due_date: nil, email_address: nil, line_items: nil, mailing_address_id: nil, member_id: nil, payment_method_id: nil, plan: nil, request_options: {}) + # + # @param id [String] The unique identifier of the invoice to update. + # + # @param automatically_finalizes_at [Time, nil] The date and time when the invoice will be automatically finalized and charged. + # + # @param billing_address [WhopSDK::Models::InvoiceUpdateParams::BillingAddress, nil] Inline billing address to create or update a mailing address for this invoice. + # + # @param charge_buyer_fee [Boolean, nil] Whether to charge the customer a buyer fee on this invoice. + # + # @param collection_method [Symbol, WhopSDK::Models::CollectionMethod, nil] The method of collection for an invoice. + # + # @param customer_name [String, nil] The name of the customer. + # + # @param due_date [Time, nil] The date by which the invoice must be paid. + # + # @param email_address [String, nil] The email address of the customer. + # + # @param line_items [Array, nil] Line items that break down the invoice total. + # + # @param mailing_address_id [String, nil] The unique identifier of an existing mailing address to attach. + # + # @param member_id [String, nil] The unique identifier of a member to assign as the customer. + # + # @param payment_method_id [String, nil] The unique identifier of the payment method to charge. + # + # @param plan [WhopSDK::Models::InvoiceUpdateParams::Plan, nil] Updated plan attributes. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::Invoice] + # + # @see WhopSDK::Models::InvoiceUpdateParams + def update(id, params = {}) + parsed, options = WhopSDK::InvoiceUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["invoices/%1$s", id], + body: parsed, + model: WhopSDK::Invoice, + options: options + ) + end + # Some parameter documentations has been truncated, see # {WhopSDK::Models::InvoiceListParams} for more details. # @@ -109,6 +159,78 @@ def list(params = {}) ) end + # Delete a draft invoice. + # + # Required permissions: + # + # - `invoice:update` + # + # @overload delete(id, request_options: {}) + # + # @param id [String] The unique identifier of the draft invoice to delete. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Boolean] + # + # @see WhopSDK::Models::InvoiceDeleteParams + def delete(id, params = {}) + @client.request( + method: :delete, + path: ["invoices/%1$s", id], + model: WhopSDK::Internal::Type::Boolean, + options: params[:request_options] + ) + end + + # Mark an open invoice as paid when payment was collected outside of Whop. + # + # Required permissions: + # + # - `invoice:update` + # + # @overload mark_paid(id, request_options: {}) + # + # @param id [String] The unique identifier of the invoice to mark as paid. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Boolean] + # + # @see WhopSDK::Models::InvoiceMarkPaidParams + def mark_paid(id, params = {}) + @client.request( + method: :post, + path: ["invoices/%1$s/mark_paid", id], + model: WhopSDK::Internal::Type::Boolean, + options: params[:request_options] + ) + end + + # Mark an open invoice as uncollectible when payment is not expected. + # + # Required permissions: + # + # - `invoice:update` + # + # @overload mark_uncollectible(id, request_options: {}) + # + # @param id [String] The unique identifier of the invoice to mark as uncollectible. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Boolean] + # + # @see WhopSDK::Models::InvoiceMarkUncollectibleParams + def mark_uncollectible(id, params = {}) + @client.request( + method: :post, + path: ["invoices/%1$s/mark_uncollectible", id], + model: WhopSDK::Internal::Type::Boolean, + options: params[:request_options] + ) + end + # Void an open invoice so it can no longer be paid. Voiding is permanent and # cannot be undone. # diff --git a/lib/whop_sdk/resources/plans.rb b/lib/whop_sdk/resources/plans.rb index 699ea156..230df5a7 100644 --- a/lib/whop_sdk/resources/plans.rb +++ b/lib/whop_sdk/resources/plans.rb @@ -16,7 +16,7 @@ class Plans # - `access_pass:basic:read` # - `plan:basic:read` # - # @overload create(company_id:, product_id:, billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) + # @overload create(company_id:, product_id:, billing_period: nil, checkout_styling: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) # # @param company_id [String] The unique identifier of the company to create this plan for. # @@ -24,6 +24,8 @@ class Plans # # @param billing_period [Integer, nil] The number of days between recurring charges. For example, 30 for monthly or 365 # + # @param checkout_styling [WhopSDK::Models::PlanCreateParams::CheckoutStyling, nil] Checkout styling overrides for this plan. Pass null to inherit from the company + # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform # # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. @@ -108,12 +110,14 @@ def retrieve(id, params = {}) # - `access_pass:basic:read` # - `plan:basic:read` # - # @overload update(id, billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, offer_cancel_discount: nil, override_tax_type: nil, payment_method_configuration: nil, renewal_price: nil, stock: nil, strike_through_initial_price: nil, strike_through_renewal_price: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) + # @overload update(id, billing_period: nil, checkout_styling: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, legacy_payment_method_controls: nil, offer_cancel_discount: nil, override_tax_type: nil, payment_method_configuration: nil, renewal_price: nil, stock: nil, strike_through_initial_price: nil, strike_through_renewal_price: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {}) # # @param id [String] The unique identifier of the plan to update. # # @param billing_period [Integer, nil] The number of days between recurring charges. For example, 30 for monthly or 365 # + # @param checkout_styling [WhopSDK::Models::PlanUpdateParams::CheckoutStyling, nil] Checkout styling overrides for this plan. Pass null to remove all overrides and + # # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform # # @param custom_fields [Array, nil] An array of custom field definitions to collect from customers at checkout. diff --git a/lib/whop_sdk/version.rb b/lib/whop_sdk/version.rb index a3f3d9dc..73453256 100644 --- a/lib/whop_sdk/version.rb +++ b/lib/whop_sdk/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module WhopSDK - VERSION = "0.0.36" + VERSION = "0.0.37" end diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index c3d964d1..cbc8ef31 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -106,8 +106,12 @@ module WhopSDK CheckoutConfigurationRetrieveParams = WhopSDK::Models::CheckoutConfigurationRetrieveParams + CheckoutFont = WhopSDK::Models::CheckoutFont + CheckoutModes = WhopSDK::Models::CheckoutModes + CheckoutShape = WhopSDK::Models::CheckoutShape + CollectionMethod = WhopSDK::Models::CollectionMethod Company = WhopSDK::Models::Company @@ -341,6 +345,8 @@ module WhopSDK InvoiceCreateParams = WhopSDK::Models::InvoiceCreateParams + InvoiceDeleteParams = WhopSDK::Models::InvoiceDeleteParams + InvoiceListItem = WhopSDK::Models::InvoiceListItem InvoiceListParams = WhopSDK::Models::InvoiceListParams @@ -348,6 +354,11 @@ module WhopSDK InvoiceMarkedUncollectibleWebhookEvent = WhopSDK::Models::InvoiceMarkedUncollectibleWebhookEvent + InvoiceMarkPaidParams = WhopSDK::Models::InvoiceMarkPaidParams + + InvoiceMarkUncollectibleParams = + WhopSDK::Models::InvoiceMarkUncollectibleParams + InvoicePaidWebhookEvent = WhopSDK::Models::InvoicePaidWebhookEvent InvoicePastDueWebhookEvent = WhopSDK::Models::InvoicePastDueWebhookEvent @@ -356,6 +367,8 @@ module WhopSDK InvoiceStatus = WhopSDK::Models::InvoiceStatus + InvoiceUpdateParams = WhopSDK::Models::InvoiceUpdateParams + InvoiceVoidedWebhookEvent = WhopSDK::Models::InvoiceVoidedWebhookEvent InvoiceVoidParams = WhopSDK::Models::InvoiceVoidParams @@ -635,6 +648,8 @@ module WhopSDK SupportChannelRetrieveParams = WhopSDK::Models::SupportChannelRetrieveParams + TaxIdentifierType = WhopSDK::Models::TaxIdentifierType + TaxType = WhopSDK::Models::TaxType TopupCreateParams = WhopSDK::Models::TopupCreateParams diff --git a/rbi/whop_sdk/models/checkout_configuration_create_params.rbi b/rbi/whop_sdk/models/checkout_configuration_create_params.rbi index 0bb46a80..c57a92e0 100644 --- a/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +++ b/rbi/whop_sdk/models/checkout_configuration_create_params.rbi @@ -102,6 +102,27 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :affiliate_code + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + sig do + returns( + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling + ) + ) + end + attr_reader :checkout_styling + + sig do + params( + checkout_styling: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling::OrHash + ) + ).void + end + attr_writer :checkout_styling + # The available currencies on the platform sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } attr_accessor :currency @@ -162,6 +183,10 @@ module WhopSDK plan: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan::OrHash, affiliate_code: T.nilable(String), + checkout_styling: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling::OrHash + ), currency: T.nilable(WhopSDK::Currency::OrSymbol), metadata: T.nilable(T::Hash[Symbol, T.anything]), mode: @@ -179,6 +204,9 @@ module WhopSDK plan:, # An affiliate tracking code to attribute the checkout to a specific affiliate. affiliate_code: nil, + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + checkout_styling: nil, # The available currencies on the platform currency: nil, # Custom key-value metadata to attach to the checkout configuration. @@ -200,6 +228,10 @@ module WhopSDK plan: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan, affiliate_code: T.nilable(String), + checkout_styling: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling + ), currency: T.nilable(WhopSDK::Currency::OrSymbol), metadata: T.nilable(T::Hash[Symbol, T.anything]), mode: @@ -837,6 +869,59 @@ module WhopSDK end end + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling, + WhopSDK::Internal::AnyHash + ) + end + + # The different border-radius styles available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutShape::OrSymbol)) } + attr_accessor :border_style + + # A hex color code for the button color (e.g. #FF5733). + sig { returns(T.nilable(String)) } + attr_accessor :button_color + + # The different font families available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutFont::OrSymbol)) } + attr_accessor :font_family + + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + sig do + params( + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # The different border-radius styles available for checkout pages. + border_style: nil, + # A hex color code for the button color (e.g. #FF5733). + button_color: nil, + # The different font families available for checkout pages. + font_family: nil + ) + end + + sig do + override.returns( + { + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + } + ) + end + def to_hash + end + end + module Mode extend WhopSDK::Internal::Type::Enum @@ -950,6 +1035,27 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :affiliate_code + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + sig do + returns( + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling + ) + ) + end + attr_reader :checkout_styling + + sig do + params( + checkout_styling: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling::OrHash + ) + ).void + end + attr_writer :checkout_styling + # The available currencies on the platform sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } attr_accessor :currency @@ -1009,6 +1115,10 @@ module WhopSDK params( plan_id: String, affiliate_code: T.nilable(String), + checkout_styling: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling::OrHash + ), currency: T.nilable(WhopSDK::Currency::OrSymbol), metadata: T.nilable(T::Hash[Symbol, T.anything]), mode: @@ -1027,6 +1137,9 @@ module WhopSDK plan_id:, # An affiliate tracking code to attribute the checkout to a specific affiliate. affiliate_code: nil, + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + checkout_styling: nil, # The available currencies on the platform currency: nil, # Custom key-value metadata to attach to the checkout configuration. @@ -1047,6 +1160,10 @@ module WhopSDK { plan_id: String, affiliate_code: T.nilable(String), + checkout_styling: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling + ), currency: T.nilable(WhopSDK::Currency::OrSymbol), metadata: T.nilable(T::Hash[Symbol, T.anything]), mode: @@ -1063,6 +1180,59 @@ module WhopSDK def to_hash end + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling, + WhopSDK::Internal::AnyHash + ) + end + + # The different border-radius styles available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutShape::OrSymbol)) } + attr_accessor :border_style + + # A hex color code for the button color (e.g. #FF5733). + sig { returns(T.nilable(String)) } + attr_accessor :button_color + + # The different font families available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutFont::OrSymbol)) } + attr_accessor :font_family + + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + sig do + params( + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # The different border-radius styles available for checkout pages. + border_style: nil, + # A hex color code for the button color (e.g. #FF5733). + button_color: nil, + # The different font families available for checkout pages. + font_family: nil + ) + end + + sig do + override.returns( + { + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + } + ) + end + def to_hash + end + end + module Mode extend WhopSDK::Internal::Type::Enum @@ -1175,6 +1345,27 @@ module WhopSDK sig { returns(Symbol) } attr_accessor :mode + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + sig do + returns( + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling + ) + ) + end + attr_reader :checkout_styling + + sig do + params( + checkout_styling: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling::OrHash + ) + ).void + end + attr_writer :checkout_styling + # The available currencies on the platform sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } attr_accessor :currency @@ -1216,6 +1407,10 @@ module WhopSDK sig do params( company_id: String, + checkout_styling: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling::OrHash + ), currency: T.nilable(WhopSDK::Currency::OrSymbol), metadata: T.nilable(T::Hash[Symbol, T.anything]), payment_method_configuration: @@ -1231,6 +1426,9 @@ module WhopSDK # The unique identifier of the company to create the checkout configuration for. # Only required in setup mode. company_id:, + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + checkout_styling: nil, # The available currencies on the platform currency: nil, # Custom key-value metadata to attach to the checkout configuration. @@ -1251,6 +1449,10 @@ module WhopSDK { company_id: String, mode: Symbol, + checkout_styling: + T.nilable( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling + ), currency: T.nilable(WhopSDK::Currency::OrSymbol), metadata: T.nilable(T::Hash[Symbol, T.anything]), payment_method_configuration: @@ -1265,6 +1467,59 @@ module WhopSDK def to_hash end + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling, + WhopSDK::Internal::AnyHash + ) + end + + # The different border-radius styles available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutShape::OrSymbol)) } + attr_accessor :border_style + + # A hex color code for the button color (e.g. #FF5733). + sig { returns(T.nilable(String)) } + attr_accessor :button_color + + # The different font families available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutFont::OrSymbol)) } + attr_accessor :font_family + + # Checkout styling overrides for this session. Overrides plan and company + # defaults. + sig do + params( + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # The different border-radius styles available for checkout pages. + border_style: nil, + # A hex color code for the button color (e.g. #FF5733). + button_color: nil, + # The different font families available for checkout pages. + font_family: nil + ) + end + + sig do + override.returns( + { + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + } + ) + end + def to_hash + end + end + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/whop_sdk/models/checkout_font.rbi b/rbi/whop_sdk/models/checkout_font.rbi new file mode 100644 index 00000000..07e4d903 --- /dev/null +++ b/rbi/whop_sdk/models/checkout_font.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module WhopSDK + module Models + # The different font families available for checkout pages. + module CheckoutFont + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::CheckoutFont) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SYSTEM = T.let(:system, WhopSDK::CheckoutFont::TaggedSymbol) + ROBOTO = T.let(:roboto, WhopSDK::CheckoutFont::TaggedSymbol) + OPEN_SANS = T.let(:open_sans, WhopSDK::CheckoutFont::TaggedSymbol) + + sig { override.returns(T::Array[WhopSDK::CheckoutFont::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/whop_sdk/models/checkout_shape.rbi b/rbi/whop_sdk/models/checkout_shape.rbi new file mode 100644 index 00000000..beb4b7df --- /dev/null +++ b/rbi/whop_sdk/models/checkout_shape.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module WhopSDK + module Models + # The different border-radius styles available for checkout pages. + module CheckoutShape + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::CheckoutShape) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ROUNDED = T.let(:rounded, WhopSDK::CheckoutShape::TaggedSymbol) + PILL = T.let(:pill, WhopSDK::CheckoutShape::TaggedSymbol) + RECTANGULAR = T.let(:rectangular, WhopSDK::CheckoutShape::TaggedSymbol) + + sig { override.returns(T::Array[WhopSDK::CheckoutShape::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/whop_sdk/models/invoice_create_params.rbi b/rbi/whop_sdk/models/invoice_create_params.rbi index 400b6de7..e61e4eb2 100644 --- a/rbi/whop_sdk/models/invoice_create_params.rbi +++ b/rbi/whop_sdk/models/invoice_create_params.rbi @@ -15,10 +15,8 @@ module WhopSDK sig do returns( T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID ) ) end @@ -28,10 +26,8 @@ module WhopSDK params( body: T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::OrHash, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::OrHash, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::OrHash, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::OrHash, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::OrHash ), request_options: WhopSDK::RequestOptions::OrHash ).returns(T.attached_class) @@ -48,10 +44,8 @@ module WhopSDK { body: T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID ), request_options: WhopSDK::RequestOptions } @@ -67,18 +61,16 @@ module WhopSDK Variants = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID ) end - class CreateInvoiceInputWithProductAndMemberID < WhopSDK::Internal::Type::BaseModel + class CreateInvoiceInputWithProduct < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct, WhopSDK::Internal::AnyHash ) end @@ -92,20 +84,11 @@ module WhopSDK sig { returns(String) } attr_accessor :company_id - # The date by which the invoice must be paid. - sig { returns(Time) } - attr_accessor :due_date - - # The unique identifier of an existing member to create this invoice for. If not - # provided, you must supply an email_address and customer_name. - sig { returns(String) } - attr_accessor :member_id - # The plan attributes defining the price, currency, and billing interval for this # invoice. sig do returns( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan ) end attr_reader :plan @@ -113,7 +96,7 @@ module WhopSDK sig do params( plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::OrHash ).void end attr_writer :plan @@ -122,7 +105,7 @@ module WhopSDK # a new product inline. sig do returns( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product ) end attr_reader :product @@ -130,7 +113,7 @@ module WhopSDK sig do params( product: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product::OrHash ).void end attr_writer :product @@ -146,7 +129,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress ) ) end @@ -156,7 +139,7 @@ module WhopSDK params( billing_address: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress::OrHash ) ).void end @@ -171,13 +154,23 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :customer_name + # The date by which the invoice must be paid. Required unless save_as_draft is + # true. + sig { returns(T.nilable(Time)) } + attr_accessor :due_date + + # The email address of the customer. Required when creating an invoice for a + # customer who is not yet a member of the company. + sig { returns(T.nilable(String)) } + attr_accessor :email_address + # Optional line items that break down the invoice total. When provided, the sum of # (quantity \* unit_price) for all items must equal the plan price. sig do returns( T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem ] ) ) @@ -189,6 +182,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :mailing_address_id + # The unique identifier of an existing member to create this invoice for. If not + # provided, you must supply an email_address and customer_name. + sig { returns(T.nilable(String)) } + attr_accessor :member_id + # The unique identifier of the payment method to charge. Required when # collection_method is charge_automatically. sig { returns(T.nilable(String)) } @@ -199,33 +197,40 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :payment_token_id + # When true, creates the invoice as a draft without sending or charging. Relaxes + # customer and due date requirements. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :save_as_draft + # Autogenerated input type of CreateInvoice sig do params( collection_method: WhopSDK::CollectionMethod::OrSymbol, company_id: String, - due_date: Time, - member_id: String, plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::OrHash, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::OrHash, product: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product::OrHash, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product::OrHash, automatically_finalizes_at: T.nilable(Time), billing_address: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress::OrHash ), charge_buyer_fee: T.nilable(T::Boolean), customer_name: T.nilable(String), + due_date: T.nilable(Time), + email_address: T.nilable(String), line_items: T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem::OrHash ] ), mailing_address_id: T.nilable(String), + member_id: T.nilable(String), payment_method_id: T.nilable(String), - payment_token_id: T.nilable(String) + payment_token_id: T.nilable(String), + save_as_draft: T.nilable(T::Boolean) ).returns(T.attached_class) end def self.new( @@ -234,11 +239,6 @@ module WhopSDK collection_method:, # The unique identifier of the company to create this invoice for. company_id:, - # The date by which the invoice must be paid. - due_date:, - # The unique identifier of an existing member to create this invoice for. If not - # provided, you must supply an email_address and customer_name. - member_id:, # The plan attributes defining the price, currency, and billing interval for this # invoice. plan:, @@ -257,18 +257,30 @@ module WhopSDK # The name of the customer. Required when creating an invoice for a customer who # is not yet a member of the company. customer_name: nil, + # The date by which the invoice must be paid. Required unless save_as_draft is + # true. + due_date: nil, + # The email address of the customer. Required when creating an invoice for a + # customer who is not yet a member of the company. + email_address: nil, # Optional line items that break down the invoice total. When provided, the sum of # (quantity \* unit_price) for all items must equal the plan price. line_items: nil, # The unique identifier of an existing mailing address to attach to this invoice. # Cannot be used together with billing_address. mailing_address_id: nil, + # The unique identifier of an existing member to create this invoice for. If not + # provided, you must supply an email_address and customer_name. + member_id: nil, # The unique identifier of the payment method to charge. Required when # collection_method is charge_automatically. payment_method_id: nil, # The payment token ID to use for this invoice. If using charge_automatically, you # must provide a payment_token. - payment_token_id: nil + payment_token_id: nil, + # When true, creates the invoice as a draft without sending or charging. Relaxes + # customer and due date requirements. + save_as_draft: nil ) end @@ -277,28 +289,30 @@ module WhopSDK { collection_method: WhopSDK::CollectionMethod::OrSymbol, company_id: String, - due_date: Time, - member_id: String, plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan, product: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product, automatically_finalizes_at: T.nilable(Time), billing_address: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress ), charge_buyer_fee: T.nilable(T::Boolean), customer_name: T.nilable(String), + due_date: T.nilable(Time), + email_address: T.nilable(String), line_items: T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem ] ), mailing_address_id: T.nilable(String), + member_id: T.nilable(String), payment_method_id: T.nilable(String), - payment_token_id: T.nilable(String) + payment_token_id: T.nilable(String), + save_as_draft: T.nilable(T::Boolean) } ) end @@ -309,7 +323,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan, WhopSDK::Internal::AnyHash ) end @@ -323,7 +337,7 @@ module WhopSDK returns( T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::CustomField + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField ] ) ) @@ -358,7 +372,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration ) ) end @@ -368,7 +382,7 @@ module WhopSDK params( payment_method_configuration: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration::OrHash ) ).void end @@ -412,7 +426,7 @@ module WhopSDK custom_fields: T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::CustomField::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField::OrHash ] ), description: T.nilable(String), @@ -422,7 +436,7 @@ module WhopSDK legacy_payment_method_controls: T.nilable(T::Boolean), payment_method_configuration: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration::OrHash ), plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), @@ -480,7 +494,7 @@ module WhopSDK custom_fields: T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::CustomField + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField ] ), description: T.nilable(String), @@ -490,7 +504,7 @@ module WhopSDK legacy_payment_method_controls: T.nilable(T::Boolean), payment_method_configuration: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration ), plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), @@ -509,7 +523,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::CustomField, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField, WhopSDK::Internal::AnyHash ) end @@ -584,7 +598,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration, WhopSDK::Internal::AnyHash ) end @@ -650,7 +664,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product, WhopSDK::Internal::AnyHash ) end @@ -692,7 +706,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress, WhopSDK::Internal::AnyHash ) end @@ -730,13 +744,7 @@ module WhopSDK attr_accessor :state # The type of tax identifier - sig do - returns( - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::OrSymbol - ) - ) - end + sig { returns(T.nilable(WhopSDK::TaxIdentifierType::OrSymbol)) } attr_accessor :tax_id_type # The value of the tax identifier. @@ -755,10 +763,7 @@ module WhopSDK phone: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String), - tax_id_type: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::OrSymbol - ), + tax_id_type: T.nilable(WhopSDK::TaxIdentifierType::OrSymbol), tax_id_value: T.nilable(String) ).returns(T.attached_class) end @@ -797,603 +802,20 @@ module WhopSDK phone: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String), - tax_id_type: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::OrSymbol - ), + tax_id_type: T.nilable(WhopSDK::TaxIdentifierType::OrSymbol), tax_id_value: T.nilable(String) } ) end def to_hash end - - # The type of tax identifier - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AD_NRT = - T.let( - :ad_nrt, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AO_TIN = - T.let( - :ao_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AR_CUIT = - T.let( - :ar_cuit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AM_TIN = - T.let( - :am_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AW_TIN = - T.let( - :aw_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AU_ABN = - T.let( - :au_abn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AU_ARN = - T.let( - :au_arn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - EU_VAT = - T.let( - :eu_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AZ_TIN = - T.let( - :az_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BS_TIN = - T.let( - :bs_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BH_VAT = - T.let( - :bh_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BD_BIN = - T.let( - :bd_bin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BB_TIN = - T.let( - :bb_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BY_TIN = - T.let( - :by_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BJ_IFU = - T.let( - :bj_ifu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BO_TIN = - T.let( - :bo_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BA_TIN = - T.let( - :ba_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BR_CNPJ = - T.let( - :br_cnpj, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BR_CPF = - T.let( - :br_cpf, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BG_UIC = - T.let( - :bg_uic, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BF_IFU = - T.let( - :bf_ifu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KH_TIN = - T.let( - :kh_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CM_NIU = - T.let( - :cm_niu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_BN = - T.let( - :ca_bn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_GST_HST = - T.let( - :ca_gst_hst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_BC = - T.let( - :ca_pst_bc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_MB = - T.let( - :ca_pst_mb, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_SK = - T.let( - :ca_pst_sk, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_QST = - T.let( - :ca_qst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CV_NIF = - T.let( - :cv_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CL_TIN = - T.let( - :cl_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CN_TIN = - T.let( - :cn_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CO_NIT = - T.let( - :co_nit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CD_NIF = - T.let( - :cd_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CR_TIN = - T.let( - :cr_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - HR_OIB = - T.let( - :hr_oib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - DO_RCN = - T.let( - :do_rcn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - EC_RUC = - T.let( - :ec_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - EG_TIN = - T.let( - :eg_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SV_NIT = - T.let( - :sv_nit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ET_TIN = - T.let( - :et_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - EU_OSS_VAT = - T.let( - :eu_oss_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - GE_VAT = - T.let( - :ge_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - DE_STN = - T.let( - :de_stn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - GB_VAT = - T.let( - :gb_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - GN_NIF = - T.let( - :gn_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - HK_BR = - T.let( - :hk_br, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - HU_TIN = - T.let( - :hu_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - IS_VAT = - T.let( - :is_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - IN_GST = - T.let( - :in_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ID_NPWP = - T.let( - :id_npwp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - IL_VAT = - T.let( - :il_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_CN = - T.let( - :jp_cn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_RN = - T.let( - :jp_rn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_TRN = - T.let( - :jp_trn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KZ_BIN = - T.let( - :kz_bin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KE_PIN = - T.let( - :ke_pin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KG_TIN = - T.let( - :kg_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - LA_TIN = - T.let( - :la_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - LI_UID = - T.let( - :li_uid, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - LI_VAT = - T.let( - :li_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_FRP = - T.let( - :my_frp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_ITN = - T.let( - :my_itn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_SST = - T.let( - :my_sst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MR_NIF = - T.let( - :mr_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MX_RFC = - T.let( - :mx_rfc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MD_VAT = - T.let( - :md_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ME_PIB = - T.let( - :me_pib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MA_VAT = - T.let( - :ma_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NP_PAN = - T.let( - :np_pan, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NZ_GST = - T.let( - :nz_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NG_TIN = - T.let( - :ng_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MK_VAT = - T.let( - :mk_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NO_VAT = - T.let( - :no_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NO_VOEC = - T.let( - :no_voec, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - OM_VAT = - T.let( - :om_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - PE_RUC = - T.let( - :pe_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - PH_TIN = - T.let( - :ph_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - PL_NIP = - T.let( - :pl_nip, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - RO_TIN = - T.let( - :ro_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - RU_INN = - T.let( - :ru_inn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - RU_KPP = - T.let( - :ru_kpp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SA_VAT = - T.let( - :sa_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SN_NINEA = - T.let( - :sn_ninea, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - RS_PIB = - T.let( - :rs_pib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SG_GST = - T.let( - :sg_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SG_UEN = - T.let( - :sg_uen, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SI_TIN = - T.let( - :si_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ZA_VAT = - T.let( - :za_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KR_BRN = - T.let( - :kr_brn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ES_CIF = - T.let( - :es_cif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CH_UID = - T.let( - :ch_uid, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CH_VAT = - T.let( - :ch_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TW_VAT = - T.let( - :tw_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TJ_TIN = - T.let( - :tj_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TZ_VAT = - T.let( - :tz_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TH_VAT = - T.let( - :th_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TR_TIN = - T.let( - :tr_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UG_TIN = - T.let( - :ug_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UA_VAT = - T.let( - :ua_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AE_TRN = - T.let( - :ae_trn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - US_EIN = - T.let( - :us_ein, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UY_RUC = - T.let( - :uy_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UZ_TIN = - T.let( - :uz_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UZ_VAT = - T.let( - :uz_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - VE_RIF = - T.let( - :ve_rif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - VN_TIN = - T.let( - :vn_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ZM_TIN = - T.let( - :zm_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ZW_TIN = - T.let( - :zw_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SR_FIN = - T.let( - :sr_fin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - XI_VAT = - T.let( - :xi_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ] - ) - end - def self.values - end - end end class LineItem < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem, WhopSDK::Internal::AnyHash ) end @@ -1441,11 +863,11 @@ module WhopSDK end end - class CreateInvoiceInputWithProductAndEmailAddress < WhopSDK::Internal::Type::BaseModel + class CreateInvoiceInputWithProductID < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID, WhopSDK::Internal::AnyHash ) end @@ -1459,20 +881,11 @@ module WhopSDK sig { returns(String) } attr_accessor :company_id - # The date by which the invoice must be paid. - sig { returns(Time) } - attr_accessor :due_date - - # The email address of the customer. Required when creating an invoice for a - # customer who is not yet a member of the company. - sig { returns(String) } - attr_accessor :email_address - # The plan attributes defining the price, currency, and billing interval for this # invoice. sig do returns( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan ) end attr_reader :plan @@ -1480,27 +893,14 @@ module WhopSDK sig do params( plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::OrHash ).void end attr_writer :plan - # The properties of the product to create for this invoice. Provide this to create - # a new product inline. - sig do - returns( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product - ) - end - attr_reader :product - - sig do - params( - product: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product::OrHash - ).void - end - attr_writer :product + # The unique identifier of an existing product to create this invoice for. + sig { returns(String) } + attr_accessor :product_id # The date and time when the invoice will be automatically finalized and charged. # Only valid when collection_method is charge_automatically. If not provided, the @@ -1513,7 +913,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress ) ) end @@ -1523,7 +923,7 @@ module WhopSDK params( billing_address: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress::OrHash ) ).void end @@ -1538,13 +938,23 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :customer_name + # The date by which the invoice must be paid. Required unless save_as_draft is + # true. + sig { returns(T.nilable(Time)) } + attr_accessor :due_date + + # The email address of the customer. Required when creating an invoice for a + # customer who is not yet a member of the company. + sig { returns(T.nilable(String)) } + attr_accessor :email_address + # Optional line items that break down the invoice total. When provided, the sum of # (quantity \* unit_price) for all items must equal the plan price. sig do returns( T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem ] ) ) @@ -1556,6 +966,11 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :mailing_address_id + # The unique identifier of an existing member to create this invoice for. If not + # provided, you must supply an email_address and customer_name. + sig { returns(T.nilable(String)) } + attr_accessor :member_id + # The unique identifier of the payment method to charge. Required when # collection_method is charge_automatically. sig { returns(T.nilable(String)) } @@ -1566,33 +981,39 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :payment_token_id + # When true, creates the invoice as a draft without sending or charging. Relaxes + # customer and due date requirements. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :save_as_draft + # Autogenerated input type of CreateInvoice sig do params( collection_method: WhopSDK::CollectionMethod::OrSymbol, company_id: String, - due_date: Time, - email_address: String, plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::OrHash, - product: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product::OrHash, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::OrHash, + product_id: String, automatically_finalizes_at: T.nilable(Time), billing_address: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress::OrHash ), charge_buyer_fee: T.nilable(T::Boolean), customer_name: T.nilable(String), + due_date: T.nilable(Time), + email_address: T.nilable(String), line_items: T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem::OrHash ] ), mailing_address_id: T.nilable(String), + member_id: T.nilable(String), payment_method_id: T.nilable(String), - payment_token_id: T.nilable(String) + payment_token_id: T.nilable(String), + save_as_draft: T.nilable(T::Boolean) ).returns(T.attached_class) end def self.new( @@ -1601,17 +1022,11 @@ module WhopSDK collection_method:, # The unique identifier of the company to create this invoice for. company_id:, - # The date by which the invoice must be paid. - due_date:, - # The email address of the customer. Required when creating an invoice for a - # customer who is not yet a member of the company. - email_address:, # The plan attributes defining the price, currency, and billing interval for this # invoice. plan:, - # The properties of the product to create for this invoice. Provide this to create - # a new product inline. - product:, + # The unique identifier of an existing product to create this invoice for. + product_id:, # The date and time when the invoice will be automatically finalized and charged. # Only valid when collection_method is charge_automatically. If not provided, the # charge will be processed immediately. @@ -1624,18 +1039,30 @@ module WhopSDK # The name of the customer. Required when creating an invoice for a customer who # is not yet a member of the company. customer_name: nil, + # The date by which the invoice must be paid. Required unless save_as_draft is + # true. + due_date: nil, + # The email address of the customer. Required when creating an invoice for a + # customer who is not yet a member of the company. + email_address: nil, # Optional line items that break down the invoice total. When provided, the sum of # (quantity \* unit_price) for all items must equal the plan price. line_items: nil, # The unique identifier of an existing mailing address to attach to this invoice. # Cannot be used together with billing_address. mailing_address_id: nil, + # The unique identifier of an existing member to create this invoice for. If not + # provided, you must supply an email_address and customer_name. + member_id: nil, # The unique identifier of the payment method to charge. Required when # collection_method is charge_automatically. payment_method_id: nil, # The payment token ID to use for this invoice. If using charge_automatically, you # must provide a payment_token. - payment_token_id: nil + payment_token_id: nil, + # When true, creates the invoice as a draft without sending or charging. Relaxes + # customer and due date requirements. + save_as_draft: nil ) end @@ -1644,28 +1071,29 @@ module WhopSDK { collection_method: WhopSDK::CollectionMethod::OrSymbol, company_id: String, - due_date: Time, - email_address: String, plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan, - product: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan, + product_id: String, automatically_finalizes_at: T.nilable(Time), billing_address: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress ), charge_buyer_fee: T.nilable(T::Boolean), customer_name: T.nilable(String), + due_date: T.nilable(Time), + email_address: T.nilable(String), line_items: T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem ] ), mailing_address_id: T.nilable(String), + member_id: T.nilable(String), payment_method_id: T.nilable(String), - payment_token_id: T.nilable(String) + payment_token_id: T.nilable(String), + save_as_draft: T.nilable(T::Boolean) } ) end @@ -1676,7 +1104,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan, WhopSDK::Internal::AnyHash ) end @@ -1690,7 +1118,7 @@ module WhopSDK returns( T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::CustomField + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField ] ) ) @@ -1725,7 +1153,7 @@ module WhopSDK sig do returns( T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration ) ) end @@ -1735,7 +1163,7 @@ module WhopSDK params( payment_method_configuration: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration::OrHash ) ).void end @@ -1779,7 +1207,7 @@ module WhopSDK custom_fields: T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::CustomField::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField::OrHash ] ), description: T.nilable(String), @@ -1789,7 +1217,7 @@ module WhopSDK legacy_payment_method_controls: T.nilable(T::Boolean), payment_method_configuration: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration::OrHash ), plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), @@ -1847,7 +1275,7 @@ module WhopSDK custom_fields: T.nilable( T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::CustomField + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField ] ), description: T.nilable(String), @@ -1857,7 +1285,7 @@ module WhopSDK legacy_payment_method_controls: T.nilable(T::Boolean), payment_method_configuration: T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration ), plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), @@ -1876,7 +1304,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::CustomField, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField, WhopSDK::Internal::AnyHash ) end @@ -1951,7 +1379,7 @@ module WhopSDK OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration, WhopSDK::Internal::AnyHash ) end @@ -2013,2686 +1441,26 @@ module WhopSDK end end - class Product < WhopSDK::Internal::Type::BaseModel + class BillingAddress < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress, WhopSDK::Internal::AnyHash ) end - # The title of the product. - sig { returns(String) } - attr_accessor :title + # The city of the address. + sig { returns(T.nilable(String)) } + attr_accessor :city - # The ID of the product tax code to apply to this product. + # The country of the address. sig { returns(T.nilable(String)) } - attr_accessor :product_tax_code_id + attr_accessor :country - # The properties of the product to create for this invoice. Provide this to create - # a new product inline. - sig do - params( - title: String, - product_tax_code_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The title of the product. - title:, - # The ID of the product tax code to apply to this product. - product_tax_code_id: nil - ) - end - - sig do - override.returns( - { title: String, product_tax_code_id: T.nilable(String) } - ) - end - def to_hash - end - end - - class BillingAddress < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress, - WhopSDK::Internal::AnyHash - ) - end - - # The city of the address. - sig { returns(T.nilable(String)) } - attr_accessor :city - - # The country of the address. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # The line 1 of the address. - sig { returns(T.nilable(String)) } - attr_accessor :line1 - - # The line 2 of the address. - sig { returns(T.nilable(String)) } - attr_accessor :line2 - - # The name of the customer. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The phone number of the customer. - sig { returns(T.nilable(String)) } - attr_accessor :phone - - # The postal code of the address. - sig { returns(T.nilable(String)) } - attr_accessor :postal_code - - # The state of the address. - sig { returns(T.nilable(String)) } - attr_accessor :state - - # The type of tax identifier - sig do - returns( - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::OrSymbol - ) - ) - end - attr_accessor :tax_id_type - - # The value of the tax identifier. - sig { returns(T.nilable(String)) } - attr_accessor :tax_id_value - - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - sig do - params( - city: T.nilable(String), - country: T.nilable(String), - line1: T.nilable(String), - line2: T.nilable(String), - name: T.nilable(String), - phone: T.nilable(String), - postal_code: T.nilable(String), - state: T.nilable(String), - tax_id_type: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::OrSymbol - ), - tax_id_value: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The city of the address. - city: nil, - # The country of the address. - country: nil, - # The line 1 of the address. - line1: nil, - # The line 2 of the address. - line2: nil, - # The name of the customer. - name: nil, - # The phone number of the customer. - phone: nil, - # The postal code of the address. - postal_code: nil, - # The state of the address. - state: nil, - # The type of tax identifier - tax_id_type: nil, - # The value of the tax identifier. - tax_id_value: nil - ) - end - - sig do - override.returns( - { - city: T.nilable(String), - country: T.nilable(String), - line1: T.nilable(String), - line2: T.nilable(String), - name: T.nilable(String), - phone: T.nilable(String), - postal_code: T.nilable(String), - state: T.nilable(String), - tax_id_type: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::OrSymbol - ), - tax_id_value: T.nilable(String) - } - ) - end - def to_hash - end - - # The type of tax identifier - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AD_NRT = - T.let( - :ad_nrt, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AO_TIN = - T.let( - :ao_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AR_CUIT = - T.let( - :ar_cuit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AM_TIN = - T.let( - :am_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AW_TIN = - T.let( - :aw_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AU_ABN = - T.let( - :au_abn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AU_ARN = - T.let( - :au_arn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - EU_VAT = - T.let( - :eu_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AZ_TIN = - T.let( - :az_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BS_TIN = - T.let( - :bs_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BH_VAT = - T.let( - :bh_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BD_BIN = - T.let( - :bd_bin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BB_TIN = - T.let( - :bb_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BY_TIN = - T.let( - :by_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BJ_IFU = - T.let( - :bj_ifu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BO_TIN = - T.let( - :bo_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BA_TIN = - T.let( - :ba_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BR_CNPJ = - T.let( - :br_cnpj, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BR_CPF = - T.let( - :br_cpf, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BG_UIC = - T.let( - :bg_uic, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BF_IFU = - T.let( - :bf_ifu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KH_TIN = - T.let( - :kh_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CM_NIU = - T.let( - :cm_niu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_BN = - T.let( - :ca_bn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_GST_HST = - T.let( - :ca_gst_hst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_BC = - T.let( - :ca_pst_bc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_MB = - T.let( - :ca_pst_mb, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_SK = - T.let( - :ca_pst_sk, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_QST = - T.let( - :ca_qst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CV_NIF = - T.let( - :cv_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CL_TIN = - T.let( - :cl_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CN_TIN = - T.let( - :cn_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CO_NIT = - T.let( - :co_nit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CD_NIF = - T.let( - :cd_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CR_TIN = - T.let( - :cr_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - HR_OIB = - T.let( - :hr_oib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - DO_RCN = - T.let( - :do_rcn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - EC_RUC = - T.let( - :ec_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - EG_TIN = - T.let( - :eg_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SV_NIT = - T.let( - :sv_nit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ET_TIN = - T.let( - :et_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - EU_OSS_VAT = - T.let( - :eu_oss_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - GE_VAT = - T.let( - :ge_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - DE_STN = - T.let( - :de_stn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - GB_VAT = - T.let( - :gb_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - GN_NIF = - T.let( - :gn_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - HK_BR = - T.let( - :hk_br, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - HU_TIN = - T.let( - :hu_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - IS_VAT = - T.let( - :is_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - IN_GST = - T.let( - :in_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ID_NPWP = - T.let( - :id_npwp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - IL_VAT = - T.let( - :il_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_CN = - T.let( - :jp_cn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_RN = - T.let( - :jp_rn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_TRN = - T.let( - :jp_trn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KZ_BIN = - T.let( - :kz_bin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KE_PIN = - T.let( - :ke_pin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KG_TIN = - T.let( - :kg_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - LA_TIN = - T.let( - :la_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - LI_UID = - T.let( - :li_uid, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - LI_VAT = - T.let( - :li_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_FRP = - T.let( - :my_frp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_ITN = - T.let( - :my_itn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_SST = - T.let( - :my_sst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MR_NIF = - T.let( - :mr_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MX_RFC = - T.let( - :mx_rfc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MD_VAT = - T.let( - :md_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ME_PIB = - T.let( - :me_pib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MA_VAT = - T.let( - :ma_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NP_PAN = - T.let( - :np_pan, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NZ_GST = - T.let( - :nz_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NG_TIN = - T.let( - :ng_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MK_VAT = - T.let( - :mk_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NO_VAT = - T.let( - :no_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NO_VOEC = - T.let( - :no_voec, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - OM_VAT = - T.let( - :om_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - PE_RUC = - T.let( - :pe_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - PH_TIN = - T.let( - :ph_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - PL_NIP = - T.let( - :pl_nip, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - RO_TIN = - T.let( - :ro_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - RU_INN = - T.let( - :ru_inn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - RU_KPP = - T.let( - :ru_kpp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SA_VAT = - T.let( - :sa_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SN_NINEA = - T.let( - :sn_ninea, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - RS_PIB = - T.let( - :rs_pib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SG_GST = - T.let( - :sg_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SG_UEN = - T.let( - :sg_uen, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SI_TIN = - T.let( - :si_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ZA_VAT = - T.let( - :za_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KR_BRN = - T.let( - :kr_brn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ES_CIF = - T.let( - :es_cif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CH_UID = - T.let( - :ch_uid, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CH_VAT = - T.let( - :ch_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TW_VAT = - T.let( - :tw_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TJ_TIN = - T.let( - :tj_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TZ_VAT = - T.let( - :tz_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TH_VAT = - T.let( - :th_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TR_TIN = - T.let( - :tr_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UG_TIN = - T.let( - :ug_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UA_VAT = - T.let( - :ua_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AE_TRN = - T.let( - :ae_trn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - US_EIN = - T.let( - :us_ein, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UY_RUC = - T.let( - :uy_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UZ_TIN = - T.let( - :uz_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UZ_VAT = - T.let( - :uz_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - VE_RIF = - T.let( - :ve_rif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - VN_TIN = - T.let( - :vn_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ZM_TIN = - T.let( - :zm_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ZW_TIN = - T.let( - :zw_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SR_FIN = - T.let( - :sr_fin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - XI_VAT = - T.let( - :xi_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class LineItem < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem, - WhopSDK::Internal::AnyHash - ) - end - - # The label or description for this line item. - sig { returns(String) } - attr_accessor :label - - # The unit price for this line item. Provided as a number in the specified - # currency. Eg: 10.43 for $10.43 - sig { returns(Float) } - attr_accessor :unit_price - - # The quantity of this line item. Defaults to 1. - sig { returns(T.nilable(Float)) } - attr_accessor :quantity - - # A single line item to include on the invoice, with a label, quantity, and unit - # price. - sig do - params( - label: String, - unit_price: Float, - quantity: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The label or description for this line item. - label:, - # The unit price for this line item. Provided as a number in the specified - # currency. Eg: 10.43 for $10.43 - unit_price:, - # The quantity of this line item. Defaults to 1. - quantity: nil - ) - end - - sig do - override.returns( - { label: String, unit_price: Float, quantity: T.nilable(Float) } - ) - end - def to_hash - end - end - end - - class CreateInvoiceInputWithProductIDAndMemberID < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID, - WhopSDK::Internal::AnyHash - ) - end - - # How the invoice should be collected. Use charge_automatically to charge a stored - # payment method, or send_invoice to email the customer. - sig { returns(WhopSDK::CollectionMethod::OrSymbol) } - attr_accessor :collection_method - - # The unique identifier of the company to create this invoice for. - sig { returns(String) } - attr_accessor :company_id - - # The date by which the invoice must be paid. - sig { returns(Time) } - attr_accessor :due_date - - # The unique identifier of an existing member to create this invoice for. If not - # provided, you must supply an email_address and customer_name. - sig { returns(String) } - attr_accessor :member_id - - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - sig do - returns( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan - ) - end - attr_reader :plan - - sig do - params( - plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::OrHash - ).void - end - attr_writer :plan - - # The unique identifier of an existing product to create this invoice for. - sig { returns(String) } - attr_accessor :product_id - - # The date and time when the invoice will be automatically finalized and charged. - # Only valid when collection_method is charge_automatically. If not provided, the - # charge will be processed immediately. - sig { returns(T.nilable(Time)) } - attr_accessor :automatically_finalizes_at - - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - sig do - returns( - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress - ) - ) - end - attr_reader :billing_address - - sig do - params( - billing_address: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::OrHash - ) - ).void - end - attr_writer :billing_address - - # Whether to charge the customer a buyer fee on this invoice. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :charge_buyer_fee - - # The name of the customer. Required when creating an invoice for a customer who - # is not yet a member of the company. - sig { returns(T.nilable(String)) } - attr_accessor :customer_name - - # Optional line items that break down the invoice total. When provided, the sum of - # (quantity \* unit_price) for all items must equal the plan price. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem - ] - ) - ) - end - attr_accessor :line_items - - # The unique identifier of an existing mailing address to attach to this invoice. - # Cannot be used together with billing_address. - sig { returns(T.nilable(String)) } - attr_accessor :mailing_address_id - - # The unique identifier of the payment method to charge. Required when - # collection_method is charge_automatically. - sig { returns(T.nilable(String)) } - attr_accessor :payment_method_id - - # The payment token ID to use for this invoice. If using charge_automatically, you - # must provide a payment_token. - sig { returns(T.nilable(String)) } - attr_accessor :payment_token_id - - # Autogenerated input type of CreateInvoice - sig do - params( - collection_method: WhopSDK::CollectionMethod::OrSymbol, - company_id: String, - due_date: Time, - member_id: String, - plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::OrHash, - product_id: String, - automatically_finalizes_at: T.nilable(Time), - billing_address: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::OrHash - ), - charge_buyer_fee: T.nilable(T::Boolean), - customer_name: T.nilable(String), - line_items: - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem::OrHash - ] - ), - mailing_address_id: T.nilable(String), - payment_method_id: T.nilable(String), - payment_token_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # How the invoice should be collected. Use charge_automatically to charge a stored - # payment method, or send_invoice to email the customer. - collection_method:, - # The unique identifier of the company to create this invoice for. - company_id:, - # The date by which the invoice must be paid. - due_date:, - # The unique identifier of an existing member to create this invoice for. If not - # provided, you must supply an email_address and customer_name. - member_id:, - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - plan:, - # The unique identifier of an existing product to create this invoice for. - product_id:, - # The date and time when the invoice will be automatically finalized and charged. - # Only valid when collection_method is charge_automatically. If not provided, the - # charge will be processed immediately. - automatically_finalizes_at: nil, - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - billing_address: nil, - # Whether to charge the customer a buyer fee on this invoice. - charge_buyer_fee: nil, - # The name of the customer. Required when creating an invoice for a customer who - # is not yet a member of the company. - customer_name: nil, - # Optional line items that break down the invoice total. When provided, the sum of - # (quantity \* unit_price) for all items must equal the plan price. - line_items: nil, - # The unique identifier of an existing mailing address to attach to this invoice. - # Cannot be used together with billing_address. - mailing_address_id: nil, - # The unique identifier of the payment method to charge. Required when - # collection_method is charge_automatically. - payment_method_id: nil, - # The payment token ID to use for this invoice. If using charge_automatically, you - # must provide a payment_token. - payment_token_id: nil - ) - end - - sig do - override.returns( - { - collection_method: WhopSDK::CollectionMethod::OrSymbol, - company_id: String, - due_date: Time, - member_id: String, - plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan, - product_id: String, - automatically_finalizes_at: T.nilable(Time), - billing_address: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress - ), - charge_buyer_fee: T.nilable(T::Boolean), - customer_name: T.nilable(String), - line_items: - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem - ] - ), - mailing_address_id: T.nilable(String), - payment_method_id: T.nilable(String), - payment_token_id: T.nilable(String) - } - ) - end - def to_hash - end - - class Plan < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan, - WhopSDK::Internal::AnyHash - ) - end - - # The interval in days at which the plan charges (renewal plans). - sig { returns(T.nilable(Integer)) } - attr_accessor :billing_period - - # An array of custom field objects. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::CustomField - ] - ) - ) - end - attr_accessor :custom_fields - - # The description of the plan. - sig { returns(T.nilable(String)) } - attr_accessor :description - - # The number of days until the membership expires and revokes access (expiration - # plans). For example, 365 for a one-year access period. - sig { returns(T.nilable(Integer)) } - attr_accessor :expiration_days - - # An additional amount charged upon first purchase. Use only if a one time payment - # OR you want to charge an additional amount on top of the renewal price. Provided - # as a number in the specified currency. Eg: 10.43 for $10.43 - sig { returns(T.nilable(Float)) } - attr_accessor :initial_price - - # A personal description or notes section for the business. - sig { returns(T.nilable(String)) } - attr_accessor :internal_notes - - # Whether this plan uses legacy payment method controls - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :legacy_payment_method_controls - - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - sig do - returns( - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration - ) - ) - end - attr_reader :payment_method_configuration - - sig do - params( - payment_method_configuration: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration::OrHash - ) - ).void - end - attr_writer :payment_method_configuration - - # The type of plan that can be attached to a product - sig { returns(T.nilable(WhopSDK::PlanType::OrSymbol)) } - attr_accessor :plan_type - - # The methods of how a plan can be released. - sig { returns(T.nilable(WhopSDK::ReleaseMethod::OrSymbol)) } - attr_accessor :release_method - - # The amount the customer is charged every billing period. Use only if a recurring - # payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43 - sig { returns(T.nilable(Float)) } - attr_accessor :renewal_price - - # The number of units available for purchase. - sig { returns(T.nilable(Integer)) } - attr_accessor :stock - - # The number of free trial days added before a renewal plan. - sig { returns(T.nilable(Integer)) } - attr_accessor :trial_period_days - - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :unlimited_stock - - # Visibility of a resource - sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } - attr_accessor :visibility - - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - sig do - params( - billing_period: T.nilable(Integer), - custom_fields: - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::CustomField::OrHash - ] - ), - description: T.nilable(String), - expiration_days: T.nilable(Integer), - initial_price: T.nilable(Float), - internal_notes: T.nilable(String), - legacy_payment_method_controls: T.nilable(T::Boolean), - payment_method_configuration: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration::OrHash - ), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), - renewal_price: T.nilable(Float), - stock: T.nilable(Integer), - trial_period_days: T.nilable(Integer), - unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - ).returns(T.attached_class) - end - def self.new( - # The interval in days at which the plan charges (renewal plans). - billing_period: nil, - # An array of custom field objects. - custom_fields: nil, - # The description of the plan. - description: nil, - # The number of days until the membership expires and revokes access (expiration - # plans). For example, 365 for a one-year access period. - expiration_days: nil, - # An additional amount charged upon first purchase. Use only if a one time payment - # OR you want to charge an additional amount on top of the renewal price. Provided - # as a number in the specified currency. Eg: 10.43 for $10.43 - initial_price: nil, - # A personal description or notes section for the business. - internal_notes: nil, - # Whether this plan uses legacy payment method controls - legacy_payment_method_controls: nil, - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - payment_method_configuration: nil, - # The type of plan that can be attached to a product - plan_type: nil, - # The methods of how a plan can be released. - release_method: nil, - # The amount the customer is charged every billing period. Use only if a recurring - # payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43 - renewal_price: nil, - # The number of units available for purchase. - stock: nil, - # The number of free trial days added before a renewal plan. - trial_period_days: nil, - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. - unlimited_stock: nil, - # Visibility of a resource - visibility: nil - ) - end - - sig do - override.returns( - { - billing_period: T.nilable(Integer), - custom_fields: - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::CustomField - ] - ), - description: T.nilable(String), - expiration_days: T.nilable(Integer), - initial_price: T.nilable(Float), - internal_notes: T.nilable(String), - legacy_payment_method_controls: T.nilable(T::Boolean), - payment_method_configuration: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration - ), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), - renewal_price: T.nilable(Float), - stock: T.nilable(Integer), - trial_period_days: T.nilable(Integer), - unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - } - ) - end - def to_hash - end - - class CustomField < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::CustomField, - WhopSDK::Internal::AnyHash - ) - end - - # The type of the custom field. - sig { returns(Symbol) } - attr_accessor :field_type - - # The name of the custom field. - sig { returns(String) } - attr_accessor :name - - # The ID of the custom field (if being updated) - sig { returns(T.nilable(String)) } - attr_accessor :id - - # The order of the field. - sig { returns(T.nilable(Integer)) } - attr_accessor :order - - # The placeholder value of the field. - sig { returns(T.nilable(String)) } - attr_accessor :placeholder - - # Whether or not the field is required. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :required - - sig do - params( - name: String, - id: T.nilable(String), - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T.nilable(T::Boolean), - field_type: Symbol - ).returns(T.attached_class) - end - def self.new( - # The name of the custom field. - name:, - # The ID of the custom field (if being updated) - id: nil, - # The order of the field. - order: nil, - # The placeholder value of the field. - placeholder: nil, - # Whether or not the field is required. - required: nil, - # The type of the custom field. - field_type: :text - ) - end - - sig do - override.returns( - { - field_type: Symbol, - name: String, - id: T.nilable(String), - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration, - WhopSDK::Internal::AnyHash - ) - end - - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } - attr_accessor :disabled - - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } - attr_accessor :enabled - - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - sig { returns(T::Boolean) } - attr_accessor :include_platform_defaults - - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - sig do - params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - disabled:, - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - enabled:, - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - include_platform_defaults: - ) - end - - sig do - override.returns( - { - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T::Boolean - } - ) - end - def to_hash - end - end - end - - class BillingAddress < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress, - WhopSDK::Internal::AnyHash - ) - end - - # The city of the address. - sig { returns(T.nilable(String)) } - attr_accessor :city - - # The country of the address. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # The line 1 of the address. - sig { returns(T.nilable(String)) } - attr_accessor :line1 - - # The line 2 of the address. - sig { returns(T.nilable(String)) } - attr_accessor :line2 - - # The name of the customer. - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The phone number of the customer. - sig { returns(T.nilable(String)) } - attr_accessor :phone - - # The postal code of the address. - sig { returns(T.nilable(String)) } - attr_accessor :postal_code - - # The state of the address. - sig { returns(T.nilable(String)) } - attr_accessor :state - - # The type of tax identifier - sig do - returns( - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::OrSymbol - ) - ) - end - attr_accessor :tax_id_type - - # The value of the tax identifier. - sig { returns(T.nilable(String)) } - attr_accessor :tax_id_value - - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - sig do - params( - city: T.nilable(String), - country: T.nilable(String), - line1: T.nilable(String), - line2: T.nilable(String), - name: T.nilable(String), - phone: T.nilable(String), - postal_code: T.nilable(String), - state: T.nilable(String), - tax_id_type: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::OrSymbol - ), - tax_id_value: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The city of the address. - city: nil, - # The country of the address. - country: nil, - # The line 1 of the address. - line1: nil, - # The line 2 of the address. - line2: nil, - # The name of the customer. - name: nil, - # The phone number of the customer. - phone: nil, - # The postal code of the address. - postal_code: nil, - # The state of the address. - state: nil, - # The type of tax identifier - tax_id_type: nil, - # The value of the tax identifier. - tax_id_value: nil - ) - end - - sig do - override.returns( - { - city: T.nilable(String), - country: T.nilable(String), - line1: T.nilable(String), - line2: T.nilable(String), - name: T.nilable(String), - phone: T.nilable(String), - postal_code: T.nilable(String), - state: T.nilable(String), - tax_id_type: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::OrSymbol - ), - tax_id_value: T.nilable(String) - } - ) - end - def to_hash - end - - # The type of tax identifier - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AD_NRT = - T.let( - :ad_nrt, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AO_TIN = - T.let( - :ao_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AR_CUIT = - T.let( - :ar_cuit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AM_TIN = - T.let( - :am_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AW_TIN = - T.let( - :aw_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AU_ABN = - T.let( - :au_abn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AU_ARN = - T.let( - :au_arn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - EU_VAT = - T.let( - :eu_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AZ_TIN = - T.let( - :az_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BS_TIN = - T.let( - :bs_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BH_VAT = - T.let( - :bh_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BD_BIN = - T.let( - :bd_bin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BB_TIN = - T.let( - :bb_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BY_TIN = - T.let( - :by_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BJ_IFU = - T.let( - :bj_ifu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BO_TIN = - T.let( - :bo_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BA_TIN = - T.let( - :ba_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BR_CNPJ = - T.let( - :br_cnpj, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BR_CPF = - T.let( - :br_cpf, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BG_UIC = - T.let( - :bg_uic, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - BF_IFU = - T.let( - :bf_ifu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KH_TIN = - T.let( - :kh_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CM_NIU = - T.let( - :cm_niu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_BN = - T.let( - :ca_bn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_GST_HST = - T.let( - :ca_gst_hst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_BC = - T.let( - :ca_pst_bc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_MB = - T.let( - :ca_pst_mb, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_SK = - T.let( - :ca_pst_sk, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_QST = - T.let( - :ca_qst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CV_NIF = - T.let( - :cv_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CL_TIN = - T.let( - :cl_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CN_TIN = - T.let( - :cn_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CO_NIT = - T.let( - :co_nit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CD_NIF = - T.let( - :cd_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CR_TIN = - T.let( - :cr_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - HR_OIB = - T.let( - :hr_oib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - DO_RCN = - T.let( - :do_rcn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - EC_RUC = - T.let( - :ec_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - EG_TIN = - T.let( - :eg_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SV_NIT = - T.let( - :sv_nit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ET_TIN = - T.let( - :et_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - EU_OSS_VAT = - T.let( - :eu_oss_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - GE_VAT = - T.let( - :ge_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - DE_STN = - T.let( - :de_stn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - GB_VAT = - T.let( - :gb_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - GN_NIF = - T.let( - :gn_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - HK_BR = - T.let( - :hk_br, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - HU_TIN = - T.let( - :hu_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - IS_VAT = - T.let( - :is_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - IN_GST = - T.let( - :in_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ID_NPWP = - T.let( - :id_npwp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - IL_VAT = - T.let( - :il_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_CN = - T.let( - :jp_cn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_RN = - T.let( - :jp_rn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_TRN = - T.let( - :jp_trn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KZ_BIN = - T.let( - :kz_bin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KE_PIN = - T.let( - :ke_pin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KG_TIN = - T.let( - :kg_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - LA_TIN = - T.let( - :la_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - LI_UID = - T.let( - :li_uid, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - LI_VAT = - T.let( - :li_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_FRP = - T.let( - :my_frp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_ITN = - T.let( - :my_itn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_SST = - T.let( - :my_sst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MR_NIF = - T.let( - :mr_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MX_RFC = - T.let( - :mx_rfc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MD_VAT = - T.let( - :md_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ME_PIB = - T.let( - :me_pib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MA_VAT = - T.let( - :ma_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NP_PAN = - T.let( - :np_pan, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NZ_GST = - T.let( - :nz_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NG_TIN = - T.let( - :ng_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - MK_VAT = - T.let( - :mk_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NO_VAT = - T.let( - :no_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - NO_VOEC = - T.let( - :no_voec, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - OM_VAT = - T.let( - :om_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - PE_RUC = - T.let( - :pe_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - PH_TIN = - T.let( - :ph_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - PL_NIP = - T.let( - :pl_nip, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - RO_TIN = - T.let( - :ro_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - RU_INN = - T.let( - :ru_inn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - RU_KPP = - T.let( - :ru_kpp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SA_VAT = - T.let( - :sa_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SN_NINEA = - T.let( - :sn_ninea, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - RS_PIB = - T.let( - :rs_pib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SG_GST = - T.let( - :sg_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SG_UEN = - T.let( - :sg_uen, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SI_TIN = - T.let( - :si_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ZA_VAT = - T.let( - :za_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - KR_BRN = - T.let( - :kr_brn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ES_CIF = - T.let( - :es_cif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CH_UID = - T.let( - :ch_uid, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - CH_VAT = - T.let( - :ch_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TW_VAT = - T.let( - :tw_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TJ_TIN = - T.let( - :tj_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TZ_VAT = - T.let( - :tz_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TH_VAT = - T.let( - :th_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - TR_TIN = - T.let( - :tr_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UG_TIN = - T.let( - :ug_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UA_VAT = - T.let( - :ua_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - AE_TRN = - T.let( - :ae_trn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - US_EIN = - T.let( - :us_ein, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UY_RUC = - T.let( - :uy_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UZ_TIN = - T.let( - :uz_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - UZ_VAT = - T.let( - :uz_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - VE_RIF = - T.let( - :ve_rif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - VN_TIN = - T.let( - :vn_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ZM_TIN = - T.let( - :zm_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - ZW_TIN = - T.let( - :zw_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - SR_FIN = - T.let( - :sr_fin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - XI_VAT = - T.let( - :xi_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::TaxIDType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class LineItem < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem, - WhopSDK::Internal::AnyHash - ) - end - - # The label or description for this line item. - sig { returns(String) } - attr_accessor :label - - # The unit price for this line item. Provided as a number in the specified - # currency. Eg: 10.43 for $10.43 - sig { returns(Float) } - attr_accessor :unit_price - - # The quantity of this line item. Defaults to 1. - sig { returns(T.nilable(Float)) } - attr_accessor :quantity - - # A single line item to include on the invoice, with a label, quantity, and unit - # price. - sig do - params( - label: String, - unit_price: Float, - quantity: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The label or description for this line item. - label:, - # The unit price for this line item. Provided as a number in the specified - # currency. Eg: 10.43 for $10.43 - unit_price:, - # The quantity of this line item. Defaults to 1. - quantity: nil - ) - end - - sig do - override.returns( - { label: String, unit_price: Float, quantity: T.nilable(Float) } - ) - end - def to_hash - end - end - end - - class CreateInvoiceInputWithProductIDAndEmailAddress < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress, - WhopSDK::Internal::AnyHash - ) - end - - # How the invoice should be collected. Use charge_automatically to charge a stored - # payment method, or send_invoice to email the customer. - sig { returns(WhopSDK::CollectionMethod::OrSymbol) } - attr_accessor :collection_method - - # The unique identifier of the company to create this invoice for. - sig { returns(String) } - attr_accessor :company_id - - # The date by which the invoice must be paid. - sig { returns(Time) } - attr_accessor :due_date - - # The email address of the customer. Required when creating an invoice for a - # customer who is not yet a member of the company. - sig { returns(String) } - attr_accessor :email_address - - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - sig do - returns( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan - ) - end - attr_reader :plan - - sig do - params( - plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::OrHash - ).void - end - attr_writer :plan - - # The unique identifier of an existing product to create this invoice for. - sig { returns(String) } - attr_accessor :product_id - - # The date and time when the invoice will be automatically finalized and charged. - # Only valid when collection_method is charge_automatically. If not provided, the - # charge will be processed immediately. - sig { returns(T.nilable(Time)) } - attr_accessor :automatically_finalizes_at - - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - sig do - returns( - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress - ) - ) - end - attr_reader :billing_address - - sig do - params( - billing_address: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::OrHash - ) - ).void - end - attr_writer :billing_address - - # Whether to charge the customer a buyer fee on this invoice. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :charge_buyer_fee - - # The name of the customer. Required when creating an invoice for a customer who - # is not yet a member of the company. - sig { returns(T.nilable(String)) } - attr_accessor :customer_name - - # Optional line items that break down the invoice total. When provided, the sum of - # (quantity \* unit_price) for all items must equal the plan price. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem - ] - ) - ) - end - attr_accessor :line_items - - # The unique identifier of an existing mailing address to attach to this invoice. - # Cannot be used together with billing_address. - sig { returns(T.nilable(String)) } - attr_accessor :mailing_address_id - - # The unique identifier of the payment method to charge. Required when - # collection_method is charge_automatically. - sig { returns(T.nilable(String)) } - attr_accessor :payment_method_id - - # The payment token ID to use for this invoice. If using charge_automatically, you - # must provide a payment_token. - sig { returns(T.nilable(String)) } - attr_accessor :payment_token_id - - # Autogenerated input type of CreateInvoice - sig do - params( - collection_method: WhopSDK::CollectionMethod::OrSymbol, - company_id: String, - due_date: Time, - email_address: String, - plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::OrHash, - product_id: String, - automatically_finalizes_at: T.nilable(Time), - billing_address: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::OrHash - ), - charge_buyer_fee: T.nilable(T::Boolean), - customer_name: T.nilable(String), - line_items: - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem::OrHash - ] - ), - mailing_address_id: T.nilable(String), - payment_method_id: T.nilable(String), - payment_token_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # How the invoice should be collected. Use charge_automatically to charge a stored - # payment method, or send_invoice to email the customer. - collection_method:, - # The unique identifier of the company to create this invoice for. - company_id:, - # The date by which the invoice must be paid. - due_date:, - # The email address of the customer. Required when creating an invoice for a - # customer who is not yet a member of the company. - email_address:, - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - plan:, - # The unique identifier of an existing product to create this invoice for. - product_id:, - # The date and time when the invoice will be automatically finalized and charged. - # Only valid when collection_method is charge_automatically. If not provided, the - # charge will be processed immediately. - automatically_finalizes_at: nil, - # Inline billing address to create a new mailing address for this invoice. Cannot - # be used together with mailing_address_id. - billing_address: nil, - # Whether to charge the customer a buyer fee on this invoice. - charge_buyer_fee: nil, - # The name of the customer. Required when creating an invoice for a customer who - # is not yet a member of the company. - customer_name: nil, - # Optional line items that break down the invoice total. When provided, the sum of - # (quantity \* unit_price) for all items must equal the plan price. - line_items: nil, - # The unique identifier of an existing mailing address to attach to this invoice. - # Cannot be used together with billing_address. - mailing_address_id: nil, - # The unique identifier of the payment method to charge. Required when - # collection_method is charge_automatically. - payment_method_id: nil, - # The payment token ID to use for this invoice. If using charge_automatically, you - # must provide a payment_token. - payment_token_id: nil - ) - end - - sig do - override.returns( - { - collection_method: WhopSDK::CollectionMethod::OrSymbol, - company_id: String, - due_date: Time, - email_address: String, - plan: - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan, - product_id: String, - automatically_finalizes_at: T.nilable(Time), - billing_address: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress - ), - charge_buyer_fee: T.nilable(T::Boolean), - customer_name: T.nilable(String), - line_items: - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem - ] - ), - mailing_address_id: T.nilable(String), - payment_method_id: T.nilable(String), - payment_token_id: T.nilable(String) - } - ) - end - def to_hash - end - - class Plan < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan, - WhopSDK::Internal::AnyHash - ) - end - - # The interval in days at which the plan charges (renewal plans). - sig { returns(T.nilable(Integer)) } - attr_accessor :billing_period - - # An array of custom field objects. - sig do - returns( - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::CustomField - ] - ) - ) - end - attr_accessor :custom_fields - - # The description of the plan. - sig { returns(T.nilable(String)) } - attr_accessor :description - - # The number of days until the membership expires and revokes access (expiration - # plans). For example, 365 for a one-year access period. - sig { returns(T.nilable(Integer)) } - attr_accessor :expiration_days - - # An additional amount charged upon first purchase. Use only if a one time payment - # OR you want to charge an additional amount on top of the renewal price. Provided - # as a number in the specified currency. Eg: 10.43 for $10.43 - sig { returns(T.nilable(Float)) } - attr_accessor :initial_price - - # A personal description or notes section for the business. - sig { returns(T.nilable(String)) } - attr_accessor :internal_notes - - # Whether this plan uses legacy payment method controls - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :legacy_payment_method_controls - - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - sig do - returns( - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration - ) - ) - end - attr_reader :payment_method_configuration - - sig do - params( - payment_method_configuration: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration::OrHash - ) - ).void - end - attr_writer :payment_method_configuration - - # The type of plan that can be attached to a product - sig { returns(T.nilable(WhopSDK::PlanType::OrSymbol)) } - attr_accessor :plan_type - - # The methods of how a plan can be released. - sig { returns(T.nilable(WhopSDK::ReleaseMethod::OrSymbol)) } - attr_accessor :release_method - - # The amount the customer is charged every billing period. Use only if a recurring - # payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43 - sig { returns(T.nilable(Float)) } - attr_accessor :renewal_price - - # The number of units available for purchase. - sig { returns(T.nilable(Integer)) } - attr_accessor :stock - - # The number of free trial days added before a renewal plan. - sig { returns(T.nilable(Integer)) } - attr_accessor :trial_period_days - - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :unlimited_stock - - # Visibility of a resource - sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } - attr_accessor :visibility - - # The plan attributes defining the price, currency, and billing interval for this - # invoice. - sig do - params( - billing_period: T.nilable(Integer), - custom_fields: - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::CustomField::OrHash - ] - ), - description: T.nilable(String), - expiration_days: T.nilable(Integer), - initial_price: T.nilable(Float), - internal_notes: T.nilable(String), - legacy_payment_method_controls: T.nilable(T::Boolean), - payment_method_configuration: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration::OrHash - ), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), - renewal_price: T.nilable(Float), - stock: T.nilable(Integer), - trial_period_days: T.nilable(Integer), - unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - ).returns(T.attached_class) - end - def self.new( - # The interval in days at which the plan charges (renewal plans). - billing_period: nil, - # An array of custom field objects. - custom_fields: nil, - # The description of the plan. - description: nil, - # The number of days until the membership expires and revokes access (expiration - # plans). For example, 365 for a one-year access period. - expiration_days: nil, - # An additional amount charged upon first purchase. Use only if a one time payment - # OR you want to charge an additional amount on top of the renewal price. Provided - # as a number in the specified currency. Eg: 10.43 for $10.43 - initial_price: nil, - # A personal description or notes section for the business. - internal_notes: nil, - # Whether this plan uses legacy payment method controls - legacy_payment_method_controls: nil, - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - payment_method_configuration: nil, - # The type of plan that can be attached to a product - plan_type: nil, - # The methods of how a plan can be released. - release_method: nil, - # The amount the customer is charged every billing period. Use only if a recurring - # payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43 - renewal_price: nil, - # The number of units available for purchase. - stock: nil, - # The number of free trial days added before a renewal plan. - trial_period_days: nil, - # When true, the plan has unlimited stock (stock field is ignored). When false, - # purchases are limited by the stock field. - unlimited_stock: nil, - # Visibility of a resource - visibility: nil - ) - end - - sig do - override.returns( - { - billing_period: T.nilable(Integer), - custom_fields: - T.nilable( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::CustomField - ] - ), - description: T.nilable(String), - expiration_days: T.nilable(Integer), - initial_price: T.nilable(Float), - internal_notes: T.nilable(String), - legacy_payment_method_controls: T.nilable(T::Boolean), - payment_method_configuration: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration - ), - plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), - release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), - renewal_price: T.nilable(Float), - stock: T.nilable(Integer), - trial_period_days: T.nilable(Integer), - unlimited_stock: T.nilable(T::Boolean), - visibility: T.nilable(WhopSDK::Visibility::OrSymbol) - } - ) - end - def to_hash - end - - class CustomField < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::CustomField, - WhopSDK::Internal::AnyHash - ) - end - - # The type of the custom field. - sig { returns(Symbol) } - attr_accessor :field_type - - # The name of the custom field. - sig { returns(String) } - attr_accessor :name - - # The ID of the custom field (if being updated) - sig { returns(T.nilable(String)) } - attr_accessor :id - - # The order of the field. - sig { returns(T.nilable(Integer)) } - attr_accessor :order - - # The placeholder value of the field. - sig { returns(T.nilable(String)) } - attr_accessor :placeholder - - # Whether or not the field is required. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :required - - sig do - params( - name: String, - id: T.nilable(String), - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T.nilable(T::Boolean), - field_type: Symbol - ).returns(T.attached_class) - end - def self.new( - # The name of the custom field. - name:, - # The ID of the custom field (if being updated) - id: nil, - # The order of the field. - order: nil, - # The placeholder value of the field. - placeholder: nil, - # Whether or not the field is required. - required: nil, - # The type of the custom field. - field_type: :text - ) - end - - sig do - override.returns( - { - field_type: Symbol, - name: String, - id: T.nilable(String), - order: T.nilable(Integer), - placeholder: T.nilable(String), - required: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration, - WhopSDK::Internal::AnyHash - ) - end - - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } - attr_accessor :disabled - - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } - attr_accessor :enabled - - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - sig { returns(T::Boolean) } - attr_accessor :include_platform_defaults - - # The explicit payment method configuration for the plan. If not provided, the - # platform or company's defaults will apply. - sig do - params( - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # An array of payment method identifiers that are explicitly disabled. Only - # applies if the include_platform_defaults is true. - disabled:, - # An array of payment method identifiers that are explicitly enabled. This means - # these payment methods will be shown on checkout. Example use case is to only - # enable a specific payment method like cashapp, or extending the platform - # defaults with additional methods. - enabled:, - # Whether Whop's platform default payment method enablement settings are included - # in this configuration. The full list of default payment methods can be found in - # the documentation at docs.whop.com/payments. - include_platform_defaults: - ) - end - - sig do - override.returns( - { - disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], - include_platform_defaults: T::Boolean - } - ) - end - def to_hash - end - end - end - - class BillingAddress < WhopSDK::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress, - WhopSDK::Internal::AnyHash - ) - end - - # The city of the address. - sig { returns(T.nilable(String)) } - attr_accessor :city - - # The country of the address. - sig { returns(T.nilable(String)) } - attr_accessor :country - - # The line 1 of the address. - sig { returns(T.nilable(String)) } - attr_accessor :line1 + # The line 1 of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line1 # The line 2 of the address. sig { returns(T.nilable(String)) } @@ -4715,13 +1483,7 @@ module WhopSDK attr_accessor :state # The type of tax identifier - sig do - returns( - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::OrSymbol - ) - ) - end + sig { returns(T.nilable(WhopSDK::TaxIdentifierType::OrSymbol)) } attr_accessor :tax_id_type # The value of the tax identifier. @@ -4740,10 +1502,7 @@ module WhopSDK phone: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String), - tax_id_type: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::OrSymbol - ), + tax_id_type: T.nilable(WhopSDK::TaxIdentifierType::OrSymbol), tax_id_value: T.nilable(String) ).returns(T.attached_class) end @@ -4782,603 +1541,20 @@ module WhopSDK phone: T.nilable(String), postal_code: T.nilable(String), state: T.nilable(String), - tax_id_type: - T.nilable( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::OrSymbol - ), + tax_id_type: T.nilable(WhopSDK::TaxIdentifierType::OrSymbol), tax_id_value: T.nilable(String) } ) end def to_hash end - - # The type of tax identifier - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AD_NRT = - T.let( - :ad_nrt, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AO_TIN = - T.let( - :ao_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AR_CUIT = - T.let( - :ar_cuit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AM_TIN = - T.let( - :am_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AW_TIN = - T.let( - :aw_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AU_ABN = - T.let( - :au_abn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AU_ARN = - T.let( - :au_arn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - EU_VAT = - T.let( - :eu_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AZ_TIN = - T.let( - :az_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BS_TIN = - T.let( - :bs_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BH_VAT = - T.let( - :bh_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BD_BIN = - T.let( - :bd_bin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BB_TIN = - T.let( - :bb_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BY_TIN = - T.let( - :by_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BJ_IFU = - T.let( - :bj_ifu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BO_TIN = - T.let( - :bo_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BA_TIN = - T.let( - :ba_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BR_CNPJ = - T.let( - :br_cnpj, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BR_CPF = - T.let( - :br_cpf, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BG_UIC = - T.let( - :bg_uic, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - BF_IFU = - T.let( - :bf_ifu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KH_TIN = - T.let( - :kh_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CM_NIU = - T.let( - :cm_niu, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_BN = - T.let( - :ca_bn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_GST_HST = - T.let( - :ca_gst_hst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_BC = - T.let( - :ca_pst_bc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_MB = - T.let( - :ca_pst_mb, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_PST_SK = - T.let( - :ca_pst_sk, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CA_QST = - T.let( - :ca_qst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CV_NIF = - T.let( - :cv_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CL_TIN = - T.let( - :cl_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CN_TIN = - T.let( - :cn_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CO_NIT = - T.let( - :co_nit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CD_NIF = - T.let( - :cd_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CR_TIN = - T.let( - :cr_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - HR_OIB = - T.let( - :hr_oib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - DO_RCN = - T.let( - :do_rcn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - EC_RUC = - T.let( - :ec_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - EG_TIN = - T.let( - :eg_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SV_NIT = - T.let( - :sv_nit, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ET_TIN = - T.let( - :et_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - EU_OSS_VAT = - T.let( - :eu_oss_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - GE_VAT = - T.let( - :ge_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - DE_STN = - T.let( - :de_stn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - GB_VAT = - T.let( - :gb_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - GN_NIF = - T.let( - :gn_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - HK_BR = - T.let( - :hk_br, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - HU_TIN = - T.let( - :hu_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - IS_VAT = - T.let( - :is_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - IN_GST = - T.let( - :in_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ID_NPWP = - T.let( - :id_npwp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - IL_VAT = - T.let( - :il_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_CN = - T.let( - :jp_cn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_RN = - T.let( - :jp_rn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - JP_TRN = - T.let( - :jp_trn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KZ_BIN = - T.let( - :kz_bin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KE_PIN = - T.let( - :ke_pin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KG_TIN = - T.let( - :kg_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - LA_TIN = - T.let( - :la_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - LI_UID = - T.let( - :li_uid, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - LI_VAT = - T.let( - :li_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_FRP = - T.let( - :my_frp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_ITN = - T.let( - :my_itn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MY_SST = - T.let( - :my_sst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MR_NIF = - T.let( - :mr_nif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MX_RFC = - T.let( - :mx_rfc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MD_VAT = - T.let( - :md_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ME_PIB = - T.let( - :me_pib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MA_VAT = - T.let( - :ma_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NP_PAN = - T.let( - :np_pan, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NZ_GST = - T.let( - :nz_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NG_TIN = - T.let( - :ng_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - MK_VAT = - T.let( - :mk_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NO_VAT = - T.let( - :no_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - NO_VOEC = - T.let( - :no_voec, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - OM_VAT = - T.let( - :om_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - PE_RUC = - T.let( - :pe_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - PH_TIN = - T.let( - :ph_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - PL_NIP = - T.let( - :pl_nip, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - RO_TIN = - T.let( - :ro_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - RU_INN = - T.let( - :ru_inn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - RU_KPP = - T.let( - :ru_kpp, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SA_VAT = - T.let( - :sa_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SN_NINEA = - T.let( - :sn_ninea, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - RS_PIB = - T.let( - :rs_pib, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SG_GST = - T.let( - :sg_gst, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SG_UEN = - T.let( - :sg_uen, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SI_TIN = - T.let( - :si_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ZA_VAT = - T.let( - :za_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - KR_BRN = - T.let( - :kr_brn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ES_CIF = - T.let( - :es_cif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CH_UID = - T.let( - :ch_uid, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - CH_VAT = - T.let( - :ch_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TW_VAT = - T.let( - :tw_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TJ_TIN = - T.let( - :tj_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TZ_VAT = - T.let( - :tz_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TH_VAT = - T.let( - :th_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - TR_TIN = - T.let( - :tr_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UG_TIN = - T.let( - :ug_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UA_VAT = - T.let( - :ua_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - AE_TRN = - T.let( - :ae_trn, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - US_EIN = - T.let( - :us_ein, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UY_RUC = - T.let( - :uy_ruc, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UZ_TIN = - T.let( - :uz_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - UZ_VAT = - T.let( - :uz_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - VE_RIF = - T.let( - :ve_rif, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - VN_TIN = - T.let( - :vn_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ZM_TIN = - T.let( - :zm_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - ZW_TIN = - T.let( - :zw_tin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - SR_FIN = - T.let( - :sr_fin, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - XI_VAT = - T.let( - :xi_vat, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::TaxIDType::TaggedSymbol - ] - ) - end - def self.values - end - end end class LineItem < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem, WhopSDK::Internal::AnyHash ) end diff --git a/rbi/whop_sdk/models/invoice_delete_params.rbi b/rbi/whop_sdk/models/invoice_delete_params.rbi new file mode 100644 index 00000000..65bbfe2a --- /dev/null +++ b/rbi/whop_sdk/models/invoice_delete_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module WhopSDK + module Models + class InvoiceDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::InvoiceDeleteParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/invoice_delete_response.rbi b/rbi/whop_sdk/models/invoice_delete_response.rbi new file mode 100644 index 00000000..95aefdce --- /dev/null +++ b/rbi/whop_sdk/models/invoice_delete_response.rbi @@ -0,0 +1,8 @@ +# typed: strong + +module WhopSDK + module Models + InvoiceDeleteResponse = + T.let(T::Boolean, WhopSDK::Internal::Type::Converter) + end +end diff --git a/rbi/whop_sdk/models/invoice_mark_paid_params.rbi b/rbi/whop_sdk/models/invoice_mark_paid_params.rbi new file mode 100644 index 00000000..2420a18f --- /dev/null +++ b/rbi/whop_sdk/models/invoice_mark_paid_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module WhopSDK + module Models + class InvoiceMarkPaidParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::InvoiceMarkPaidParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/invoice_mark_paid_response.rbi b/rbi/whop_sdk/models/invoice_mark_paid_response.rbi new file mode 100644 index 00000000..520a4afa --- /dev/null +++ b/rbi/whop_sdk/models/invoice_mark_paid_response.rbi @@ -0,0 +1,8 @@ +# typed: strong + +module WhopSDK + module Models + InvoiceMarkPaidResponse = + T.let(T::Boolean, WhopSDK::Internal::Type::Converter) + end +end diff --git a/rbi/whop_sdk/models/invoice_mark_uncollectible_params.rbi b/rbi/whop_sdk/models/invoice_mark_uncollectible_params.rbi new file mode 100644 index 00000000..9d2ef14c --- /dev/null +++ b/rbi/whop_sdk/models/invoice_mark_uncollectible_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module WhopSDK + module Models + class InvoiceMarkUncollectibleParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::InvoiceMarkUncollectibleParams, + WhopSDK::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(id:, request_options: {}) + end + + sig do + override.returns( + { id: String, request_options: WhopSDK::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/invoice_mark_uncollectible_response.rbi b/rbi/whop_sdk/models/invoice_mark_uncollectible_response.rbi new file mode 100644 index 00000000..440e81e8 --- /dev/null +++ b/rbi/whop_sdk/models/invoice_mark_uncollectible_response.rbi @@ -0,0 +1,8 @@ +# typed: strong + +module WhopSDK + module Models + InvoiceMarkUncollectibleResponse = + T.let(T::Boolean, WhopSDK::Internal::Type::Converter) + end +end diff --git a/rbi/whop_sdk/models/invoice_update_params.rbi b/rbi/whop_sdk/models/invoice_update_params.rbi new file mode 100644 index 00000000..13036e5f --- /dev/null +++ b/rbi/whop_sdk/models/invoice_update_params.rbi @@ -0,0 +1,649 @@ +# typed: strong + +module WhopSDK + module Models + class InvoiceUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::InvoiceUpdateParams, WhopSDK::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + # The date and time when the invoice will be automatically finalized and charged. + sig { returns(T.nilable(Time)) } + attr_accessor :automatically_finalizes_at + + # Inline billing address to create or update a mailing address for this invoice. + sig { returns(T.nilable(WhopSDK::InvoiceUpdateParams::BillingAddress)) } + attr_reader :billing_address + + sig do + params( + billing_address: + T.nilable(WhopSDK::InvoiceUpdateParams::BillingAddress::OrHash) + ).void + end + attr_writer :billing_address + + # Whether to charge the customer a buyer fee on this invoice. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :charge_buyer_fee + + # The method of collection for an invoice. + sig { returns(T.nilable(WhopSDK::CollectionMethod::OrSymbol)) } + attr_accessor :collection_method + + # The name of the customer. + sig { returns(T.nilable(String)) } + attr_accessor :customer_name + + # The date by which the invoice must be paid. + sig { returns(T.nilable(Time)) } + attr_accessor :due_date + + # The email address of the customer. + sig { returns(T.nilable(String)) } + attr_accessor :email_address + + # Line items that break down the invoice total. + sig do + returns(T.nilable(T::Array[WhopSDK::InvoiceUpdateParams::LineItem])) + end + attr_accessor :line_items + + # The unique identifier of an existing mailing address to attach. + sig { returns(T.nilable(String)) } + attr_accessor :mailing_address_id + + # The unique identifier of a member to assign as the customer. + sig { returns(T.nilable(String)) } + attr_accessor :member_id + + # The unique identifier of the payment method to charge. + sig { returns(T.nilable(String)) } + attr_accessor :payment_method_id + + # Updated plan attributes. + sig { returns(T.nilable(WhopSDK::InvoiceUpdateParams::Plan)) } + attr_reader :plan + + sig do + params(plan: T.nilable(WhopSDK::InvoiceUpdateParams::Plan::OrHash)).void + end + attr_writer :plan + + sig do + params( + id: String, + automatically_finalizes_at: T.nilable(Time), + billing_address: + T.nilable(WhopSDK::InvoiceUpdateParams::BillingAddress::OrHash), + charge_buyer_fee: T.nilable(T::Boolean), + collection_method: T.nilable(WhopSDK::CollectionMethod::OrSymbol), + customer_name: T.nilable(String), + due_date: T.nilable(Time), + email_address: T.nilable(String), + line_items: + T.nilable(T::Array[WhopSDK::InvoiceUpdateParams::LineItem::OrHash]), + mailing_address_id: T.nilable(String), + member_id: T.nilable(String), + payment_method_id: T.nilable(String), + plan: T.nilable(WhopSDK::InvoiceUpdateParams::Plan::OrHash), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # The date and time when the invoice will be automatically finalized and charged. + automatically_finalizes_at: nil, + # Inline billing address to create or update a mailing address for this invoice. + billing_address: nil, + # Whether to charge the customer a buyer fee on this invoice. + charge_buyer_fee: nil, + # The method of collection for an invoice. + collection_method: nil, + # The name of the customer. + customer_name: nil, + # The date by which the invoice must be paid. + due_date: nil, + # The email address of the customer. + email_address: nil, + # Line items that break down the invoice total. + line_items: nil, + # The unique identifier of an existing mailing address to attach. + mailing_address_id: nil, + # The unique identifier of a member to assign as the customer. + member_id: nil, + # The unique identifier of the payment method to charge. + payment_method_id: nil, + # Updated plan attributes. + plan: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + id: String, + automatically_finalizes_at: T.nilable(Time), + billing_address: + T.nilable(WhopSDK::InvoiceUpdateParams::BillingAddress), + charge_buyer_fee: T.nilable(T::Boolean), + collection_method: T.nilable(WhopSDK::CollectionMethod::OrSymbol), + customer_name: T.nilable(String), + due_date: T.nilable(Time), + email_address: T.nilable(String), + line_items: + T.nilable(T::Array[WhopSDK::InvoiceUpdateParams::LineItem]), + mailing_address_id: T.nilable(String), + member_id: T.nilable(String), + payment_method_id: T.nilable(String), + plan: T.nilable(WhopSDK::InvoiceUpdateParams::Plan), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + + class BillingAddress < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::InvoiceUpdateParams::BillingAddress, + WhopSDK::Internal::AnyHash + ) + end + + # The city of the address. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # The country of the address. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # The line 1 of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line1 + + # The line 2 of the address. + sig { returns(T.nilable(String)) } + attr_accessor :line2 + + # The name of the customer. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The phone number of the customer. + sig { returns(T.nilable(String)) } + attr_accessor :phone + + # The postal code of the address. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # The state of the address. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # The type of tax identifier + sig { returns(T.nilable(WhopSDK::TaxIdentifierType::OrSymbol)) } + attr_accessor :tax_id_type + + # The value of the tax identifier. + sig { returns(T.nilable(String)) } + attr_accessor :tax_id_value + + # Inline billing address to create or update a mailing address for this invoice. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + name: T.nilable(String), + phone: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + tax_id_type: T.nilable(WhopSDK::TaxIdentifierType::OrSymbol), + tax_id_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The city of the address. + city: nil, + # The country of the address. + country: nil, + # The line 1 of the address. + line1: nil, + # The line 2 of the address. + line2: nil, + # The name of the customer. + name: nil, + # The phone number of the customer. + phone: nil, + # The postal code of the address. + postal_code: nil, + # The state of the address. + state: nil, + # The type of tax identifier + tax_id_type: nil, + # The value of the tax identifier. + tax_id_value: nil + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + name: T.nilable(String), + phone: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + tax_id_type: T.nilable(WhopSDK::TaxIdentifierType::OrSymbol), + tax_id_value: T.nilable(String) + } + ) + end + def to_hash + end + end + + class LineItem < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::InvoiceUpdateParams::LineItem, + WhopSDK::Internal::AnyHash + ) + end + + # The label or description for this line item. + sig { returns(String) } + attr_accessor :label + + # The unit price for this line item. Provided as a number in the specified + # currency. Eg: 10.43 for $10.43 + sig { returns(Float) } + attr_accessor :unit_price + + # The quantity of this line item. Defaults to 1. + sig { returns(T.nilable(Float)) } + attr_accessor :quantity + + # A single line item to include on the invoice, with a label, quantity, and unit + # price. + sig do + params( + label: String, + unit_price: Float, + quantity: T.nilable(Float) + ).returns(T.attached_class) + end + def self.new( + # The label or description for this line item. + label:, + # The unit price for this line item. Provided as a number in the specified + # currency. Eg: 10.43 for $10.43 + unit_price:, + # The quantity of this line item. Defaults to 1. + quantity: nil + ) + end + + sig do + override.returns( + { label: String, unit_price: Float, quantity: T.nilable(Float) } + ) + end + def to_hash + end + end + + class Plan < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::InvoiceUpdateParams::Plan, + WhopSDK::Internal::AnyHash + ) + end + + # The interval in days at which the plan charges (renewal plans). + sig { returns(T.nilable(Integer)) } + attr_accessor :billing_period + + # An array of custom field objects. + sig do + returns( + T.nilable(T::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]) + ) + end + attr_accessor :custom_fields + + # The description of the plan. + sig { returns(T.nilable(String)) } + attr_accessor :description + + # The number of days until the membership expires and revokes access (expiration + # plans). For example, 365 for a one-year access period. + sig { returns(T.nilable(Integer)) } + attr_accessor :expiration_days + + # An additional amount charged upon first purchase. Use only if a one time payment + # OR you want to charge an additional amount on top of the renewal price. Provided + # as a number in the specified currency. Eg: 10.43 for $10.43 + sig { returns(T.nilable(Float)) } + attr_accessor :initial_price + + # A personal description or notes section for the business. + sig { returns(T.nilable(String)) } + attr_accessor :internal_notes + + # Whether this plan uses legacy payment method controls + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :legacy_payment_method_controls + + # The explicit payment method configuration for the plan. If not provided, the + # platform or company's defaults will apply. + sig do + returns( + T.nilable( + WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration + ) + ) + end + attr_reader :payment_method_configuration + + sig do + params( + payment_method_configuration: + T.nilable( + WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration::OrHash + ) + ).void + end + attr_writer :payment_method_configuration + + # The type of plan that can be attached to a product + sig { returns(T.nilable(WhopSDK::PlanType::OrSymbol)) } + attr_accessor :plan_type + + # The methods of how a plan can be released. + sig { returns(T.nilable(WhopSDK::ReleaseMethod::OrSymbol)) } + attr_accessor :release_method + + # The amount the customer is charged every billing period. Use only if a recurring + # payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43 + sig { returns(T.nilable(Float)) } + attr_accessor :renewal_price + + # The number of units available for purchase. + sig { returns(T.nilable(Integer)) } + attr_accessor :stock + + # The number of free trial days added before a renewal plan. + sig { returns(T.nilable(Integer)) } + attr_accessor :trial_period_days + + # When true, the plan has unlimited stock (stock field is ignored). When false, + # purchases are limited by the stock field. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :unlimited_stock + + # Visibility of a resource + sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) } + attr_accessor :visibility + + # Updated plan attributes. + sig do + params( + billing_period: T.nilable(Integer), + custom_fields: + T.nilable( + T::Array[ + WhopSDK::InvoiceUpdateParams::Plan::CustomField::OrHash + ] + ), + description: T.nilable(String), + expiration_days: T.nilable(Integer), + initial_price: T.nilable(Float), + internal_notes: T.nilable(String), + legacy_payment_method_controls: T.nilable(T::Boolean), + payment_method_configuration: + T.nilable( + WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration::OrHash + ), + plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), + release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), + renewal_price: T.nilable(Float), + stock: T.nilable(Integer), + trial_period_days: T.nilable(Integer), + unlimited_stock: T.nilable(T::Boolean), + visibility: T.nilable(WhopSDK::Visibility::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # The interval in days at which the plan charges (renewal plans). + billing_period: nil, + # An array of custom field objects. + custom_fields: nil, + # The description of the plan. + description: nil, + # The number of days until the membership expires and revokes access (expiration + # plans). For example, 365 for a one-year access period. + expiration_days: nil, + # An additional amount charged upon first purchase. Use only if a one time payment + # OR you want to charge an additional amount on top of the renewal price. Provided + # as a number in the specified currency. Eg: 10.43 for $10.43 + initial_price: nil, + # A personal description or notes section for the business. + internal_notes: nil, + # Whether this plan uses legacy payment method controls + legacy_payment_method_controls: nil, + # The explicit payment method configuration for the plan. If not provided, the + # platform or company's defaults will apply. + payment_method_configuration: nil, + # The type of plan that can be attached to a product + plan_type: nil, + # The methods of how a plan can be released. + release_method: nil, + # The amount the customer is charged every billing period. Use only if a recurring + # payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43 + renewal_price: nil, + # The number of units available for purchase. + stock: nil, + # The number of free trial days added before a renewal plan. + trial_period_days: nil, + # When true, the plan has unlimited stock (stock field is ignored). When false, + # purchases are limited by the stock field. + unlimited_stock: nil, + # Visibility of a resource + visibility: nil + ) + end + + sig do + override.returns( + { + billing_period: T.nilable(Integer), + custom_fields: + T.nilable( + T::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField] + ), + description: T.nilable(String), + expiration_days: T.nilable(Integer), + initial_price: T.nilable(Float), + internal_notes: T.nilable(String), + legacy_payment_method_controls: T.nilable(T::Boolean), + payment_method_configuration: + T.nilable( + WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration + ), + plan_type: T.nilable(WhopSDK::PlanType::OrSymbol), + release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol), + renewal_price: T.nilable(Float), + stock: T.nilable(Integer), + trial_period_days: T.nilable(Integer), + unlimited_stock: T.nilable(T::Boolean), + visibility: T.nilable(WhopSDK::Visibility::OrSymbol) + } + ) + end + def to_hash + end + + class CustomField < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::InvoiceUpdateParams::Plan::CustomField, + WhopSDK::Internal::AnyHash + ) + end + + # The type of the custom field. + sig { returns(Symbol) } + attr_accessor :field_type + + # The name of the custom field. + sig { returns(String) } + attr_accessor :name + + # The ID of the custom field (if being updated) + sig { returns(T.nilable(String)) } + attr_accessor :id + + # The order of the field. + sig { returns(T.nilable(Integer)) } + attr_accessor :order + + # The placeholder value of the field. + sig { returns(T.nilable(String)) } + attr_accessor :placeholder + + # Whether or not the field is required. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :required + + sig do + params( + name: String, + id: T.nilable(String), + order: T.nilable(Integer), + placeholder: T.nilable(String), + required: T.nilable(T::Boolean), + field_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The name of the custom field. + name:, + # The ID of the custom field (if being updated) + id: nil, + # The order of the field. + order: nil, + # The placeholder value of the field. + placeholder: nil, + # Whether or not the field is required. + required: nil, + # The type of the custom field. + field_type: :text + ) + end + + sig do + override.returns( + { + field_type: Symbol, + name: String, + id: T.nilable(String), + order: T.nilable(Integer), + placeholder: T.nilable(String), + required: T.nilable(T::Boolean) + } + ) + end + def to_hash + end + end + + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration, + WhopSDK::Internal::AnyHash + ) + end + + # An array of payment method identifiers that are explicitly disabled. Only + # applies if the include_platform_defaults is true. + sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } + attr_accessor :disabled + + # An array of payment method identifiers that are explicitly enabled. This means + # these payment methods will be shown on checkout. Example use case is to only + # enable a specific payment method like cashapp, or extending the platform + # defaults with additional methods. + sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) } + attr_accessor :enabled + + # Whether Whop's platform default payment method enablement settings are included + # in this configuration. The full list of default payment methods can be found in + # the documentation at docs.whop.com/payments. + sig { returns(T::Boolean) } + attr_accessor :include_platform_defaults + + # The explicit payment method configuration for the plan. If not provided, the + # platform or company's defaults will apply. + sig do + params( + disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], + enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], + include_platform_defaults: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # An array of payment method identifiers that are explicitly disabled. Only + # applies if the include_platform_defaults is true. + disabled:, + # An array of payment method identifiers that are explicitly enabled. This means + # these payment methods will be shown on checkout. Example use case is to only + # enable a specific payment method like cashapp, or extending the platform + # defaults with additional methods. + enabled:, + # Whether Whop's platform default payment method enablement settings are included + # in this configuration. The full list of default payment methods can be found in + # the documentation at docs.whop.com/payments. + include_platform_defaults: + ) + end + + sig do + override.returns( + { + disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], + enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol], + include_platform_defaults: T::Boolean + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/membership.rbi b/rbi/whop_sdk/models/membership.rbi index b3a7b4d0..14fd49bf 100644 --- a/rbi/whop_sdk/models/membership.rbi +++ b/rbi/whop_sdk/models/membership.rbi @@ -77,7 +77,7 @@ module WhopSDK # Custom key-value pairs for the membership (commonly used for software licensing, # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. - sig { returns(T::Hash[Symbol, T.anything]) } + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata # Whether recurring payment collection for this membership is temporarily paused @@ -155,7 +155,7 @@ module WhopSDK license_key: T.nilable(String), manage_url: T.nilable(String), member: T.nilable(WhopSDK::Membership::Member::OrHash), - metadata: T::Hash[Symbol, T.anything], + metadata: T.nilable(T::Hash[Symbol, T.anything]), payment_collection_paused: T::Boolean, plan: WhopSDK::Membership::Plan::OrHash, product: WhopSDK::Membership::Product::OrHash, @@ -249,7 +249,7 @@ module WhopSDK license_key: T.nilable(String), manage_url: T.nilable(String), member: T.nilable(WhopSDK::Membership::Member), - metadata: T::Hash[Symbol, T.anything], + metadata: T.nilable(T::Hash[Symbol, T.anything]), payment_collection_paused: T::Boolean, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, diff --git a/rbi/whop_sdk/models/membership_list_response.rbi b/rbi/whop_sdk/models/membership_list_response.rbi index a26fc86d..f0c2db61 100644 --- a/rbi/whop_sdk/models/membership_list_response.rbi +++ b/rbi/whop_sdk/models/membership_list_response.rbi @@ -86,7 +86,7 @@ module WhopSDK # Custom key-value pairs for the membership (commonly used for software licensing, # e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value. - sig { returns(T::Hash[Symbol, T.anything]) } + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_accessor :metadata # Whether recurring payment collection for this membership is temporarily paused @@ -178,7 +178,7 @@ module WhopSDK manage_url: T.nilable(String), member: T.nilable(WhopSDK::Models::MembershipListResponse::Member::OrHash), - metadata: T::Hash[Symbol, T.anything], + metadata: T.nilable(T::Hash[Symbol, T.anything]), payment_collection_paused: T::Boolean, plan: WhopSDK::Models::MembershipListResponse::Plan::OrHash, product: WhopSDK::Models::MembershipListResponse::Product::OrHash, @@ -270,7 +270,7 @@ module WhopSDK license_key: T.nilable(String), manage_url: T.nilable(String), member: T.nilable(WhopSDK::Models::MembershipListResponse::Member), - metadata: T::Hash[Symbol, T.anything], + metadata: T.nilable(T::Hash[Symbol, T.anything]), payment_collection_paused: T::Boolean, plan: WhopSDK::Models::MembershipListResponse::Plan, product: WhopSDK::Models::MembershipListResponse::Product, diff --git a/rbi/whop_sdk/models/payment_method_types.rbi b/rbi/whop_sdk/models/payment_method_types.rbi index e10cde40..8f69ec8a 100644 --- a/rbi/whop_sdk/models/payment_method_types.rbi +++ b/rbi/whop_sdk/models/payment_method_types.rbi @@ -21,6 +21,8 @@ module WhopSDK AU_BECS_DEBIT = T.let(:au_becs_debit, WhopSDK::PaymentMethodTypes::TaggedSymbol) BACS_DEBIT = T.let(:bacs_debit, WhopSDK::PaymentMethodTypes::TaggedSymbol) + BANCOLOMBIA = + T.let(:bancolombia, WhopSDK::PaymentMethodTypes::TaggedSymbol) BANCONTACT = T.let(:bancontact, WhopSDK::PaymentMethodTypes::TaggedSymbol) BILLIE = T.let(:billie, WhopSDK::PaymentMethodTypes::TaggedSymbol) BIZUM = T.let(:bizum, WhopSDK::PaymentMethodTypes::TaggedSymbol) @@ -37,6 +39,7 @@ module WhopSDK CUSTOMER_BALANCE = T.let(:customer_balance, WhopSDK::PaymentMethodTypes::TaggedSymbol) DEMO_PAY = T.let(:demo_pay, WhopSDK::PaymentMethodTypes::TaggedSymbol) + EFECTY = T.let(:efecty, WhopSDK::PaymentMethodTypes::TaggedSymbol) EPS = T.let(:eps, WhopSDK::PaymentMethodTypes::TaggedSymbol) EU_BANK_TRANSFER = T.let(:eu_bank_transfer, WhopSDK::PaymentMethodTypes::TaggedSymbol) @@ -57,10 +60,13 @@ module WhopSDK KRIYA = T.let(:kriya, WhopSDK::PaymentMethodTypes::TaggedSymbol) LINK = T.let(:link, WhopSDK::PaymentMethodTypes::TaggedSymbol) MB_WAY = T.let(:mb_way, WhopSDK::PaymentMethodTypes::TaggedSymbol) + MERCADO_PAGO = + T.let(:mercado_pago, WhopSDK::PaymentMethodTypes::TaggedSymbol) MOBILEPAY = T.let(:mobilepay, WhopSDK::PaymentMethodTypes::TaggedSymbol) MONDU = T.let(:mondu, WhopSDK::PaymentMethodTypes::TaggedSymbol) MULTIBANCO = T.let(:multibanco, WhopSDK::PaymentMethodTypes::TaggedSymbol) NAVER_PAY = T.let(:naver_pay, WhopSDK::PaymentMethodTypes::TaggedSymbol) + NEQUI = T.let(:nequi, WhopSDK::PaymentMethodTypes::TaggedSymbol) NETBANKING = T.let(:netbanking, WhopSDK::PaymentMethodTypes::TaggedSymbol) NG_BANK = T.let(:ng_bank, WhopSDK::PaymentMethodTypes::TaggedSymbol) NG_BANK_TRANSFER = @@ -73,6 +79,7 @@ module WhopSDK T.let(:nz_bank_account, WhopSDK::PaymentMethodTypes::TaggedSymbol) OXXO = T.let(:oxxo, WhopSDK::PaymentMethodTypes::TaggedSymbol) P24 = T.let(:p24, WhopSDK::PaymentMethodTypes::TaggedSymbol) + PSE = T.let(:pse, WhopSDK::PaymentMethodTypes::TaggedSymbol) PAY_BY_BANK = T.let(:pay_by_bank, WhopSDK::PaymentMethodTypes::TaggedSymbol) PAYCO = T.let(:payco, WhopSDK::PaymentMethodTypes::TaggedSymbol) @@ -100,6 +107,7 @@ module WhopSDK SOFORT = T.let(:sofort, WhopSDK::PaymentMethodTypes::TaggedSymbol) SOUTH_KOREA_MARKET = T.let(:south_korea_market, WhopSDK::PaymentMethodTypes::TaggedSymbol) + SPEI = T.let(:spei, WhopSDK::PaymentMethodTypes::TaggedSymbol) SPLITIT = T.let(:splitit, WhopSDK::PaymentMethodTypes::TaggedSymbol) SUNBIT = T.let(:sunbit, WhopSDK::PaymentMethodTypes::TaggedSymbol) SWISH = T.let(:swish, WhopSDK::PaymentMethodTypes::TaggedSymbol) diff --git a/rbi/whop_sdk/models/payment_provider.rbi b/rbi/whop_sdk/models/payment_provider.rbi index 2d57e0a5..50d50733 100644 --- a/rbi/whop_sdk/models/payment_provider.rbi +++ b/rbi/whop_sdk/models/payment_provider.rbi @@ -25,6 +25,7 @@ module WhopSDK AIRWALLEX = T.let(:airwallex, WhopSDK::PaymentProvider::TaggedSymbol) COINFLOW = T.let(:coinflow, WhopSDK::PaymentProvider::TaggedSymbol) SEQURA = T.let(:sequra, WhopSDK::PaymentProvider::TaggedSymbol) + DLOCAL = T.let(:dlocal, WhopSDK::PaymentProvider::TaggedSymbol) sig { override.returns(T::Array[WhopSDK::PaymentProvider::TaggedSymbol]) } def self.values diff --git a/rbi/whop_sdk/models/plan_create_params.rbi b/rbi/whop_sdk/models/plan_create_params.rbi index 7c8410cb..af23f952 100644 --- a/rbi/whop_sdk/models/plan_create_params.rbi +++ b/rbi/whop_sdk/models/plan_create_params.rbi @@ -24,6 +24,19 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :billing_period + # Checkout styling overrides for this plan. Pass null to inherit from the company + # default. + sig { returns(T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling)) } + attr_reader :checkout_styling + + sig do + params( + checkout_styling: + T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling::OrHash) + ).void + end + attr_writer :checkout_styling + # The available currencies on the platform sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } attr_accessor :currency @@ -134,6 +147,8 @@ module WhopSDK company_id: String, product_id: String, billing_period: T.nilable(Integer), + checkout_styling: + T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling::OrHash), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField::OrHash]), @@ -168,6 +183,9 @@ module WhopSDK # The number of days between recurring charges. For example, 30 for monthly or 365 # for yearly. billing_period: nil, + # Checkout styling overrides for this plan. Pass null to inherit from the company + # default. + checkout_styling: nil, # The available currencies on the platform currency: nil, # An array of custom field definitions to collect from customers at checkout. @@ -224,6 +242,8 @@ module WhopSDK company_id: String, product_id: String, billing_period: T.nilable(Integer), + checkout_styling: + T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField]), @@ -252,6 +272,59 @@ module WhopSDK def to_hash end + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PlanCreateParams::CheckoutStyling, + WhopSDK::Internal::AnyHash + ) + end + + # The different border-radius styles available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutShape::OrSymbol)) } + attr_accessor :border_style + + # A hex color code for the button color (e.g. #FF5733). + sig { returns(T.nilable(String)) } + attr_accessor :button_color + + # The different font families available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutFont::OrSymbol)) } + attr_accessor :font_family + + # Checkout styling overrides for this plan. Pass null to inherit from the company + # default. + sig do + params( + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # The different border-radius styles available for checkout pages. + border_style: nil, + # A hex color code for the button color (e.g. #FF5733). + button_color: nil, + # The different font families available for checkout pages. + font_family: nil + ) + end + + sig do + override.returns( + { + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + } + ) + end + def to_hash + end + end + class CustomField < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/whop_sdk/models/plan_update_params.rbi b/rbi/whop_sdk/models/plan_update_params.rbi index 904313dc..369a509c 100644 --- a/rbi/whop_sdk/models/plan_update_params.rbi +++ b/rbi/whop_sdk/models/plan_update_params.rbi @@ -19,6 +19,19 @@ module WhopSDK sig { returns(T.nilable(Integer)) } attr_accessor :billing_period + # Checkout styling overrides for this plan. Pass null to remove all overrides and + # inherit from the company default. + sig { returns(T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling)) } + attr_reader :checkout_styling + + sig do + params( + checkout_styling: + T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling::OrHash) + ).void + end + attr_writer :checkout_styling + # The available currencies on the platform sig { returns(T.nilable(WhopSDK::Currency::OrSymbol)) } attr_accessor :currency @@ -128,6 +141,8 @@ module WhopSDK params( id: String, billing_period: T.nilable(Integer), + checkout_styling: + T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling::OrHash), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable(T::Array[WhopSDK::PlanUpdateParams::CustomField::OrHash]), @@ -159,6 +174,9 @@ module WhopSDK # The number of days between recurring charges. For example, 30 for monthly or 365 # for yearly. billing_period: nil, + # Checkout styling overrides for this plan. Pass null to remove all overrides and + # inherit from the company default. + checkout_styling: nil, # The available currencies on the platform currency: nil, # An array of custom field definitions to collect from customers at checkout. @@ -214,6 +232,8 @@ module WhopSDK { id: String, billing_period: T.nilable(Integer), + checkout_styling: + T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable(T::Array[WhopSDK::PlanUpdateParams::CustomField]), @@ -242,6 +262,59 @@ module WhopSDK def to_hash end + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PlanUpdateParams::CheckoutStyling, + WhopSDK::Internal::AnyHash + ) + end + + # The different border-radius styles available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutShape::OrSymbol)) } + attr_accessor :border_style + + # A hex color code for the button color (e.g. #FF5733). + sig { returns(T.nilable(String)) } + attr_accessor :button_color + + # The different font families available for checkout pages. + sig { returns(T.nilable(WhopSDK::CheckoutFont::OrSymbol)) } + attr_accessor :font_family + + # Checkout styling overrides for this plan. Pass null to remove all overrides and + # inherit from the company default. + sig do + params( + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # The different border-radius styles available for checkout pages. + border_style: nil, + # A hex color code for the button color (e.g. #FF5733). + button_color: nil, + # The different font families available for checkout pages. + font_family: nil + ) + end + + sig do + override.returns( + { + border_style: T.nilable(WhopSDK::CheckoutShape::OrSymbol), + button_color: T.nilable(String), + font_family: T.nilable(WhopSDK::CheckoutFont::OrSymbol) + } + ) + end + def to_hash + end + end + class CustomField < WhopSDK::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/whop_sdk/models/tax_identifier_type.rbi b/rbi/whop_sdk/models/tax_identifier_type.rbi new file mode 100644 index 00000000..e6fe8da7 --- /dev/null +++ b/rbi/whop_sdk/models/tax_identifier_type.rbi @@ -0,0 +1,131 @@ +# typed: strong + +module WhopSDK + module Models + # The type of tax identifier + module TaxIdentifierType + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::TaxIdentifierType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AD_NRT = T.let(:ad_nrt, WhopSDK::TaxIdentifierType::TaggedSymbol) + AO_TIN = T.let(:ao_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + AR_CUIT = T.let(:ar_cuit, WhopSDK::TaxIdentifierType::TaggedSymbol) + AM_TIN = T.let(:am_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + AW_TIN = T.let(:aw_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + AU_ABN = T.let(:au_abn, WhopSDK::TaxIdentifierType::TaggedSymbol) + AU_ARN = T.let(:au_arn, WhopSDK::TaxIdentifierType::TaggedSymbol) + EU_VAT = T.let(:eu_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + AZ_TIN = T.let(:az_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + BS_TIN = T.let(:bs_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + BH_VAT = T.let(:bh_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + BD_BIN = T.let(:bd_bin, WhopSDK::TaxIdentifierType::TaggedSymbol) + BB_TIN = T.let(:bb_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + BY_TIN = T.let(:by_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + BJ_IFU = T.let(:bj_ifu, WhopSDK::TaxIdentifierType::TaggedSymbol) + BO_TIN = T.let(:bo_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + BA_TIN = T.let(:ba_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + BR_CNPJ = T.let(:br_cnpj, WhopSDK::TaxIdentifierType::TaggedSymbol) + BR_CPF = T.let(:br_cpf, WhopSDK::TaxIdentifierType::TaggedSymbol) + BG_UIC = T.let(:bg_uic, WhopSDK::TaxIdentifierType::TaggedSymbol) + BF_IFU = T.let(:bf_ifu, WhopSDK::TaxIdentifierType::TaggedSymbol) + KH_TIN = T.let(:kh_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + CM_NIU = T.let(:cm_niu, WhopSDK::TaxIdentifierType::TaggedSymbol) + CA_BN = T.let(:ca_bn, WhopSDK::TaxIdentifierType::TaggedSymbol) + CA_GST_HST = T.let(:ca_gst_hst, WhopSDK::TaxIdentifierType::TaggedSymbol) + CA_PST_BC = T.let(:ca_pst_bc, WhopSDK::TaxIdentifierType::TaggedSymbol) + CA_PST_MB = T.let(:ca_pst_mb, WhopSDK::TaxIdentifierType::TaggedSymbol) + CA_PST_SK = T.let(:ca_pst_sk, WhopSDK::TaxIdentifierType::TaggedSymbol) + CA_QST = T.let(:ca_qst, WhopSDK::TaxIdentifierType::TaggedSymbol) + CV_NIF = T.let(:cv_nif, WhopSDK::TaxIdentifierType::TaggedSymbol) + CL_TIN = T.let(:cl_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + CN_TIN = T.let(:cn_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + CO_NIT = T.let(:co_nit, WhopSDK::TaxIdentifierType::TaggedSymbol) + CD_NIF = T.let(:cd_nif, WhopSDK::TaxIdentifierType::TaggedSymbol) + CR_TIN = T.let(:cr_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + HR_OIB = T.let(:hr_oib, WhopSDK::TaxIdentifierType::TaggedSymbol) + DO_RCN = T.let(:do_rcn, WhopSDK::TaxIdentifierType::TaggedSymbol) + EC_RUC = T.let(:ec_ruc, WhopSDK::TaxIdentifierType::TaggedSymbol) + EG_TIN = T.let(:eg_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + SV_NIT = T.let(:sv_nit, WhopSDK::TaxIdentifierType::TaggedSymbol) + ET_TIN = T.let(:et_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + EU_OSS_VAT = T.let(:eu_oss_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + GE_VAT = T.let(:ge_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + DE_STN = T.let(:de_stn, WhopSDK::TaxIdentifierType::TaggedSymbol) + GB_VAT = T.let(:gb_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + GN_NIF = T.let(:gn_nif, WhopSDK::TaxIdentifierType::TaggedSymbol) + HK_BR = T.let(:hk_br, WhopSDK::TaxIdentifierType::TaggedSymbol) + HU_TIN = T.let(:hu_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + IS_VAT = T.let(:is_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + IN_GST = T.let(:in_gst, WhopSDK::TaxIdentifierType::TaggedSymbol) + ID_NPWP = T.let(:id_npwp, WhopSDK::TaxIdentifierType::TaggedSymbol) + IL_VAT = T.let(:il_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + JP_CN = T.let(:jp_cn, WhopSDK::TaxIdentifierType::TaggedSymbol) + JP_RN = T.let(:jp_rn, WhopSDK::TaxIdentifierType::TaggedSymbol) + JP_TRN = T.let(:jp_trn, WhopSDK::TaxIdentifierType::TaggedSymbol) + KZ_BIN = T.let(:kz_bin, WhopSDK::TaxIdentifierType::TaggedSymbol) + KE_PIN = T.let(:ke_pin, WhopSDK::TaxIdentifierType::TaggedSymbol) + KG_TIN = T.let(:kg_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + LA_TIN = T.let(:la_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + LI_UID = T.let(:li_uid, WhopSDK::TaxIdentifierType::TaggedSymbol) + LI_VAT = T.let(:li_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + MY_FRP = T.let(:my_frp, WhopSDK::TaxIdentifierType::TaggedSymbol) + MY_ITN = T.let(:my_itn, WhopSDK::TaxIdentifierType::TaggedSymbol) + MY_SST = T.let(:my_sst, WhopSDK::TaxIdentifierType::TaggedSymbol) + MR_NIF = T.let(:mr_nif, WhopSDK::TaxIdentifierType::TaggedSymbol) + MX_RFC = T.let(:mx_rfc, WhopSDK::TaxIdentifierType::TaggedSymbol) + MD_VAT = T.let(:md_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + ME_PIB = T.let(:me_pib, WhopSDK::TaxIdentifierType::TaggedSymbol) + MA_VAT = T.let(:ma_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + NP_PAN = T.let(:np_pan, WhopSDK::TaxIdentifierType::TaggedSymbol) + NZ_GST = T.let(:nz_gst, WhopSDK::TaxIdentifierType::TaggedSymbol) + NG_TIN = T.let(:ng_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + MK_VAT = T.let(:mk_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + NO_VAT = T.let(:no_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + NO_VOEC = T.let(:no_voec, WhopSDK::TaxIdentifierType::TaggedSymbol) + OM_VAT = T.let(:om_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + PE_RUC = T.let(:pe_ruc, WhopSDK::TaxIdentifierType::TaggedSymbol) + PH_TIN = T.let(:ph_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + PL_NIP = T.let(:pl_nip, WhopSDK::TaxIdentifierType::TaggedSymbol) + RO_TIN = T.let(:ro_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + RU_INN = T.let(:ru_inn, WhopSDK::TaxIdentifierType::TaggedSymbol) + RU_KPP = T.let(:ru_kpp, WhopSDK::TaxIdentifierType::TaggedSymbol) + SA_VAT = T.let(:sa_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + SN_NINEA = T.let(:sn_ninea, WhopSDK::TaxIdentifierType::TaggedSymbol) + RS_PIB = T.let(:rs_pib, WhopSDK::TaxIdentifierType::TaggedSymbol) + SG_GST = T.let(:sg_gst, WhopSDK::TaxIdentifierType::TaggedSymbol) + SG_UEN = T.let(:sg_uen, WhopSDK::TaxIdentifierType::TaggedSymbol) + SI_TIN = T.let(:si_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + ZA_VAT = T.let(:za_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + KR_BRN = T.let(:kr_brn, WhopSDK::TaxIdentifierType::TaggedSymbol) + ES_CIF = T.let(:es_cif, WhopSDK::TaxIdentifierType::TaggedSymbol) + CH_UID = T.let(:ch_uid, WhopSDK::TaxIdentifierType::TaggedSymbol) + CH_VAT = T.let(:ch_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + TW_VAT = T.let(:tw_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + TJ_TIN = T.let(:tj_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + TZ_VAT = T.let(:tz_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + TH_VAT = T.let(:th_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + TR_TIN = T.let(:tr_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + UG_TIN = T.let(:ug_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + UA_VAT = T.let(:ua_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + AE_TRN = T.let(:ae_trn, WhopSDK::TaxIdentifierType::TaggedSymbol) + US_EIN = T.let(:us_ein, WhopSDK::TaxIdentifierType::TaggedSymbol) + UY_RUC = T.let(:uy_ruc, WhopSDK::TaxIdentifierType::TaggedSymbol) + UZ_TIN = T.let(:uz_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + UZ_VAT = T.let(:uz_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + VE_RIF = T.let(:ve_rif, WhopSDK::TaxIdentifierType::TaggedSymbol) + VN_TIN = T.let(:vn_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + ZM_TIN = T.let(:zm_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + ZW_TIN = T.let(:zw_tin, WhopSDK::TaxIdentifierType::TaggedSymbol) + SR_FIN = T.let(:sr_fin, WhopSDK::TaxIdentifierType::TaggedSymbol) + XI_VAT = T.let(:xi_vat, WhopSDK::TaxIdentifierType::TaggedSymbol) + + sig do + override.returns(T::Array[WhopSDK::TaxIdentifierType::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/whop_sdk/resources/invoices.rbi b/rbi/whop_sdk/resources/invoices.rbi index 19f6b5b9..b0d2aa7b 100644 --- a/rbi/whop_sdk/resources/invoices.rbi +++ b/rbi/whop_sdk/resources/invoices.rbi @@ -14,10 +14,8 @@ module WhopSDK params( body: T.any( - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::OrHash, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::OrHash, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::OrHash, - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::OrHash + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::OrHash, + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::OrHash ), request_options: WhopSDK::RequestOptions::OrHash ).returns(WhopSDK::Invoice) @@ -47,6 +45,62 @@ module WhopSDK ) end + # Update a draft invoice's details. + # + # Required permissions: + # + # - `invoice:update` + sig do + params( + id: String, + automatically_finalizes_at: T.nilable(Time), + billing_address: + T.nilable(WhopSDK::InvoiceUpdateParams::BillingAddress::OrHash), + charge_buyer_fee: T.nilable(T::Boolean), + collection_method: T.nilable(WhopSDK::CollectionMethod::OrSymbol), + customer_name: T.nilable(String), + due_date: T.nilable(Time), + email_address: T.nilable(String), + line_items: + T.nilable(T::Array[WhopSDK::InvoiceUpdateParams::LineItem::OrHash]), + mailing_address_id: T.nilable(String), + member_id: T.nilable(String), + payment_method_id: T.nilable(String), + plan: T.nilable(WhopSDK::InvoiceUpdateParams::Plan::OrHash), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Invoice) + end + def update( + # The unique identifier of the invoice to update. + id, + # The date and time when the invoice will be automatically finalized and charged. + automatically_finalizes_at: nil, + # Inline billing address to create or update a mailing address for this invoice. + billing_address: nil, + # Whether to charge the customer a buyer fee on this invoice. + charge_buyer_fee: nil, + # The method of collection for an invoice. + collection_method: nil, + # The name of the customer. + customer_name: nil, + # The date by which the invoice must be paid. + due_date: nil, + # The email address of the customer. + email_address: nil, + # Line items that break down the invoice total. + line_items: nil, + # The unique identifier of an existing mailing address to attach. + mailing_address_id: nil, + # The unique identifier of a member to assign as the customer. + member_id: nil, + # The unique identifier of the payment method to charge. + payment_method_id: nil, + # Updated plan attributes. + plan: nil, + request_options: {} + ) + end + # Returns a paginated list of invoices for a company, with optional filtering by # product, status, collection method, and creation date. # @@ -101,6 +155,60 @@ module WhopSDK ) end + # Delete a draft invoice. + # + # Required permissions: + # + # - `invoice:update` + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T::Boolean) + end + def delete( + # The unique identifier of the draft invoice to delete. + id, + request_options: {} + ) + end + + # Mark an open invoice as paid when payment was collected outside of Whop. + # + # Required permissions: + # + # - `invoice:update` + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T::Boolean) + end + def mark_paid( + # The unique identifier of the invoice to mark as paid. + id, + request_options: {} + ) + end + + # Mark an open invoice as uncollectible when payment is not expected. + # + # Required permissions: + # + # - `invoice:update` + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T::Boolean) + end + def mark_uncollectible( + # The unique identifier of the invoice to mark as uncollectible. + id, + request_options: {} + ) + end + # Void an open invoice so it can no longer be paid. Voiding is permanent and # cannot be undone. # diff --git a/rbi/whop_sdk/resources/plans.rbi b/rbi/whop_sdk/resources/plans.rbi index caa35b29..fa3dd560 100644 --- a/rbi/whop_sdk/resources/plans.rbi +++ b/rbi/whop_sdk/resources/plans.rbi @@ -17,6 +17,8 @@ module WhopSDK company_id: String, product_id: String, billing_period: T.nilable(Integer), + checkout_styling: + T.nilable(WhopSDK::PlanCreateParams::CheckoutStyling::OrHash), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable(T::Array[WhopSDK::PlanCreateParams::CustomField::OrHash]), @@ -51,6 +53,9 @@ module WhopSDK # The number of days between recurring charges. For example, 30 for monthly or 365 # for yearly. billing_period: nil, + # Checkout styling overrides for this plan. Pass null to inherit from the company + # default. + checkout_styling: nil, # The available currencies on the platform currency: nil, # An array of custom field definitions to collect from customers at checkout. @@ -131,6 +136,8 @@ module WhopSDK params( id: String, billing_period: T.nilable(Integer), + checkout_styling: + T.nilable(WhopSDK::PlanUpdateParams::CheckoutStyling::OrHash), currency: T.nilable(WhopSDK::Currency::OrSymbol), custom_fields: T.nilable(T::Array[WhopSDK::PlanUpdateParams::CustomField::OrHash]), @@ -163,6 +170,9 @@ module WhopSDK # The number of days between recurring charges. For example, 30 for monthly or 365 # for yearly. billing_period: nil, + # Checkout styling overrides for this plan. Pass null to remove all overrides and + # inherit from the company default. + checkout_styling: nil, # The available currencies on the platform currency: nil, # An array of custom field definitions to collect from customers at checkout. diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index f886c7d9..0d436e1f 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -101,8 +101,12 @@ module WhopSDK class CheckoutConfigurationRetrieveParams = WhopSDK::Models::CheckoutConfigurationRetrieveParams + module CheckoutFont = WhopSDK::Models::CheckoutFont + module CheckoutModes = WhopSDK::Models::CheckoutModes + module CheckoutShape = WhopSDK::Models::CheckoutShape + module CollectionMethod = WhopSDK::Models::CollectionMethod class Company = WhopSDK::Models::Company @@ -325,12 +329,18 @@ module WhopSDK class InvoiceCreateParams = WhopSDK::Models::InvoiceCreateParams + class InvoiceDeleteParams = WhopSDK::Models::InvoiceDeleteParams + class InvoiceListItem = WhopSDK::Models::InvoiceListItem class InvoiceListParams = WhopSDK::Models::InvoiceListParams class InvoiceMarkedUncollectibleWebhookEvent = WhopSDK::Models::InvoiceMarkedUncollectibleWebhookEvent + class InvoiceMarkPaidParams = WhopSDK::Models::InvoiceMarkPaidParams + + class InvoiceMarkUncollectibleParams = WhopSDK::Models::InvoiceMarkUncollectibleParams + class InvoicePaidWebhookEvent = WhopSDK::Models::InvoicePaidWebhookEvent class InvoicePastDueWebhookEvent = WhopSDK::Models::InvoicePastDueWebhookEvent @@ -339,6 +349,8 @@ module WhopSDK module InvoiceStatus = WhopSDK::Models::InvoiceStatus + class InvoiceUpdateParams = WhopSDK::Models::InvoiceUpdateParams + class InvoiceVoidedWebhookEvent = WhopSDK::Models::InvoiceVoidedWebhookEvent class InvoiceVoidParams = WhopSDK::Models::InvoiceVoidParams @@ -601,6 +613,8 @@ module WhopSDK class SupportChannelRetrieveParams = WhopSDK::Models::SupportChannelRetrieveParams + module TaxIdentifierType = WhopSDK::Models::TaxIdentifierType + module TaxType = WhopSDK::Models::TaxType class TopupCreateParams = WhopSDK::Models::TopupCreateParams diff --git a/sig/whop_sdk/models/checkout_configuration_create_params.rbs b/sig/whop_sdk/models/checkout_configuration_create_params.rbs index 9392d8fc..094bade7 100644 --- a/sig/whop_sdk/models/checkout_configuration_create_params.rbs +++ b/sig/whop_sdk/models/checkout_configuration_create_params.rbs @@ -32,6 +32,7 @@ module WhopSDK { plan: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan, affiliate_code: String?, + checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling?, currency: WhopSDK::Models::currency?, metadata: ::Hash[Symbol, top]?, mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode, @@ -45,6 +46,8 @@ module WhopSDK attr_accessor affiliate_code: String? + attr_accessor checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling? + attr_accessor currency: WhopSDK::Models::currency? attr_accessor metadata: ::Hash[Symbol, top]? @@ -64,6 +67,7 @@ module WhopSDK def initialize: ( plan: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan, ?affiliate_code: String?, + ?checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling?, ?currency: WhopSDK::Models::currency?, ?metadata: ::Hash[Symbol, top]?, ?mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode, @@ -75,6 +79,7 @@ module WhopSDK def to_hash: -> { plan: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::Plan, affiliate_code: String?, + checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::CheckoutStyling?, currency: WhopSDK::Models::currency?, metadata: ::Hash[Symbol, top]?, mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlan::mode, @@ -361,6 +366,33 @@ module WhopSDK end end + type checkout_styling = + { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + attr_accessor border_style: WhopSDK::Models::checkout_shape? + + attr_accessor button_color: String? + + attr_accessor font_family: WhopSDK::Models::checkout_font? + + def initialize: ( + ?border_style: WhopSDK::Models::checkout_shape?, + ?button_color: String?, + ?font_family: WhopSDK::Models::checkout_font? + ) -> void + + def to_hash: -> { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + end + type mode = :payment module Mode @@ -403,6 +435,7 @@ module WhopSDK { plan_id: String, affiliate_code: String?, + checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling?, currency: WhopSDK::Models::currency?, metadata: ::Hash[Symbol, top]?, mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode, @@ -416,6 +449,8 @@ module WhopSDK attr_accessor affiliate_code: String? + attr_accessor checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling? + attr_accessor currency: WhopSDK::Models::currency? attr_accessor metadata: ::Hash[Symbol, top]? @@ -435,6 +470,7 @@ module WhopSDK def initialize: ( plan_id: String, ?affiliate_code: String?, + ?checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling?, ?currency: WhopSDK::Models::currency?, ?metadata: ::Hash[Symbol, top]?, ?mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode, @@ -446,6 +482,7 @@ module WhopSDK def to_hash: -> { plan_id: String, affiliate_code: String?, + checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::CheckoutStyling?, currency: WhopSDK::Models::currency?, metadata: ::Hash[Symbol, top]?, mode: WhopSDK::Models::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModePaymentWithPlanID::mode, @@ -454,6 +491,33 @@ module WhopSDK source_url: String? } + type checkout_styling = + { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + attr_accessor border_style: WhopSDK::Models::checkout_shape? + + attr_accessor button_color: String? + + attr_accessor font_family: WhopSDK::Models::checkout_font? + + def initialize: ( + ?border_style: WhopSDK::Models::checkout_shape?, + ?button_color: String?, + ?font_family: WhopSDK::Models::checkout_font? + ) -> void + + def to_hash: -> { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + end + type mode = :payment module Mode @@ -496,6 +560,7 @@ module WhopSDK { company_id: String, mode: :setup, + checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling?, currency: WhopSDK::Models::currency?, metadata: ::Hash[Symbol, top]?, payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration?, @@ -508,6 +573,8 @@ module WhopSDK attr_accessor mode: :setup + attr_accessor checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling? + attr_accessor currency: WhopSDK::Models::currency? attr_accessor metadata: ::Hash[Symbol, top]? @@ -520,6 +587,7 @@ module WhopSDK def initialize: ( company_id: String, + ?checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling?, ?currency: WhopSDK::Models::currency?, ?metadata: ::Hash[Symbol, top]?, ?payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration?, @@ -531,6 +599,7 @@ module WhopSDK def to_hash: -> { company_id: String, mode: :setup, + checkout_styling: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::CheckoutStyling?, currency: WhopSDK::Models::currency?, metadata: ::Hash[Symbol, top]?, payment_method_configuration: WhopSDK::CheckoutConfigurationCreateParams::Body::CreateCheckoutSessionInputModeSetup::PaymentMethodConfiguration?, @@ -538,6 +607,33 @@ module WhopSDK source_url: String? } + type checkout_styling = + { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + attr_accessor border_style: WhopSDK::Models::checkout_shape? + + attr_accessor button_color: String? + + attr_accessor font_family: WhopSDK::Models::checkout_font? + + def initialize: ( + ?border_style: WhopSDK::Models::checkout_shape?, + ?button_color: String?, + ?font_family: WhopSDK::Models::checkout_font? + ) -> void + + def to_hash: -> { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + end + type payment_method_configuration = { disabled: ::Array[WhopSDK::Models::payment_method_types], diff --git a/sig/whop_sdk/models/checkout_font.rbs b/sig/whop_sdk/models/checkout_font.rbs new file mode 100644 index 00000000..ed76e6cf --- /dev/null +++ b/sig/whop_sdk/models/checkout_font.rbs @@ -0,0 +1,15 @@ +module WhopSDK + module Models + type checkout_font = :system | :roboto | :open_sans + + module CheckoutFont + extend WhopSDK::Internal::Type::Enum + + SYSTEM: :system + ROBOTO: :roboto + OPEN_SANS: :open_sans + + def self?.values: -> ::Array[WhopSDK::Models::checkout_font] + end + end +end diff --git a/sig/whop_sdk/models/checkout_shape.rbs b/sig/whop_sdk/models/checkout_shape.rbs new file mode 100644 index 00000000..e88a773a --- /dev/null +++ b/sig/whop_sdk/models/checkout_shape.rbs @@ -0,0 +1,15 @@ +module WhopSDK + module Models + type checkout_shape = :rounded | :pill | :rectangular + + module CheckoutShape + extend WhopSDK::Internal::Type::Enum + + ROUNDED: :rounded + PILL: :pill + RECTANGULAR: :rectangular + + def self?.values: -> ::Array[WhopSDK::Models::checkout_shape] + end + end +end diff --git a/sig/whop_sdk/models/invoice_create_params.rbs b/sig/whop_sdk/models/invoice_create_params.rbs index 3d6270f1..954a057a 100644 --- a/sig/whop_sdk/models/invoice_create_params.rbs +++ b/sig/whop_sdk/models/invoice_create_params.rbs @@ -21,105 +21,113 @@ module WhopSDK } type body = - WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID - | WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress - | WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID - | WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress + WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct + | WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID module Body extend WhopSDK::Internal::Type::Union - type create_invoice_input_with_product_and_member_id = + type create_invoice_input_with_product = { collection_method: WhopSDK::Models::collection_method, company_id: String, - due_date: Time, - member_id: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan, - product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product, + plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan, + product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product, automatically_finalizes_at: Time?, - billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress?, + billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress?, charge_buyer_fee: bool?, customer_name: String?, - line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem]?, + due_date: Time?, + email_address: String?, + line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem]?, mailing_address_id: String?, + member_id: String?, payment_method_id: String?, - payment_token_id: String? + payment_token_id: String?, + save_as_draft: bool? } - class CreateInvoiceInputWithProductAndMemberID < WhopSDK::Internal::Type::BaseModel + class CreateInvoiceInputWithProduct < WhopSDK::Internal::Type::BaseModel attr_accessor collection_method: WhopSDK::Models::collection_method attr_accessor company_id: String - attr_accessor due_date: Time + attr_accessor plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan - attr_accessor member_id: String - - attr_accessor plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan - - attr_accessor product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product + attr_accessor product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product attr_accessor automatically_finalizes_at: Time? - attr_accessor billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress? + attr_accessor billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress? attr_accessor charge_buyer_fee: bool? attr_accessor customer_name: String? - attr_accessor line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem]? + attr_accessor due_date: Time? + + attr_accessor email_address: String? + + attr_accessor line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem]? attr_accessor mailing_address_id: String? + attr_accessor member_id: String? + attr_accessor payment_method_id: String? attr_accessor payment_token_id: String? + attr_accessor save_as_draft: bool? + def initialize: ( collection_method: WhopSDK::Models::collection_method, company_id: String, - due_date: Time, - member_id: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan, - product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product, + plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan, + product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product, ?automatically_finalizes_at: Time?, - ?billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress?, + ?billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress?, ?charge_buyer_fee: bool?, ?customer_name: String?, - ?line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem]?, + ?due_date: Time?, + ?email_address: String?, + ?line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem]?, ?mailing_address_id: String?, + ?member_id: String?, ?payment_method_id: String?, - ?payment_token_id: String? + ?payment_token_id: String?, + ?save_as_draft: bool? ) -> void def to_hash: -> { collection_method: WhopSDK::Models::collection_method, company_id: String, - due_date: Time, - member_id: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan, - product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Product, + plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan, + product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Product, automatically_finalizes_at: Time?, - billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress?, + billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::BillingAddress?, charge_buyer_fee: bool?, customer_name: String?, - line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::LineItem]?, + due_date: Time?, + email_address: String?, + line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::LineItem]?, mailing_address_id: String?, + member_id: String?, payment_method_id: String?, - payment_token_id: String? + payment_token_id: String?, + save_as_draft: bool? } type plan = { billing_period: Integer?, - custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::CustomField]?, + custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]?, description: String?, expiration_days: Integer?, initial_price: Float?, internal_notes: String?, legacy_payment_method_controls: bool?, - payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration?, + payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration?, plan_type: WhopSDK::Models::plan_type?, release_method: WhopSDK::Models::release_method?, renewal_price: Float?, @@ -132,7 +140,7 @@ module WhopSDK class Plan < WhopSDK::Internal::Type::BaseModel attr_accessor billing_period: Integer? - attr_accessor custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::CustomField]? + attr_accessor custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]? attr_accessor description: String? @@ -144,7 +152,7 @@ module WhopSDK attr_accessor legacy_payment_method_controls: bool? - attr_accessor payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration? + attr_accessor payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration? attr_accessor plan_type: WhopSDK::Models::plan_type? @@ -162,13 +170,13 @@ module WhopSDK def initialize: ( ?billing_period: Integer?, - ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::CustomField]?, + ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]?, ?description: String?, ?expiration_days: Integer?, ?initial_price: Float?, ?internal_notes: String?, ?legacy_payment_method_controls: bool?, - ?payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration?, + ?payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration?, ?plan_type: WhopSDK::Models::plan_type?, ?release_method: WhopSDK::Models::release_method?, ?renewal_price: Float?, @@ -180,13 +188,13 @@ module WhopSDK def to_hash: -> { billing_period: Integer?, - custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::CustomField]?, + custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::CustomField]?, description: String?, expiration_days: Integer?, initial_price: Float?, internal_notes: String?, legacy_payment_method_controls: bool?, - payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::Plan::PaymentMethodConfiguration?, + payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProduct::Plan::PaymentMethodConfiguration?, plan_type: WhopSDK::Models::plan_type?, release_method: WhopSDK::Models::release_method?, renewal_price: Float?, @@ -291,7 +299,7 @@ module WhopSDK phone: String?, postal_code: String?, state: String?, - tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::tax_id_type?, + tax_id_type: WhopSDK::Models::tax_identifier_type?, tax_id_value: String? } @@ -312,7 +320,7 @@ module WhopSDK attr_accessor state: String? - attr_accessor tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::tax_id_type? + attr_accessor tax_id_type: WhopSDK::Models::tax_identifier_type? attr_accessor tax_id_value: String? @@ -325,7 +333,7 @@ module WhopSDK ?phone: String?, ?postal_code: String?, ?state: String?, - ?tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::tax_id_type?, + ?tax_id_type: WhopSDK::Models::tax_identifier_type?, ?tax_id_value: String? ) -> void @@ -338,240 +346,9 @@ module WhopSDK phone: String?, postal_code: String?, state: String?, - tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::tax_id_type?, + tax_id_type: WhopSDK::Models::tax_identifier_type?, tax_id_value: String? } - - type tax_id_type = - :ad_nrt - | :ao_tin - | :ar_cuit - | :am_tin - | :aw_tin - | :au_abn - | :au_arn - | :eu_vat - | :az_tin - | :bs_tin - | :bh_vat - | :bd_bin - | :bb_tin - | :by_tin - | :bj_ifu - | :bo_tin - | :ba_tin - | :br_cnpj - | :br_cpf - | :bg_uic - | :bf_ifu - | :kh_tin - | :cm_niu - | :ca_bn - | :ca_gst_hst - | :ca_pst_bc - | :ca_pst_mb - | :ca_pst_sk - | :ca_qst - | :cv_nif - | :cl_tin - | :cn_tin - | :co_nit - | :cd_nif - | :cr_tin - | :hr_oib - | :do_rcn - | :ec_ruc - | :eg_tin - | :sv_nit - | :et_tin - | :eu_oss_vat - | :ge_vat - | :de_stn - | :gb_vat - | :gn_nif - | :hk_br - | :hu_tin - | :is_vat - | :in_gst - | :id_npwp - | :il_vat - | :jp_cn - | :jp_rn - | :jp_trn - | :kz_bin - | :ke_pin - | :kg_tin - | :la_tin - | :li_uid - | :li_vat - | :my_frp - | :my_itn - | :my_sst - | :mr_nif - | :mx_rfc - | :md_vat - | :me_pib - | :ma_vat - | :np_pan - | :nz_gst - | :ng_tin - | :mk_vat - | :no_vat - | :no_voec - | :om_vat - | :pe_ruc - | :ph_tin - | :pl_nip - | :ro_tin - | :ru_inn - | :ru_kpp - | :sa_vat - | :sn_ninea - | :rs_pib - | :sg_gst - | :sg_uen - | :si_tin - | :za_vat - | :kr_brn - | :es_cif - | :ch_uid - | :ch_vat - | :tw_vat - | :tj_tin - | :tz_vat - | :th_vat - | :tr_tin - | :ug_tin - | :ua_vat - | :ae_trn - | :us_ein - | :uy_ruc - | :uz_tin - | :uz_vat - | :ve_rif - | :vn_tin - | :zm_tin - | :zw_tin - | :sr_fin - | :xi_vat - - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - AD_NRT: :ad_nrt - AO_TIN: :ao_tin - AR_CUIT: :ar_cuit - AM_TIN: :am_tin - AW_TIN: :aw_tin - AU_ABN: :au_abn - AU_ARN: :au_arn - EU_VAT: :eu_vat - AZ_TIN: :az_tin - BS_TIN: :bs_tin - BH_VAT: :bh_vat - BD_BIN: :bd_bin - BB_TIN: :bb_tin - BY_TIN: :by_tin - BJ_IFU: :bj_ifu - BO_TIN: :bo_tin - BA_TIN: :ba_tin - BR_CNPJ: :br_cnpj - BR_CPF: :br_cpf - BG_UIC: :bg_uic - BF_IFU: :bf_ifu - KH_TIN: :kh_tin - CM_NIU: :cm_niu - CA_BN: :ca_bn - CA_GST_HST: :ca_gst_hst - CA_PST_BC: :ca_pst_bc - CA_PST_MB: :ca_pst_mb - CA_PST_SK: :ca_pst_sk - CA_QST: :ca_qst - CV_NIF: :cv_nif - CL_TIN: :cl_tin - CN_TIN: :cn_tin - CO_NIT: :co_nit - CD_NIF: :cd_nif - CR_TIN: :cr_tin - HR_OIB: :hr_oib - DO_RCN: :do_rcn - EC_RUC: :ec_ruc - EG_TIN: :eg_tin - SV_NIT: :sv_nit - ET_TIN: :et_tin - EU_OSS_VAT: :eu_oss_vat - GE_VAT: :ge_vat - DE_STN: :de_stn - GB_VAT: :gb_vat - GN_NIF: :gn_nif - HK_BR: :hk_br - HU_TIN: :hu_tin - IS_VAT: :is_vat - IN_GST: :in_gst - ID_NPWP: :id_npwp - IL_VAT: :il_vat - JP_CN: :jp_cn - JP_RN: :jp_rn - JP_TRN: :jp_trn - KZ_BIN: :kz_bin - KE_PIN: :ke_pin - KG_TIN: :kg_tin - LA_TIN: :la_tin - LI_UID: :li_uid - LI_VAT: :li_vat - MY_FRP: :my_frp - MY_ITN: :my_itn - MY_SST: :my_sst - MR_NIF: :mr_nif - MX_RFC: :mx_rfc - MD_VAT: :md_vat - ME_PIB: :me_pib - MA_VAT: :ma_vat - NP_PAN: :np_pan - NZ_GST: :nz_gst - NG_TIN: :ng_tin - MK_VAT: :mk_vat - NO_VAT: :no_vat - NO_VOEC: :no_voec - OM_VAT: :om_vat - PE_RUC: :pe_ruc - PH_TIN: :ph_tin - PL_NIP: :pl_nip - RO_TIN: :ro_tin - RU_INN: :ru_inn - RU_KPP: :ru_kpp - SA_VAT: :sa_vat - SN_NINEA: :sn_ninea - RS_PIB: :rs_pib - SG_GST: :sg_gst - SG_UEN: :sg_uen - SI_TIN: :si_tin - ZA_VAT: :za_vat - KR_BRN: :kr_brn - ES_CIF: :es_cif - CH_UID: :ch_uid - CH_VAT: :ch_vat - TW_VAT: :tw_vat - TJ_TIN: :tj_tin - TZ_VAT: :tz_vat - TH_VAT: :th_vat - TR_TIN: :tr_tin - UG_TIN: :ug_tin - UA_VAT: :ua_vat - AE_TRN: :ae_trn - US_EIN: :us_ein - UY_RUC: :uy_ruc - UZ_TIN: :uz_tin - UZ_VAT: :uz_vat - VE_RIF: :ve_rif - VN_TIN: :vn_tin - ZM_TIN: :zm_tin - ZW_TIN: :zw_tin - SR_FIN: :sr_fin - XI_VAT: :xi_vat - - def self?.values: -> ::Array[WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndMemberID::BillingAddress::tax_id_type] - end end type line_item = @@ -598,97 +375,107 @@ module WhopSDK end end - type create_invoice_input_with_product_and_email_address = + type create_invoice_input_with_product_id = { collection_method: WhopSDK::Models::collection_method, company_id: String, - due_date: Time, - email_address: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan, - product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product, + plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan, + product_id: String, automatically_finalizes_at: Time?, - billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress?, + billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress?, charge_buyer_fee: bool?, customer_name: String?, - line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem]?, + due_date: Time?, + email_address: String?, + line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem]?, mailing_address_id: String?, + member_id: String?, payment_method_id: String?, - payment_token_id: String? + payment_token_id: String?, + save_as_draft: bool? } - class CreateInvoiceInputWithProductAndEmailAddress < WhopSDK::Internal::Type::BaseModel + class CreateInvoiceInputWithProductID < WhopSDK::Internal::Type::BaseModel attr_accessor collection_method: WhopSDK::Models::collection_method attr_accessor company_id: String - attr_accessor due_date: Time - - attr_accessor email_address: String + attr_accessor plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan - attr_accessor plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan - - attr_accessor product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product + attr_accessor product_id: String attr_accessor automatically_finalizes_at: Time? - attr_accessor billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress? + attr_accessor billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress? attr_accessor charge_buyer_fee: bool? attr_accessor customer_name: String? - attr_accessor line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem]? + attr_accessor due_date: Time? + + attr_accessor email_address: String? + + attr_accessor line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem]? attr_accessor mailing_address_id: String? + attr_accessor member_id: String? + attr_accessor payment_method_id: String? attr_accessor payment_token_id: String? + attr_accessor save_as_draft: bool? + def initialize: ( collection_method: WhopSDK::Models::collection_method, company_id: String, - due_date: Time, - email_address: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan, - product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product, + plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan, + product_id: String, ?automatically_finalizes_at: Time?, - ?billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress?, + ?billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress?, ?charge_buyer_fee: bool?, ?customer_name: String?, - ?line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem]?, + ?due_date: Time?, + ?email_address: String?, + ?line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem]?, ?mailing_address_id: String?, + ?member_id: String?, ?payment_method_id: String?, - ?payment_token_id: String? + ?payment_token_id: String?, + ?save_as_draft: bool? ) -> void def to_hash: -> { collection_method: WhopSDK::Models::collection_method, company_id: String, - due_date: Time, - email_address: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan, - product: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Product, + plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan, + product_id: String, automatically_finalizes_at: Time?, - billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress?, + billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::BillingAddress?, charge_buyer_fee: bool?, customer_name: String?, - line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::LineItem]?, + due_date: Time?, + email_address: String?, + line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::LineItem]?, mailing_address_id: String?, + member_id: String?, payment_method_id: String?, - payment_token_id: String? + payment_token_id: String?, + save_as_draft: bool? } type plan = { billing_period: Integer?, - custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::CustomField]?, + custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]?, description: String?, expiration_days: Integer?, initial_price: Float?, internal_notes: String?, legacy_payment_method_controls: bool?, - payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration?, + payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration?, plan_type: WhopSDK::Models::plan_type?, release_method: WhopSDK::Models::release_method?, renewal_price: Float?, @@ -701,7 +488,7 @@ module WhopSDK class Plan < WhopSDK::Internal::Type::BaseModel attr_accessor billing_period: Integer? - attr_accessor custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::CustomField]? + attr_accessor custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]? attr_accessor description: String? @@ -713,7 +500,7 @@ module WhopSDK attr_accessor legacy_payment_method_controls: bool? - attr_accessor payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration? + attr_accessor payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration? attr_accessor plan_type: WhopSDK::Models::plan_type? @@ -731,13 +518,13 @@ module WhopSDK def initialize: ( ?billing_period: Integer?, - ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::CustomField]?, + ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]?, ?description: String?, ?expiration_days: Integer?, ?initial_price: Float?, ?internal_notes: String?, ?legacy_payment_method_controls: bool?, - ?payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration?, + ?payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration?, ?plan_type: WhopSDK::Models::plan_type?, ?release_method: WhopSDK::Models::release_method?, ?renewal_price: Float?, @@ -749,13 +536,13 @@ module WhopSDK def to_hash: -> { billing_period: Integer?, - custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::CustomField]?, + custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::CustomField]?, description: String?, expiration_days: Integer?, initial_price: Float?, internal_notes: String?, legacy_payment_method_controls: bool?, - payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::Plan::PaymentMethodConfiguration?, + payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductID::Plan::PaymentMethodConfiguration?, plan_type: WhopSDK::Models::plan_type?, release_method: WhopSDK::Models::release_method?, renewal_price: Float?, @@ -835,21 +622,6 @@ module WhopSDK end end - type product = { title: String, product_tax_code_id: String? } - - class Product < WhopSDK::Internal::Type::BaseModel - attr_accessor title: String - - attr_accessor product_tax_code_id: String? - - def initialize: ( - title: String, - ?product_tax_code_id: String? - ) -> void - - def to_hash: -> { title: String, product_tax_code_id: String? } - end - type billing_address = { city: String?, @@ -860,7 +632,7 @@ module WhopSDK phone: String?, postal_code: String?, state: String?, - tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::tax_id_type?, + tax_id_type: WhopSDK::Models::tax_identifier_type?, tax_id_value: String? } @@ -881,7 +653,7 @@ module WhopSDK attr_accessor state: String? - attr_accessor tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::tax_id_type? + attr_accessor tax_id_type: WhopSDK::Models::tax_identifier_type? attr_accessor tax_id_value: String? @@ -894,7 +666,7 @@ module WhopSDK ?phone: String?, ?postal_code: String?, ?state: String?, - ?tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::tax_id_type?, + ?tax_id_type: WhopSDK::Models::tax_identifier_type?, ?tax_id_value: String? ) -> void @@ -907,1348 +679,9 @@ module WhopSDK phone: String?, postal_code: String?, state: String?, - tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::tax_id_type?, + tax_id_type: WhopSDK::Models::tax_identifier_type?, tax_id_value: String? } - - type tax_id_type = - :ad_nrt - | :ao_tin - | :ar_cuit - | :am_tin - | :aw_tin - | :au_abn - | :au_arn - | :eu_vat - | :az_tin - | :bs_tin - | :bh_vat - | :bd_bin - | :bb_tin - | :by_tin - | :bj_ifu - | :bo_tin - | :ba_tin - | :br_cnpj - | :br_cpf - | :bg_uic - | :bf_ifu - | :kh_tin - | :cm_niu - | :ca_bn - | :ca_gst_hst - | :ca_pst_bc - | :ca_pst_mb - | :ca_pst_sk - | :ca_qst - | :cv_nif - | :cl_tin - | :cn_tin - | :co_nit - | :cd_nif - | :cr_tin - | :hr_oib - | :do_rcn - | :ec_ruc - | :eg_tin - | :sv_nit - | :et_tin - | :eu_oss_vat - | :ge_vat - | :de_stn - | :gb_vat - | :gn_nif - | :hk_br - | :hu_tin - | :is_vat - | :in_gst - | :id_npwp - | :il_vat - | :jp_cn - | :jp_rn - | :jp_trn - | :kz_bin - | :ke_pin - | :kg_tin - | :la_tin - | :li_uid - | :li_vat - | :my_frp - | :my_itn - | :my_sst - | :mr_nif - | :mx_rfc - | :md_vat - | :me_pib - | :ma_vat - | :np_pan - | :nz_gst - | :ng_tin - | :mk_vat - | :no_vat - | :no_voec - | :om_vat - | :pe_ruc - | :ph_tin - | :pl_nip - | :ro_tin - | :ru_inn - | :ru_kpp - | :sa_vat - | :sn_ninea - | :rs_pib - | :sg_gst - | :sg_uen - | :si_tin - | :za_vat - | :kr_brn - | :es_cif - | :ch_uid - | :ch_vat - | :tw_vat - | :tj_tin - | :tz_vat - | :th_vat - | :tr_tin - | :ug_tin - | :ua_vat - | :ae_trn - | :us_ein - | :uy_ruc - | :uz_tin - | :uz_vat - | :ve_rif - | :vn_tin - | :zm_tin - | :zw_tin - | :sr_fin - | :xi_vat - - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - AD_NRT: :ad_nrt - AO_TIN: :ao_tin - AR_CUIT: :ar_cuit - AM_TIN: :am_tin - AW_TIN: :aw_tin - AU_ABN: :au_abn - AU_ARN: :au_arn - EU_VAT: :eu_vat - AZ_TIN: :az_tin - BS_TIN: :bs_tin - BH_VAT: :bh_vat - BD_BIN: :bd_bin - BB_TIN: :bb_tin - BY_TIN: :by_tin - BJ_IFU: :bj_ifu - BO_TIN: :bo_tin - BA_TIN: :ba_tin - BR_CNPJ: :br_cnpj - BR_CPF: :br_cpf - BG_UIC: :bg_uic - BF_IFU: :bf_ifu - KH_TIN: :kh_tin - CM_NIU: :cm_niu - CA_BN: :ca_bn - CA_GST_HST: :ca_gst_hst - CA_PST_BC: :ca_pst_bc - CA_PST_MB: :ca_pst_mb - CA_PST_SK: :ca_pst_sk - CA_QST: :ca_qst - CV_NIF: :cv_nif - CL_TIN: :cl_tin - CN_TIN: :cn_tin - CO_NIT: :co_nit - CD_NIF: :cd_nif - CR_TIN: :cr_tin - HR_OIB: :hr_oib - DO_RCN: :do_rcn - EC_RUC: :ec_ruc - EG_TIN: :eg_tin - SV_NIT: :sv_nit - ET_TIN: :et_tin - EU_OSS_VAT: :eu_oss_vat - GE_VAT: :ge_vat - DE_STN: :de_stn - GB_VAT: :gb_vat - GN_NIF: :gn_nif - HK_BR: :hk_br - HU_TIN: :hu_tin - IS_VAT: :is_vat - IN_GST: :in_gst - ID_NPWP: :id_npwp - IL_VAT: :il_vat - JP_CN: :jp_cn - JP_RN: :jp_rn - JP_TRN: :jp_trn - KZ_BIN: :kz_bin - KE_PIN: :ke_pin - KG_TIN: :kg_tin - LA_TIN: :la_tin - LI_UID: :li_uid - LI_VAT: :li_vat - MY_FRP: :my_frp - MY_ITN: :my_itn - MY_SST: :my_sst - MR_NIF: :mr_nif - MX_RFC: :mx_rfc - MD_VAT: :md_vat - ME_PIB: :me_pib - MA_VAT: :ma_vat - NP_PAN: :np_pan - NZ_GST: :nz_gst - NG_TIN: :ng_tin - MK_VAT: :mk_vat - NO_VAT: :no_vat - NO_VOEC: :no_voec - OM_VAT: :om_vat - PE_RUC: :pe_ruc - PH_TIN: :ph_tin - PL_NIP: :pl_nip - RO_TIN: :ro_tin - RU_INN: :ru_inn - RU_KPP: :ru_kpp - SA_VAT: :sa_vat - SN_NINEA: :sn_ninea - RS_PIB: :rs_pib - SG_GST: :sg_gst - SG_UEN: :sg_uen - SI_TIN: :si_tin - ZA_VAT: :za_vat - KR_BRN: :kr_brn - ES_CIF: :es_cif - CH_UID: :ch_uid - CH_VAT: :ch_vat - TW_VAT: :tw_vat - TJ_TIN: :tj_tin - TZ_VAT: :tz_vat - TH_VAT: :th_vat - TR_TIN: :tr_tin - UG_TIN: :ug_tin - UA_VAT: :ua_vat - AE_TRN: :ae_trn - US_EIN: :us_ein - UY_RUC: :uy_ruc - UZ_TIN: :uz_tin - UZ_VAT: :uz_vat - VE_RIF: :ve_rif - VN_TIN: :vn_tin - ZM_TIN: :zm_tin - ZW_TIN: :zw_tin - SR_FIN: :sr_fin - XI_VAT: :xi_vat - - def self?.values: -> ::Array[WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductAndEmailAddress::BillingAddress::tax_id_type] - end - end - - type line_item = - { label: String, unit_price: Float, quantity: Float? } - - class LineItem < WhopSDK::Internal::Type::BaseModel - attr_accessor label: String - - attr_accessor unit_price: Float - - attr_accessor quantity: Float? - - def initialize: ( - label: String, - unit_price: Float, - ?quantity: Float? - ) -> void - - def to_hash: -> { - label: String, - unit_price: Float, - quantity: Float? - } - end - end - - type create_invoice_input_with_product_id_and_member_id = - { - collection_method: WhopSDK::Models::collection_method, - company_id: String, - due_date: Time, - member_id: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan, - product_id: String, - automatically_finalizes_at: Time?, - billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress?, - charge_buyer_fee: bool?, - customer_name: String?, - line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem]?, - mailing_address_id: String?, - payment_method_id: String?, - payment_token_id: String? - } - - class CreateInvoiceInputWithProductIDAndMemberID < WhopSDK::Internal::Type::BaseModel - attr_accessor collection_method: WhopSDK::Models::collection_method - - attr_accessor company_id: String - - attr_accessor due_date: Time - - attr_accessor member_id: String - - attr_accessor plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan - - attr_accessor product_id: String - - attr_accessor automatically_finalizes_at: Time? - - attr_accessor billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress? - - attr_accessor charge_buyer_fee: bool? - - attr_accessor customer_name: String? - - attr_accessor line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem]? - - attr_accessor mailing_address_id: String? - - attr_accessor payment_method_id: String? - - attr_accessor payment_token_id: String? - - def initialize: ( - collection_method: WhopSDK::Models::collection_method, - company_id: String, - due_date: Time, - member_id: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan, - product_id: String, - ?automatically_finalizes_at: Time?, - ?billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress?, - ?charge_buyer_fee: bool?, - ?customer_name: String?, - ?line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem]?, - ?mailing_address_id: String?, - ?payment_method_id: String?, - ?payment_token_id: String? - ) -> void - - def to_hash: -> { - collection_method: WhopSDK::Models::collection_method, - company_id: String, - due_date: Time, - member_id: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan, - product_id: String, - automatically_finalizes_at: Time?, - billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress?, - charge_buyer_fee: bool?, - customer_name: String?, - line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::LineItem]?, - mailing_address_id: String?, - payment_method_id: String?, - payment_token_id: String? - } - - type plan = - { - billing_period: Integer?, - custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::CustomField]?, - description: String?, - expiration_days: Integer?, - initial_price: Float?, - internal_notes: String?, - legacy_payment_method_controls: bool?, - payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type?, - release_method: WhopSDK::Models::release_method?, - renewal_price: Float?, - stock: Integer?, - trial_period_days: Integer?, - unlimited_stock: bool?, - visibility: WhopSDK::Models::visibility? - } - - class Plan < WhopSDK::Internal::Type::BaseModel - attr_accessor billing_period: Integer? - - attr_accessor custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::CustomField]? - - attr_accessor description: String? - - attr_accessor expiration_days: Integer? - - attr_accessor initial_price: Float? - - attr_accessor internal_notes: String? - - attr_accessor legacy_payment_method_controls: bool? - - attr_accessor payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration? - - attr_accessor plan_type: WhopSDK::Models::plan_type? - - attr_accessor release_method: WhopSDK::Models::release_method? - - attr_accessor renewal_price: Float? - - attr_accessor stock: Integer? - - attr_accessor trial_period_days: Integer? - - attr_accessor unlimited_stock: bool? - - attr_accessor visibility: WhopSDK::Models::visibility? - - def initialize: ( - ?billing_period: Integer?, - ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::CustomField]?, - ?description: String?, - ?expiration_days: Integer?, - ?initial_price: Float?, - ?internal_notes: String?, - ?legacy_payment_method_controls: bool?, - ?payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration?, - ?plan_type: WhopSDK::Models::plan_type?, - ?release_method: WhopSDK::Models::release_method?, - ?renewal_price: Float?, - ?stock: Integer?, - ?trial_period_days: Integer?, - ?unlimited_stock: bool?, - ?visibility: WhopSDK::Models::visibility? - ) -> void - - def to_hash: -> { - billing_period: Integer?, - custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::CustomField]?, - description: String?, - expiration_days: Integer?, - initial_price: Float?, - internal_notes: String?, - legacy_payment_method_controls: bool?, - payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::Plan::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type?, - release_method: WhopSDK::Models::release_method?, - renewal_price: Float?, - stock: Integer?, - trial_period_days: Integer?, - unlimited_stock: bool?, - visibility: WhopSDK::Models::visibility? - } - - type custom_field = - { - field_type: :text, - name: String, - id: String?, - order: Integer?, - placeholder: String?, - required: bool? - } - - class CustomField < WhopSDK::Internal::Type::BaseModel - attr_accessor field_type: :text - - attr_accessor name: String - - attr_accessor id: String? - - attr_accessor order: Integer? - - attr_accessor placeholder: String? - - attr_accessor required: bool? - - def initialize: ( - name: String, - ?id: String?, - ?order: Integer?, - ?placeholder: String?, - ?required: bool?, - ?field_type: :text - ) -> void - - def to_hash: -> { - field_type: :text, - name: String, - id: String?, - order: Integer?, - placeholder: String?, - required: bool? - } - end - - type payment_method_configuration = - { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - } - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - attr_accessor disabled: ::Array[WhopSDK::Models::payment_method_types] - - attr_accessor enabled: ::Array[WhopSDK::Models::payment_method_types] - - attr_accessor include_platform_defaults: bool - - def initialize: ( - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - ) -> void - - def to_hash: -> { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - } - end - end - - type billing_address = - { - city: String?, - country: String?, - :line1 => String?, - :line2 => String?, - name: String?, - phone: String?, - postal_code: String?, - state: String?, - tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::tax_id_type?, - tax_id_value: String? - } - - class BillingAddress < WhopSDK::Internal::Type::BaseModel - attr_accessor city: String? - - attr_accessor country: String? - - attr_accessor line1: String? - - attr_accessor line2: String? - - attr_accessor name: String? - - attr_accessor phone: String? - - attr_accessor postal_code: String? - - attr_accessor state: String? - - attr_accessor tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::tax_id_type? - - attr_accessor tax_id_value: String? - - def initialize: ( - ?city: String?, - ?country: String?, - ?line1: String?, - ?line2: String?, - ?name: String?, - ?phone: String?, - ?postal_code: String?, - ?state: String?, - ?tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::tax_id_type?, - ?tax_id_value: String? - ) -> void - - def to_hash: -> { - city: String?, - country: String?, - :line1 => String?, - :line2 => String?, - name: String?, - phone: String?, - postal_code: String?, - state: String?, - tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::tax_id_type?, - tax_id_value: String? - } - - type tax_id_type = - :ad_nrt - | :ao_tin - | :ar_cuit - | :am_tin - | :aw_tin - | :au_abn - | :au_arn - | :eu_vat - | :az_tin - | :bs_tin - | :bh_vat - | :bd_bin - | :bb_tin - | :by_tin - | :bj_ifu - | :bo_tin - | :ba_tin - | :br_cnpj - | :br_cpf - | :bg_uic - | :bf_ifu - | :kh_tin - | :cm_niu - | :ca_bn - | :ca_gst_hst - | :ca_pst_bc - | :ca_pst_mb - | :ca_pst_sk - | :ca_qst - | :cv_nif - | :cl_tin - | :cn_tin - | :co_nit - | :cd_nif - | :cr_tin - | :hr_oib - | :do_rcn - | :ec_ruc - | :eg_tin - | :sv_nit - | :et_tin - | :eu_oss_vat - | :ge_vat - | :de_stn - | :gb_vat - | :gn_nif - | :hk_br - | :hu_tin - | :is_vat - | :in_gst - | :id_npwp - | :il_vat - | :jp_cn - | :jp_rn - | :jp_trn - | :kz_bin - | :ke_pin - | :kg_tin - | :la_tin - | :li_uid - | :li_vat - | :my_frp - | :my_itn - | :my_sst - | :mr_nif - | :mx_rfc - | :md_vat - | :me_pib - | :ma_vat - | :np_pan - | :nz_gst - | :ng_tin - | :mk_vat - | :no_vat - | :no_voec - | :om_vat - | :pe_ruc - | :ph_tin - | :pl_nip - | :ro_tin - | :ru_inn - | :ru_kpp - | :sa_vat - | :sn_ninea - | :rs_pib - | :sg_gst - | :sg_uen - | :si_tin - | :za_vat - | :kr_brn - | :es_cif - | :ch_uid - | :ch_vat - | :tw_vat - | :tj_tin - | :tz_vat - | :th_vat - | :tr_tin - | :ug_tin - | :ua_vat - | :ae_trn - | :us_ein - | :uy_ruc - | :uz_tin - | :uz_vat - | :ve_rif - | :vn_tin - | :zm_tin - | :zw_tin - | :sr_fin - | :xi_vat - - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - AD_NRT: :ad_nrt - AO_TIN: :ao_tin - AR_CUIT: :ar_cuit - AM_TIN: :am_tin - AW_TIN: :aw_tin - AU_ABN: :au_abn - AU_ARN: :au_arn - EU_VAT: :eu_vat - AZ_TIN: :az_tin - BS_TIN: :bs_tin - BH_VAT: :bh_vat - BD_BIN: :bd_bin - BB_TIN: :bb_tin - BY_TIN: :by_tin - BJ_IFU: :bj_ifu - BO_TIN: :bo_tin - BA_TIN: :ba_tin - BR_CNPJ: :br_cnpj - BR_CPF: :br_cpf - BG_UIC: :bg_uic - BF_IFU: :bf_ifu - KH_TIN: :kh_tin - CM_NIU: :cm_niu - CA_BN: :ca_bn - CA_GST_HST: :ca_gst_hst - CA_PST_BC: :ca_pst_bc - CA_PST_MB: :ca_pst_mb - CA_PST_SK: :ca_pst_sk - CA_QST: :ca_qst - CV_NIF: :cv_nif - CL_TIN: :cl_tin - CN_TIN: :cn_tin - CO_NIT: :co_nit - CD_NIF: :cd_nif - CR_TIN: :cr_tin - HR_OIB: :hr_oib - DO_RCN: :do_rcn - EC_RUC: :ec_ruc - EG_TIN: :eg_tin - SV_NIT: :sv_nit - ET_TIN: :et_tin - EU_OSS_VAT: :eu_oss_vat - GE_VAT: :ge_vat - DE_STN: :de_stn - GB_VAT: :gb_vat - GN_NIF: :gn_nif - HK_BR: :hk_br - HU_TIN: :hu_tin - IS_VAT: :is_vat - IN_GST: :in_gst - ID_NPWP: :id_npwp - IL_VAT: :il_vat - JP_CN: :jp_cn - JP_RN: :jp_rn - JP_TRN: :jp_trn - KZ_BIN: :kz_bin - KE_PIN: :ke_pin - KG_TIN: :kg_tin - LA_TIN: :la_tin - LI_UID: :li_uid - LI_VAT: :li_vat - MY_FRP: :my_frp - MY_ITN: :my_itn - MY_SST: :my_sst - MR_NIF: :mr_nif - MX_RFC: :mx_rfc - MD_VAT: :md_vat - ME_PIB: :me_pib - MA_VAT: :ma_vat - NP_PAN: :np_pan - NZ_GST: :nz_gst - NG_TIN: :ng_tin - MK_VAT: :mk_vat - NO_VAT: :no_vat - NO_VOEC: :no_voec - OM_VAT: :om_vat - PE_RUC: :pe_ruc - PH_TIN: :ph_tin - PL_NIP: :pl_nip - RO_TIN: :ro_tin - RU_INN: :ru_inn - RU_KPP: :ru_kpp - SA_VAT: :sa_vat - SN_NINEA: :sn_ninea - RS_PIB: :rs_pib - SG_GST: :sg_gst - SG_UEN: :sg_uen - SI_TIN: :si_tin - ZA_VAT: :za_vat - KR_BRN: :kr_brn - ES_CIF: :es_cif - CH_UID: :ch_uid - CH_VAT: :ch_vat - TW_VAT: :tw_vat - TJ_TIN: :tj_tin - TZ_VAT: :tz_vat - TH_VAT: :th_vat - TR_TIN: :tr_tin - UG_TIN: :ug_tin - UA_VAT: :ua_vat - AE_TRN: :ae_trn - US_EIN: :us_ein - UY_RUC: :uy_ruc - UZ_TIN: :uz_tin - UZ_VAT: :uz_vat - VE_RIF: :ve_rif - VN_TIN: :vn_tin - ZM_TIN: :zm_tin - ZW_TIN: :zw_tin - SR_FIN: :sr_fin - XI_VAT: :xi_vat - - def self?.values: -> ::Array[WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndMemberID::BillingAddress::tax_id_type] - end - end - - type line_item = - { label: String, unit_price: Float, quantity: Float? } - - class LineItem < WhopSDK::Internal::Type::BaseModel - attr_accessor label: String - - attr_accessor unit_price: Float - - attr_accessor quantity: Float? - - def initialize: ( - label: String, - unit_price: Float, - ?quantity: Float? - ) -> void - - def to_hash: -> { - label: String, - unit_price: Float, - quantity: Float? - } - end - end - - type create_invoice_input_with_product_id_and_email_address = - { - collection_method: WhopSDK::Models::collection_method, - company_id: String, - due_date: Time, - email_address: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan, - product_id: String, - automatically_finalizes_at: Time?, - billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress?, - charge_buyer_fee: bool?, - customer_name: String?, - line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem]?, - mailing_address_id: String?, - payment_method_id: String?, - payment_token_id: String? - } - - class CreateInvoiceInputWithProductIDAndEmailAddress < WhopSDK::Internal::Type::BaseModel - attr_accessor collection_method: WhopSDK::Models::collection_method - - attr_accessor company_id: String - - attr_accessor due_date: Time - - attr_accessor email_address: String - - attr_accessor plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan - - attr_accessor product_id: String - - attr_accessor automatically_finalizes_at: Time? - - attr_accessor billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress? - - attr_accessor charge_buyer_fee: bool? - - attr_accessor customer_name: String? - - attr_accessor line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem]? - - attr_accessor mailing_address_id: String? - - attr_accessor payment_method_id: String? - - attr_accessor payment_token_id: String? - - def initialize: ( - collection_method: WhopSDK::Models::collection_method, - company_id: String, - due_date: Time, - email_address: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan, - product_id: String, - ?automatically_finalizes_at: Time?, - ?billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress?, - ?charge_buyer_fee: bool?, - ?customer_name: String?, - ?line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem]?, - ?mailing_address_id: String?, - ?payment_method_id: String?, - ?payment_token_id: String? - ) -> void - - def to_hash: -> { - collection_method: WhopSDK::Models::collection_method, - company_id: String, - due_date: Time, - email_address: String, - plan: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan, - product_id: String, - automatically_finalizes_at: Time?, - billing_address: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress?, - charge_buyer_fee: bool?, - customer_name: String?, - line_items: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::LineItem]?, - mailing_address_id: String?, - payment_method_id: String?, - payment_token_id: String? - } - - type plan = - { - billing_period: Integer?, - custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::CustomField]?, - description: String?, - expiration_days: Integer?, - initial_price: Float?, - internal_notes: String?, - legacy_payment_method_controls: bool?, - payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type?, - release_method: WhopSDK::Models::release_method?, - renewal_price: Float?, - stock: Integer?, - trial_period_days: Integer?, - unlimited_stock: bool?, - visibility: WhopSDK::Models::visibility? - } - - class Plan < WhopSDK::Internal::Type::BaseModel - attr_accessor billing_period: Integer? - - attr_accessor custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::CustomField]? - - attr_accessor description: String? - - attr_accessor expiration_days: Integer? - - attr_accessor initial_price: Float? - - attr_accessor internal_notes: String? - - attr_accessor legacy_payment_method_controls: bool? - - attr_accessor payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration? - - attr_accessor plan_type: WhopSDK::Models::plan_type? - - attr_accessor release_method: WhopSDK::Models::release_method? - - attr_accessor renewal_price: Float? - - attr_accessor stock: Integer? - - attr_accessor trial_period_days: Integer? - - attr_accessor unlimited_stock: bool? - - attr_accessor visibility: WhopSDK::Models::visibility? - - def initialize: ( - ?billing_period: Integer?, - ?custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::CustomField]?, - ?description: String?, - ?expiration_days: Integer?, - ?initial_price: Float?, - ?internal_notes: String?, - ?legacy_payment_method_controls: bool?, - ?payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration?, - ?plan_type: WhopSDK::Models::plan_type?, - ?release_method: WhopSDK::Models::release_method?, - ?renewal_price: Float?, - ?stock: Integer?, - ?trial_period_days: Integer?, - ?unlimited_stock: bool?, - ?visibility: WhopSDK::Models::visibility? - ) -> void - - def to_hash: -> { - billing_period: Integer?, - custom_fields: ::Array[WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::CustomField]?, - description: String?, - expiration_days: Integer?, - initial_price: Float?, - internal_notes: String?, - legacy_payment_method_controls: bool?, - payment_method_configuration: WhopSDK::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::Plan::PaymentMethodConfiguration?, - plan_type: WhopSDK::Models::plan_type?, - release_method: WhopSDK::Models::release_method?, - renewal_price: Float?, - stock: Integer?, - trial_period_days: Integer?, - unlimited_stock: bool?, - visibility: WhopSDK::Models::visibility? - } - - type custom_field = - { - field_type: :text, - name: String, - id: String?, - order: Integer?, - placeholder: String?, - required: bool? - } - - class CustomField < WhopSDK::Internal::Type::BaseModel - attr_accessor field_type: :text - - attr_accessor name: String - - attr_accessor id: String? - - attr_accessor order: Integer? - - attr_accessor placeholder: String? - - attr_accessor required: bool? - - def initialize: ( - name: String, - ?id: String?, - ?order: Integer?, - ?placeholder: String?, - ?required: bool?, - ?field_type: :text - ) -> void - - def to_hash: -> { - field_type: :text, - name: String, - id: String?, - order: Integer?, - placeholder: String?, - required: bool? - } - end - - type payment_method_configuration = - { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - } - - class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel - attr_accessor disabled: ::Array[WhopSDK::Models::payment_method_types] - - attr_accessor enabled: ::Array[WhopSDK::Models::payment_method_types] - - attr_accessor include_platform_defaults: bool - - def initialize: ( - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - ) -> void - - def to_hash: -> { - disabled: ::Array[WhopSDK::Models::payment_method_types], - enabled: ::Array[WhopSDK::Models::payment_method_types], - include_platform_defaults: bool - } - end - end - - type billing_address = - { - city: String?, - country: String?, - :line1 => String?, - :line2 => String?, - name: String?, - phone: String?, - postal_code: String?, - state: String?, - tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::tax_id_type?, - tax_id_value: String? - } - - class BillingAddress < WhopSDK::Internal::Type::BaseModel - attr_accessor city: String? - - attr_accessor country: String? - - attr_accessor line1: String? - - attr_accessor line2: String? - - attr_accessor name: String? - - attr_accessor phone: String? - - attr_accessor postal_code: String? - - attr_accessor state: String? - - attr_accessor tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::tax_id_type? - - attr_accessor tax_id_value: String? - - def initialize: ( - ?city: String?, - ?country: String?, - ?line1: String?, - ?line2: String?, - ?name: String?, - ?phone: String?, - ?postal_code: String?, - ?state: String?, - ?tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::tax_id_type?, - ?tax_id_value: String? - ) -> void - - def to_hash: -> { - city: String?, - country: String?, - :line1 => String?, - :line2 => String?, - name: String?, - phone: String?, - postal_code: String?, - state: String?, - tax_id_type: WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::tax_id_type?, - tax_id_value: String? - } - - type tax_id_type = - :ad_nrt - | :ao_tin - | :ar_cuit - | :am_tin - | :aw_tin - | :au_abn - | :au_arn - | :eu_vat - | :az_tin - | :bs_tin - | :bh_vat - | :bd_bin - | :bb_tin - | :by_tin - | :bj_ifu - | :bo_tin - | :ba_tin - | :br_cnpj - | :br_cpf - | :bg_uic - | :bf_ifu - | :kh_tin - | :cm_niu - | :ca_bn - | :ca_gst_hst - | :ca_pst_bc - | :ca_pst_mb - | :ca_pst_sk - | :ca_qst - | :cv_nif - | :cl_tin - | :cn_tin - | :co_nit - | :cd_nif - | :cr_tin - | :hr_oib - | :do_rcn - | :ec_ruc - | :eg_tin - | :sv_nit - | :et_tin - | :eu_oss_vat - | :ge_vat - | :de_stn - | :gb_vat - | :gn_nif - | :hk_br - | :hu_tin - | :is_vat - | :in_gst - | :id_npwp - | :il_vat - | :jp_cn - | :jp_rn - | :jp_trn - | :kz_bin - | :ke_pin - | :kg_tin - | :la_tin - | :li_uid - | :li_vat - | :my_frp - | :my_itn - | :my_sst - | :mr_nif - | :mx_rfc - | :md_vat - | :me_pib - | :ma_vat - | :np_pan - | :nz_gst - | :ng_tin - | :mk_vat - | :no_vat - | :no_voec - | :om_vat - | :pe_ruc - | :ph_tin - | :pl_nip - | :ro_tin - | :ru_inn - | :ru_kpp - | :sa_vat - | :sn_ninea - | :rs_pib - | :sg_gst - | :sg_uen - | :si_tin - | :za_vat - | :kr_brn - | :es_cif - | :ch_uid - | :ch_vat - | :tw_vat - | :tj_tin - | :tz_vat - | :th_vat - | :tr_tin - | :ug_tin - | :ua_vat - | :ae_trn - | :us_ein - | :uy_ruc - | :uz_tin - | :uz_vat - | :ve_rif - | :vn_tin - | :zm_tin - | :zw_tin - | :sr_fin - | :xi_vat - - module TaxIDType - extend WhopSDK::Internal::Type::Enum - - AD_NRT: :ad_nrt - AO_TIN: :ao_tin - AR_CUIT: :ar_cuit - AM_TIN: :am_tin - AW_TIN: :aw_tin - AU_ABN: :au_abn - AU_ARN: :au_arn - EU_VAT: :eu_vat - AZ_TIN: :az_tin - BS_TIN: :bs_tin - BH_VAT: :bh_vat - BD_BIN: :bd_bin - BB_TIN: :bb_tin - BY_TIN: :by_tin - BJ_IFU: :bj_ifu - BO_TIN: :bo_tin - BA_TIN: :ba_tin - BR_CNPJ: :br_cnpj - BR_CPF: :br_cpf - BG_UIC: :bg_uic - BF_IFU: :bf_ifu - KH_TIN: :kh_tin - CM_NIU: :cm_niu - CA_BN: :ca_bn - CA_GST_HST: :ca_gst_hst - CA_PST_BC: :ca_pst_bc - CA_PST_MB: :ca_pst_mb - CA_PST_SK: :ca_pst_sk - CA_QST: :ca_qst - CV_NIF: :cv_nif - CL_TIN: :cl_tin - CN_TIN: :cn_tin - CO_NIT: :co_nit - CD_NIF: :cd_nif - CR_TIN: :cr_tin - HR_OIB: :hr_oib - DO_RCN: :do_rcn - EC_RUC: :ec_ruc - EG_TIN: :eg_tin - SV_NIT: :sv_nit - ET_TIN: :et_tin - EU_OSS_VAT: :eu_oss_vat - GE_VAT: :ge_vat - DE_STN: :de_stn - GB_VAT: :gb_vat - GN_NIF: :gn_nif - HK_BR: :hk_br - HU_TIN: :hu_tin - IS_VAT: :is_vat - IN_GST: :in_gst - ID_NPWP: :id_npwp - IL_VAT: :il_vat - JP_CN: :jp_cn - JP_RN: :jp_rn - JP_TRN: :jp_trn - KZ_BIN: :kz_bin - KE_PIN: :ke_pin - KG_TIN: :kg_tin - LA_TIN: :la_tin - LI_UID: :li_uid - LI_VAT: :li_vat - MY_FRP: :my_frp - MY_ITN: :my_itn - MY_SST: :my_sst - MR_NIF: :mr_nif - MX_RFC: :mx_rfc - MD_VAT: :md_vat - ME_PIB: :me_pib - MA_VAT: :ma_vat - NP_PAN: :np_pan - NZ_GST: :nz_gst - NG_TIN: :ng_tin - MK_VAT: :mk_vat - NO_VAT: :no_vat - NO_VOEC: :no_voec - OM_VAT: :om_vat - PE_RUC: :pe_ruc - PH_TIN: :ph_tin - PL_NIP: :pl_nip - RO_TIN: :ro_tin - RU_INN: :ru_inn - RU_KPP: :ru_kpp - SA_VAT: :sa_vat - SN_NINEA: :sn_ninea - RS_PIB: :rs_pib - SG_GST: :sg_gst - SG_UEN: :sg_uen - SI_TIN: :si_tin - ZA_VAT: :za_vat - KR_BRN: :kr_brn - ES_CIF: :es_cif - CH_UID: :ch_uid - CH_VAT: :ch_vat - TW_VAT: :tw_vat - TJ_TIN: :tj_tin - TZ_VAT: :tz_vat - TH_VAT: :th_vat - TR_TIN: :tr_tin - UG_TIN: :ug_tin - UA_VAT: :ua_vat - AE_TRN: :ae_trn - US_EIN: :us_ein - UY_RUC: :uy_ruc - UZ_TIN: :uz_tin - UZ_VAT: :uz_vat - VE_RIF: :ve_rif - VN_TIN: :vn_tin - ZM_TIN: :zm_tin - ZW_TIN: :zw_tin - SR_FIN: :sr_fin - XI_VAT: :xi_vat - - def self?.values: -> ::Array[WhopSDK::Models::InvoiceCreateParams::Body::CreateInvoiceInputWithProductIDAndEmailAddress::BillingAddress::tax_id_type] - end end type line_item = diff --git a/sig/whop_sdk/models/invoice_delete_params.rbs b/sig/whop_sdk/models/invoice_delete_params.rbs new file mode 100644 index 00000000..77fd6b99 --- /dev/null +++ b/sig/whop_sdk/models/invoice_delete_params.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Models + type invoice_delete_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class InvoiceDeleteParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/invoice_delete_response.rbs b/sig/whop_sdk/models/invoice_delete_response.rbs new file mode 100644 index 00000000..97dc6c50 --- /dev/null +++ b/sig/whop_sdk/models/invoice_delete_response.rbs @@ -0,0 +1,5 @@ +module WhopSDK + module Models + InvoiceDeleteResponse: WhopSDK::Internal::Type::Converter + end +end diff --git a/sig/whop_sdk/models/invoice_mark_paid_params.rbs b/sig/whop_sdk/models/invoice_mark_paid_params.rbs new file mode 100644 index 00000000..ea5e1b3b --- /dev/null +++ b/sig/whop_sdk/models/invoice_mark_paid_params.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Models + type invoice_mark_paid_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class InvoiceMarkPaidParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/invoice_mark_paid_response.rbs b/sig/whop_sdk/models/invoice_mark_paid_response.rbs new file mode 100644 index 00000000..cd2e0bb7 --- /dev/null +++ b/sig/whop_sdk/models/invoice_mark_paid_response.rbs @@ -0,0 +1,5 @@ +module WhopSDK + module Models + InvoiceMarkPaidResponse: WhopSDK::Internal::Type::Converter + end +end diff --git a/sig/whop_sdk/models/invoice_mark_uncollectible_params.rbs b/sig/whop_sdk/models/invoice_mark_uncollectible_params.rbs new file mode 100644 index 00000000..b2576719 --- /dev/null +++ b/sig/whop_sdk/models/invoice_mark_uncollectible_params.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Models + type invoice_mark_uncollectible_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class InvoiceMarkUncollectibleParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + def initialize: ( + id: String, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { id: String, request_options: WhopSDK::RequestOptions } + end + end +end diff --git a/sig/whop_sdk/models/invoice_mark_uncollectible_response.rbs b/sig/whop_sdk/models/invoice_mark_uncollectible_response.rbs new file mode 100644 index 00000000..42aced00 --- /dev/null +++ b/sig/whop_sdk/models/invoice_mark_uncollectible_response.rbs @@ -0,0 +1,5 @@ +module WhopSDK + module Models + InvoiceMarkUncollectibleResponse: WhopSDK::Internal::Type::Converter + end +end diff --git a/sig/whop_sdk/models/invoice_update_params.rbs b/sig/whop_sdk/models/invoice_update_params.rbs new file mode 100644 index 00000000..f7c41294 --- /dev/null +++ b/sig/whop_sdk/models/invoice_update_params.rbs @@ -0,0 +1,322 @@ +module WhopSDK + module Models + type invoice_update_params = + { + id: String, + automatically_finalizes_at: Time?, + billing_address: WhopSDK::InvoiceUpdateParams::BillingAddress?, + charge_buyer_fee: bool?, + collection_method: WhopSDK::Models::collection_method?, + customer_name: String?, + due_date: Time?, + email_address: String?, + line_items: ::Array[WhopSDK::InvoiceUpdateParams::LineItem]?, + mailing_address_id: String?, + member_id: String?, + payment_method_id: String?, + plan: WhopSDK::InvoiceUpdateParams::Plan? + } + & WhopSDK::Internal::Type::request_parameters + + class InvoiceUpdateParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor id: String + + attr_accessor automatically_finalizes_at: Time? + + attr_accessor billing_address: WhopSDK::InvoiceUpdateParams::BillingAddress? + + attr_accessor charge_buyer_fee: bool? + + attr_accessor collection_method: WhopSDK::Models::collection_method? + + attr_accessor customer_name: String? + + attr_accessor due_date: Time? + + attr_accessor email_address: String? + + attr_accessor line_items: ::Array[WhopSDK::InvoiceUpdateParams::LineItem]? + + attr_accessor mailing_address_id: String? + + attr_accessor member_id: String? + + attr_accessor payment_method_id: String? + + attr_accessor plan: WhopSDK::InvoiceUpdateParams::Plan? + + def initialize: ( + id: String, + ?automatically_finalizes_at: Time?, + ?billing_address: WhopSDK::InvoiceUpdateParams::BillingAddress?, + ?charge_buyer_fee: bool?, + ?collection_method: WhopSDK::Models::collection_method?, + ?customer_name: String?, + ?due_date: Time?, + ?email_address: String?, + ?line_items: ::Array[WhopSDK::InvoiceUpdateParams::LineItem]?, + ?mailing_address_id: String?, + ?member_id: String?, + ?payment_method_id: String?, + ?plan: WhopSDK::InvoiceUpdateParams::Plan?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + id: String, + automatically_finalizes_at: Time?, + billing_address: WhopSDK::InvoiceUpdateParams::BillingAddress?, + charge_buyer_fee: bool?, + collection_method: WhopSDK::Models::collection_method?, + customer_name: String?, + due_date: Time?, + email_address: String?, + line_items: ::Array[WhopSDK::InvoiceUpdateParams::LineItem]?, + mailing_address_id: String?, + member_id: String?, + payment_method_id: String?, + plan: WhopSDK::InvoiceUpdateParams::Plan?, + request_options: WhopSDK::RequestOptions + } + + type billing_address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + name: String?, + phone: String?, + postal_code: String?, + state: String?, + tax_id_type: WhopSDK::Models::tax_identifier_type?, + tax_id_value: String? + } + + class BillingAddress < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor name: String? + + attr_accessor phone: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + attr_accessor tax_id_type: WhopSDK::Models::tax_identifier_type? + + attr_accessor tax_id_value: String? + + def initialize: ( + ?city: String?, + ?country: String?, + ?line1: String?, + ?line2: String?, + ?name: String?, + ?phone: String?, + ?postal_code: String?, + ?state: String?, + ?tax_id_type: WhopSDK::Models::tax_identifier_type?, + ?tax_id_value: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + name: String?, + phone: String?, + postal_code: String?, + state: String?, + tax_id_type: WhopSDK::Models::tax_identifier_type?, + tax_id_value: String? + } + end + + type line_item = { label: String, unit_price: Float, quantity: Float? } + + class LineItem < WhopSDK::Internal::Type::BaseModel + attr_accessor label: String + + attr_accessor unit_price: Float + + attr_accessor quantity: Float? + + def initialize: ( + label: String, + unit_price: Float, + ?quantity: Float? + ) -> void + + def to_hash: -> { label: String, unit_price: Float, quantity: Float? } + end + + type plan = + { + billing_period: Integer?, + custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]?, + description: String?, + expiration_days: Integer?, + initial_price: Float?, + internal_notes: String?, + legacy_payment_method_controls: bool?, + payment_method_configuration: WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration?, + plan_type: WhopSDK::Models::plan_type?, + release_method: WhopSDK::Models::release_method?, + renewal_price: Float?, + stock: Integer?, + trial_period_days: Integer?, + unlimited_stock: bool?, + visibility: WhopSDK::Models::visibility? + } + + class Plan < WhopSDK::Internal::Type::BaseModel + attr_accessor billing_period: Integer? + + attr_accessor custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]? + + attr_accessor description: String? + + attr_accessor expiration_days: Integer? + + attr_accessor initial_price: Float? + + attr_accessor internal_notes: String? + + attr_accessor legacy_payment_method_controls: bool? + + attr_accessor payment_method_configuration: WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration? + + attr_accessor plan_type: WhopSDK::Models::plan_type? + + attr_accessor release_method: WhopSDK::Models::release_method? + + attr_accessor renewal_price: Float? + + attr_accessor stock: Integer? + + attr_accessor trial_period_days: Integer? + + attr_accessor unlimited_stock: bool? + + attr_accessor visibility: WhopSDK::Models::visibility? + + def initialize: ( + ?billing_period: Integer?, + ?custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]?, + ?description: String?, + ?expiration_days: Integer?, + ?initial_price: Float?, + ?internal_notes: String?, + ?legacy_payment_method_controls: bool?, + ?payment_method_configuration: WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration?, + ?plan_type: WhopSDK::Models::plan_type?, + ?release_method: WhopSDK::Models::release_method?, + ?renewal_price: Float?, + ?stock: Integer?, + ?trial_period_days: Integer?, + ?unlimited_stock: bool?, + ?visibility: WhopSDK::Models::visibility? + ) -> void + + def to_hash: -> { + billing_period: Integer?, + custom_fields: ::Array[WhopSDK::InvoiceUpdateParams::Plan::CustomField]?, + description: String?, + expiration_days: Integer?, + initial_price: Float?, + internal_notes: String?, + legacy_payment_method_controls: bool?, + payment_method_configuration: WhopSDK::InvoiceUpdateParams::Plan::PaymentMethodConfiguration?, + plan_type: WhopSDK::Models::plan_type?, + release_method: WhopSDK::Models::release_method?, + renewal_price: Float?, + stock: Integer?, + trial_period_days: Integer?, + unlimited_stock: bool?, + visibility: WhopSDK::Models::visibility? + } + + type custom_field = + { + field_type: :text, + name: String, + id: String?, + order: Integer?, + placeholder: String?, + required: bool? + } + + class CustomField < WhopSDK::Internal::Type::BaseModel + attr_accessor field_type: :text + + attr_accessor name: String + + attr_accessor id: String? + + attr_accessor order: Integer? + + attr_accessor placeholder: String? + + attr_accessor required: bool? + + def initialize: ( + name: String, + ?id: String?, + ?order: Integer?, + ?placeholder: String?, + ?required: bool?, + ?field_type: :text + ) -> void + + def to_hash: -> { + field_type: :text, + name: String, + id: String?, + order: Integer?, + placeholder: String?, + required: bool? + } + end + + type payment_method_configuration = + { + disabled: ::Array[WhopSDK::Models::payment_method_types], + enabled: ::Array[WhopSDK::Models::payment_method_types], + include_platform_defaults: bool + } + + class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel + attr_accessor disabled: ::Array[WhopSDK::Models::payment_method_types] + + attr_accessor enabled: ::Array[WhopSDK::Models::payment_method_types] + + attr_accessor include_platform_defaults: bool + + def initialize: ( + disabled: ::Array[WhopSDK::Models::payment_method_types], + enabled: ::Array[WhopSDK::Models::payment_method_types], + include_platform_defaults: bool + ) -> void + + def to_hash: -> { + disabled: ::Array[WhopSDK::Models::payment_method_types], + enabled: ::Array[WhopSDK::Models::payment_method_types], + include_platform_defaults: bool + } + end + end + end + end +end diff --git a/sig/whop_sdk/models/membership.rbs b/sig/whop_sdk/models/membership.rbs index 24a32617..4f80b5cc 100644 --- a/sig/whop_sdk/models/membership.rbs +++ b/sig/whop_sdk/models/membership.rbs @@ -15,7 +15,7 @@ module WhopSDK license_key: String?, manage_url: String?, member: WhopSDK::Membership::Member?, - metadata: ::Hash[Symbol, top], + metadata: ::Hash[Symbol, top]?, payment_collection_paused: bool, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, @@ -54,7 +54,7 @@ module WhopSDK attr_accessor member: WhopSDK::Membership::Member? - attr_accessor metadata: ::Hash[Symbol, top] + attr_accessor metadata: ::Hash[Symbol, top]? attr_accessor payment_collection_paused: bool @@ -88,7 +88,7 @@ module WhopSDK license_key: String?, manage_url: String?, member: WhopSDK::Membership::Member?, - metadata: ::Hash[Symbol, top], + metadata: ::Hash[Symbol, top]?, payment_collection_paused: bool, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, @@ -114,7 +114,7 @@ module WhopSDK license_key: String?, manage_url: String?, member: WhopSDK::Membership::Member?, - metadata: ::Hash[Symbol, top], + metadata: ::Hash[Symbol, top]?, payment_collection_paused: bool, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, diff --git a/sig/whop_sdk/models/membership_list_response.rbs b/sig/whop_sdk/models/membership_list_response.rbs index a7eea9ad..5901f5fe 100644 --- a/sig/whop_sdk/models/membership_list_response.rbs +++ b/sig/whop_sdk/models/membership_list_response.rbs @@ -14,7 +14,7 @@ module WhopSDK license_key: String?, manage_url: String?, member: WhopSDK::Models::MembershipListResponse::Member?, - metadata: ::Hash[Symbol, top], + metadata: ::Hash[Symbol, top]?, payment_collection_paused: bool, plan: WhopSDK::Models::MembershipListResponse::Plan, product: WhopSDK::Models::MembershipListResponse::Product, @@ -51,7 +51,7 @@ module WhopSDK attr_accessor member: WhopSDK::Models::MembershipListResponse::Member? - attr_accessor metadata: ::Hash[Symbol, top] + attr_accessor metadata: ::Hash[Symbol, top]? attr_accessor payment_collection_paused: bool @@ -84,7 +84,7 @@ module WhopSDK license_key: String?, manage_url: String?, member: WhopSDK::Models::MembershipListResponse::Member?, - metadata: ::Hash[Symbol, top], + metadata: ::Hash[Symbol, top]?, payment_collection_paused: bool, plan: WhopSDK::Models::MembershipListResponse::Plan, product: WhopSDK::Models::MembershipListResponse::Product, @@ -109,7 +109,7 @@ module WhopSDK license_key: String?, manage_url: String?, member: WhopSDK::Models::MembershipListResponse::Member?, - metadata: ::Hash[Symbol, top], + metadata: ::Hash[Symbol, top]?, payment_collection_paused: bool, plan: WhopSDK::Models::MembershipListResponse::Plan, product: WhopSDK::Models::MembershipListResponse::Product, diff --git a/sig/whop_sdk/models/payment_method_types.rbs b/sig/whop_sdk/models/payment_method_types.rbs index 75d73dec..01f38c35 100644 --- a/sig/whop_sdk/models/payment_method_types.rbs +++ b/sig/whop_sdk/models/payment_method_types.rbs @@ -11,6 +11,7 @@ module WhopSDK | :apple_pay | :au_becs_debit | :bacs_debit + | :bancolombia | :bancontact | :billie | :bizum @@ -25,6 +26,7 @@ module WhopSDK | :custom | :customer_balance | :demo_pay + | :efecty | :eps | :eu_bank_transfer | :fpx @@ -43,10 +45,12 @@ module WhopSDK | :kriya | :link | :mb_way + | :mercado_pago | :mobilepay | :mondu | :multibanco | :naver_pay + | :nequi | :netbanking | :ng_bank | :ng_bank_transfer @@ -57,6 +61,7 @@ module WhopSDK | :nz_bank_account | :oxxo | :p24 + | :pse | :pay_by_bank | :payco | :paynow @@ -79,6 +84,7 @@ module WhopSDK | :shopeepay | :sofort | :south_korea_market + | :spei | :splitit | :sunbit | :swish @@ -106,6 +112,7 @@ module WhopSDK APPLE_PAY: :apple_pay AU_BECS_DEBIT: :au_becs_debit BACS_DEBIT: :bacs_debit + BANCOLOMBIA: :bancolombia BANCONTACT: :bancontact BILLIE: :billie BIZUM: :bizum @@ -120,6 +127,7 @@ module WhopSDK CUSTOM: :custom CUSTOMER_BALANCE: :customer_balance DEMO_PAY: :demo_pay + EFECTY: :efecty EPS: :eps EU_BANK_TRANSFER: :eu_bank_transfer FPX: :fpx @@ -138,10 +146,12 @@ module WhopSDK KRIYA: :kriya LINK: :link MB_WAY: :mb_way + MERCADO_PAGO: :mercado_pago MOBILEPAY: :mobilepay MONDU: :mondu MULTIBANCO: :multibanco NAVER_PAY: :naver_pay + NEQUI: :nequi NETBANKING: :netbanking NG_BANK: :ng_bank NG_BANK_TRANSFER: :ng_bank_transfer @@ -152,6 +162,7 @@ module WhopSDK NZ_BANK_ACCOUNT: :nz_bank_account OXXO: :oxxo P24: :p24 + PSE: :pse PAY_BY_BANK: :pay_by_bank PAYCO: :payco PAYNOW: :paynow @@ -174,6 +185,7 @@ module WhopSDK SHOPEEPAY: :shopeepay SOFORT: :sofort SOUTH_KOREA_MARKET: :south_korea_market + SPEI: :spei SPLITIT: :splitit SUNBIT: :sunbit SWISH: :swish diff --git a/sig/whop_sdk/models/payment_provider.rbs b/sig/whop_sdk/models/payment_provider.rbs index e83842c2..c9a923f9 100644 --- a/sig/whop_sdk/models/payment_provider.rbs +++ b/sig/whop_sdk/models/payment_provider.rbs @@ -15,6 +15,7 @@ module WhopSDK | :airwallex | :coinflow | :sequra + | :dlocal module PaymentProvider extend WhopSDK::Internal::Type::Enum @@ -33,6 +34,7 @@ module WhopSDK AIRWALLEX: :airwallex COINFLOW: :coinflow SEQURA: :sequra + DLOCAL: :dlocal def self?.values: -> ::Array[WhopSDK::Models::payment_provider] end diff --git a/sig/whop_sdk/models/plan_create_params.rbs b/sig/whop_sdk/models/plan_create_params.rbs index 28697f8c..b0c97d08 100644 --- a/sig/whop_sdk/models/plan_create_params.rbs +++ b/sig/whop_sdk/models/plan_create_params.rbs @@ -5,6 +5,7 @@ module WhopSDK company_id: String, product_id: String, billing_period: Integer?, + checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, description: String?, @@ -37,6 +38,8 @@ module WhopSDK attr_accessor billing_period: Integer? + attr_accessor checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling? + attr_accessor currency: WhopSDK::Models::currency? attr_accessor custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]? @@ -79,6 +82,7 @@ module WhopSDK company_id: String, product_id: String, ?billing_period: Integer?, + ?checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling?, ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, ?description: String?, @@ -105,6 +109,7 @@ module WhopSDK company_id: String, product_id: String, billing_period: Integer?, + checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, description: String?, @@ -127,6 +132,33 @@ module WhopSDK request_options: WhopSDK::RequestOptions } + type checkout_styling = + { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + attr_accessor border_style: WhopSDK::Models::checkout_shape? + + attr_accessor button_color: String? + + attr_accessor font_family: WhopSDK::Models::checkout_font? + + def initialize: ( + ?border_style: WhopSDK::Models::checkout_shape?, + ?button_color: String?, + ?font_family: WhopSDK::Models::checkout_font? + ) -> void + + def to_hash: -> { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + end + type custom_field = { field_type: :text, diff --git a/sig/whop_sdk/models/plan_update_params.rbs b/sig/whop_sdk/models/plan_update_params.rbs index e9b11416..b12b41ff 100644 --- a/sig/whop_sdk/models/plan_update_params.rbs +++ b/sig/whop_sdk/models/plan_update_params.rbs @@ -4,6 +4,7 @@ module WhopSDK { id: String, billing_period: Integer?, + checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]?, description: String?, @@ -34,6 +35,8 @@ module WhopSDK attr_accessor billing_period: Integer? + attr_accessor checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling? + attr_accessor currency: WhopSDK::Models::currency? attr_accessor custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]? @@ -75,6 +78,7 @@ module WhopSDK def initialize: ( id: String, ?billing_period: Integer?, + ?checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling?, ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]?, ?description: String?, @@ -100,6 +104,7 @@ module WhopSDK def to_hash: -> { id: String, billing_period: Integer?, + checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling?, currency: WhopSDK::Models::currency?, custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]?, description: String?, @@ -122,6 +127,33 @@ module WhopSDK request_options: WhopSDK::RequestOptions } + type checkout_styling = + { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + + class CheckoutStyling < WhopSDK::Internal::Type::BaseModel + attr_accessor border_style: WhopSDK::Models::checkout_shape? + + attr_accessor button_color: String? + + attr_accessor font_family: WhopSDK::Models::checkout_font? + + def initialize: ( + ?border_style: WhopSDK::Models::checkout_shape?, + ?button_color: String?, + ?font_family: WhopSDK::Models::checkout_font? + ) -> void + + def to_hash: -> { + border_style: WhopSDK::Models::checkout_shape?, + button_color: String?, + font_family: WhopSDK::Models::checkout_font? + } + end + type custom_field = { field_type: :text, diff --git a/sig/whop_sdk/models/tax_identifier_type.rbs b/sig/whop_sdk/models/tax_identifier_type.rbs new file mode 100644 index 00000000..fd794af4 --- /dev/null +++ b/sig/whop_sdk/models/tax_identifier_type.rbs @@ -0,0 +1,234 @@ +module WhopSDK + module Models + type tax_identifier_type = + :ad_nrt + | :ao_tin + | :ar_cuit + | :am_tin + | :aw_tin + | :au_abn + | :au_arn + | :eu_vat + | :az_tin + | :bs_tin + | :bh_vat + | :bd_bin + | :bb_tin + | :by_tin + | :bj_ifu + | :bo_tin + | :ba_tin + | :br_cnpj + | :br_cpf + | :bg_uic + | :bf_ifu + | :kh_tin + | :cm_niu + | :ca_bn + | :ca_gst_hst + | :ca_pst_bc + | :ca_pst_mb + | :ca_pst_sk + | :ca_qst + | :cv_nif + | :cl_tin + | :cn_tin + | :co_nit + | :cd_nif + | :cr_tin + | :hr_oib + | :do_rcn + | :ec_ruc + | :eg_tin + | :sv_nit + | :et_tin + | :eu_oss_vat + | :ge_vat + | :de_stn + | :gb_vat + | :gn_nif + | :hk_br + | :hu_tin + | :is_vat + | :in_gst + | :id_npwp + | :il_vat + | :jp_cn + | :jp_rn + | :jp_trn + | :kz_bin + | :ke_pin + | :kg_tin + | :la_tin + | :li_uid + | :li_vat + | :my_frp + | :my_itn + | :my_sst + | :mr_nif + | :mx_rfc + | :md_vat + | :me_pib + | :ma_vat + | :np_pan + | :nz_gst + | :ng_tin + | :mk_vat + | :no_vat + | :no_voec + | :om_vat + | :pe_ruc + | :ph_tin + | :pl_nip + | :ro_tin + | :ru_inn + | :ru_kpp + | :sa_vat + | :sn_ninea + | :rs_pib + | :sg_gst + | :sg_uen + | :si_tin + | :za_vat + | :kr_brn + | :es_cif + | :ch_uid + | :ch_vat + | :tw_vat + | :tj_tin + | :tz_vat + | :th_vat + | :tr_tin + | :ug_tin + | :ua_vat + | :ae_trn + | :us_ein + | :uy_ruc + | :uz_tin + | :uz_vat + | :ve_rif + | :vn_tin + | :zm_tin + | :zw_tin + | :sr_fin + | :xi_vat + + module TaxIdentifierType + extend WhopSDK::Internal::Type::Enum + + AD_NRT: :ad_nrt + AO_TIN: :ao_tin + AR_CUIT: :ar_cuit + AM_TIN: :am_tin + AW_TIN: :aw_tin + AU_ABN: :au_abn + AU_ARN: :au_arn + EU_VAT: :eu_vat + AZ_TIN: :az_tin + BS_TIN: :bs_tin + BH_VAT: :bh_vat + BD_BIN: :bd_bin + BB_TIN: :bb_tin + BY_TIN: :by_tin + BJ_IFU: :bj_ifu + BO_TIN: :bo_tin + BA_TIN: :ba_tin + BR_CNPJ: :br_cnpj + BR_CPF: :br_cpf + BG_UIC: :bg_uic + BF_IFU: :bf_ifu + KH_TIN: :kh_tin + CM_NIU: :cm_niu + CA_BN: :ca_bn + CA_GST_HST: :ca_gst_hst + CA_PST_BC: :ca_pst_bc + CA_PST_MB: :ca_pst_mb + CA_PST_SK: :ca_pst_sk + CA_QST: :ca_qst + CV_NIF: :cv_nif + CL_TIN: :cl_tin + CN_TIN: :cn_tin + CO_NIT: :co_nit + CD_NIF: :cd_nif + CR_TIN: :cr_tin + HR_OIB: :hr_oib + DO_RCN: :do_rcn + EC_RUC: :ec_ruc + EG_TIN: :eg_tin + SV_NIT: :sv_nit + ET_TIN: :et_tin + EU_OSS_VAT: :eu_oss_vat + GE_VAT: :ge_vat + DE_STN: :de_stn + GB_VAT: :gb_vat + GN_NIF: :gn_nif + HK_BR: :hk_br + HU_TIN: :hu_tin + IS_VAT: :is_vat + IN_GST: :in_gst + ID_NPWP: :id_npwp + IL_VAT: :il_vat + JP_CN: :jp_cn + JP_RN: :jp_rn + JP_TRN: :jp_trn + KZ_BIN: :kz_bin + KE_PIN: :ke_pin + KG_TIN: :kg_tin + LA_TIN: :la_tin + LI_UID: :li_uid + LI_VAT: :li_vat + MY_FRP: :my_frp + MY_ITN: :my_itn + MY_SST: :my_sst + MR_NIF: :mr_nif + MX_RFC: :mx_rfc + MD_VAT: :md_vat + ME_PIB: :me_pib + MA_VAT: :ma_vat + NP_PAN: :np_pan + NZ_GST: :nz_gst + NG_TIN: :ng_tin + MK_VAT: :mk_vat + NO_VAT: :no_vat + NO_VOEC: :no_voec + OM_VAT: :om_vat + PE_RUC: :pe_ruc + PH_TIN: :ph_tin + PL_NIP: :pl_nip + RO_TIN: :ro_tin + RU_INN: :ru_inn + RU_KPP: :ru_kpp + SA_VAT: :sa_vat + SN_NINEA: :sn_ninea + RS_PIB: :rs_pib + SG_GST: :sg_gst + SG_UEN: :sg_uen + SI_TIN: :si_tin + ZA_VAT: :za_vat + KR_BRN: :kr_brn + ES_CIF: :es_cif + CH_UID: :ch_uid + CH_VAT: :ch_vat + TW_VAT: :tw_vat + TJ_TIN: :tj_tin + TZ_VAT: :tz_vat + TH_VAT: :th_vat + TR_TIN: :tr_tin + UG_TIN: :ug_tin + UA_VAT: :ua_vat + AE_TRN: :ae_trn + US_EIN: :us_ein + UY_RUC: :uy_ruc + UZ_TIN: :uz_tin + UZ_VAT: :uz_vat + VE_RIF: :ve_rif + VN_TIN: :vn_tin + ZM_TIN: :zm_tin + ZW_TIN: :zw_tin + SR_FIN: :sr_fin + XI_VAT: :xi_vat + + def self?.values: -> ::Array[WhopSDK::Models::tax_identifier_type] + end + end +end diff --git a/sig/whop_sdk/resources/invoices.rbs b/sig/whop_sdk/resources/invoices.rbs index 76d12834..7b4d5494 100644 --- a/sig/whop_sdk/resources/invoices.rbs +++ b/sig/whop_sdk/resources/invoices.rbs @@ -11,6 +11,23 @@ module WhopSDK ?request_options: WhopSDK::request_opts ) -> WhopSDK::Invoice + def update: ( + String id, + ?automatically_finalizes_at: Time?, + ?billing_address: WhopSDK::InvoiceUpdateParams::BillingAddress?, + ?charge_buyer_fee: bool?, + ?collection_method: WhopSDK::Models::collection_method?, + ?customer_name: String?, + ?due_date: Time?, + ?email_address: String?, + ?line_items: ::Array[WhopSDK::InvoiceUpdateParams::LineItem]?, + ?mailing_address_id: String?, + ?member_id: String?, + ?payment_method_id: String?, + ?plan: WhopSDK::InvoiceUpdateParams::Plan?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Invoice + def list: ( ?after: String?, ?before: String?, @@ -27,6 +44,18 @@ module WhopSDK ?request_options: WhopSDK::request_opts ) -> WhopSDK::Internal::CursorPage[WhopSDK::InvoiceListItem] + def delete: (String id, ?request_options: WhopSDK::request_opts) -> bool + + def mark_paid: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> bool + + def mark_uncollectible: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> bool + def `void`: (String id, ?request_options: WhopSDK::request_opts) -> bool def initialize: (client: WhopSDK::Client) -> void diff --git a/sig/whop_sdk/resources/plans.rbs b/sig/whop_sdk/resources/plans.rbs index 4990e1c6..8d57929c 100644 --- a/sig/whop_sdk/resources/plans.rbs +++ b/sig/whop_sdk/resources/plans.rbs @@ -5,6 +5,7 @@ module WhopSDK company_id: String, product_id: String, ?billing_period: Integer?, + ?checkout_styling: WhopSDK::PlanCreateParams::CheckoutStyling?, ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::PlanCreateParams::CustomField]?, ?description: String?, @@ -35,6 +36,7 @@ module WhopSDK def update: ( String id, ?billing_period: Integer?, + ?checkout_styling: WhopSDK::PlanUpdateParams::CheckoutStyling?, ?currency: WhopSDK::Models::currency?, ?custom_fields: ::Array[WhopSDK::PlanUpdateParams::CustomField]?, ?description: String?, diff --git a/test/whop_sdk/resources/invoices_test.rb b/test/whop_sdk/resources/invoices_test.rb index 3400b017..2c0c4f92 100644 --- a/test/whop_sdk/resources/invoices_test.rb +++ b/test/whop_sdk/resources/invoices_test.rb @@ -11,8 +11,6 @@ def test_create_required_params body: { collection_method: :send_invoice, company_id: "biz_xxxxxxxxxxxxxx", - due_date: "2023-12-01T05:00:00.401Z", - member_id: "mber_xxxxxxxxxxxxx", plan: {}, product: {title: "title"} } @@ -61,6 +59,30 @@ def test_retrieve end end + def test_update + skip("Mock server tests are disabled") + + response = @whop.invoices.update("inv_xxxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Invoice + end + + assert_pattern do + response => { + id: String, + created_at: Time, + current_plan: WhopSDK::Invoice::CurrentPlan, + due_date: Time | nil, + email_address: String | nil, + fetch_invoice_token: String, + number: String, + status: WhopSDK::InvoiceStatus, + user: WhopSDK::Invoice::User | nil + } + end + end + def test_list skip("Mock server tests are disabled") @@ -92,6 +114,36 @@ def test_list end end + def test_delete + skip("Mock server tests are disabled") + + response = @whop.invoices.delete("inv_xxxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Internal::Type::Boolean + end + end + + def test_mark_paid + skip("Mock server tests are disabled") + + response = @whop.invoices.mark_paid("inv_xxxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Internal::Type::Boolean + end + end + + def test_mark_uncollectible + skip("Mock server tests are disabled") + + response = @whop.invoices.mark_uncollectible("inv_xxxxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Internal::Type::Boolean + end + end + def test_void skip("Mock server tests are disabled") diff --git a/test/whop_sdk/resources/memberships_test.rb b/test/whop_sdk/resources/memberships_test.rb index 7b05c26b..893c0c15 100644 --- a/test/whop_sdk/resources/memberships_test.rb +++ b/test/whop_sdk/resources/memberships_test.rb @@ -27,7 +27,7 @@ def test_retrieve license_key: String | nil, manage_url: String | nil, member: WhopSDK::Membership::Member | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]), + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, payment_collection_paused: WhopSDK::Internal::Type::Boolean, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, @@ -65,7 +65,7 @@ def test_update license_key: String | nil, manage_url: String | nil, member: WhopSDK::Membership::Member | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]), + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, payment_collection_paused: WhopSDK::Internal::Type::Boolean, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, @@ -109,7 +109,7 @@ def test_list license_key: String | nil, manage_url: String | nil, member: WhopSDK::Models::MembershipListResponse::Member | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]), + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, payment_collection_paused: WhopSDK::Internal::Type::Boolean, plan: WhopSDK::Models::MembershipListResponse::Plan, product: WhopSDK::Models::MembershipListResponse::Product, @@ -147,7 +147,7 @@ def test_add_free_days_required_params license_key: String | nil, manage_url: String | nil, member: WhopSDK::Membership::Member | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]), + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, payment_collection_paused: WhopSDK::Internal::Type::Boolean, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, @@ -185,7 +185,7 @@ def test_cancel license_key: String | nil, manage_url: String | nil, member: WhopSDK::Membership::Member | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]), + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, payment_collection_paused: WhopSDK::Internal::Type::Boolean, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, @@ -223,7 +223,7 @@ def test_pause license_key: String | nil, manage_url: String | nil, member: WhopSDK::Membership::Member | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]), + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, payment_collection_paused: WhopSDK::Internal::Type::Boolean, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, @@ -261,7 +261,7 @@ def test_resume license_key: String | nil, manage_url: String | nil, member: WhopSDK::Membership::Member | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]), + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, payment_collection_paused: WhopSDK::Internal::Type::Boolean, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product, @@ -299,7 +299,7 @@ def test_uncancel license_key: String | nil, manage_url: String | nil, member: WhopSDK::Membership::Member | nil, - metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]), + metadata: ^(WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown]) | nil, payment_collection_paused: WhopSDK::Internal::Type::Boolean, plan: WhopSDK::Membership::Plan, product: WhopSDK::Membership::Product,