From e9bdc24914a094959bb450165e5c7c261cf0063e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 06:13:54 +0000 Subject: [PATCH 1/3] feat(api): api update --- .stats.yml | 4 +- lib/whop_sdk.rb | 1 + lib/whop_sdk/models.rb | 2 + .../ledger_account_retrieve_response.rb | 35 +- ...ut_account_status_updated_webhook_event.rb | 297 ++++++++++ lib/whop_sdk/models/unwrap_webhook_event.rb | 4 +- lib/whop_sdk/models/webhook_event.rb | 1 + lib/whop_sdk/resources/webhooks.rb | 2 +- rbi/whop_sdk/models.rbi | 3 + .../ledger_account_retrieve_response.rbi | 84 ++- ...t_account_status_updated_webhook_event.rbi | 519 ++++++++++++++++++ rbi/whop_sdk/models/unwrap_webhook_event.rbi | 1 + rbi/whop_sdk/models/webhook_event.rbi | 5 + rbi/whop_sdk/resources/webhooks.rbi | 1 + sig/whop_sdk/models.rbs | 2 + .../ledger_account_retrieve_response.rbs | 32 +- ...t_account_status_updated_webhook_event.rbs | 224 ++++++++ sig/whop_sdk/models/unwrap_webhook_event.rbs | 1 + sig/whop_sdk/models/webhook_event.rbs | 2 + sig/whop_sdk/resources/webhooks.rbs | 1 + 20 files changed, 1210 insertions(+), 11 deletions(-) create mode 100644 lib/whop_sdk/models/payout_account_status_updated_webhook_event.rb create mode 100644 rbi/whop_sdk/models/payout_account_status_updated_webhook_event.rbi create mode 100644 sig/whop_sdk/models/payout_account_status_updated_webhook_event.rbs diff --git a/.stats.yml b/.stats.yml index 00310ca6..fcc4c903 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 178 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-187882c4d823394e3577f9843c288f4187e4f9b38646105c40b88e4e83b27979.yml -openapi_spec_hash: 16eb1c84681dc3ad39c987b7abf1e191 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-51fb88de05d428f3ea78a4b7ba2d5c6e04ae039816961e810f99d9d5d29bc015.yml +openapi_spec_hash: d59179d7d9a835795741673012f20d79 config_hash: e9bda7cddca13f2b41d8f7521ad36cf5 diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index 471c0a9c..a933414b 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -323,6 +323,7 @@ require_relative "whop_sdk/models/payment_retry_params" require_relative "whop_sdk/models/payment_succeeded_webhook_event" require_relative "whop_sdk/models/payment_void_params" +require_relative "whop_sdk/models/payout_account_status_updated_webhook_event" require_relative "whop_sdk/models/payout_destination_category" require_relative "whop_sdk/models/payout_method_created_webhook_event" require_relative "whop_sdk/models/payout_method_list_params" diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index 7854086f..6ca01338 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -471,6 +471,8 @@ module WhopSDK PaymentVoidParams = WhopSDK::Models::PaymentVoidParams + PayoutAccountStatusUpdatedWebhookEvent = WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent + PayoutDestinationCategory = WhopSDK::Models::PayoutDestinationCategory PayoutMethodCreatedWebhookEvent = WhopSDK::Models::PayoutMethodCreatedWebhookEvent diff --git a/lib/whop_sdk/models/ledger_account_retrieve_response.rb b/lib/whop_sdk/models/ledger_account_retrieve_response.rb index c5ddc73c..234a2f7c 100644 --- a/lib/whop_sdk/models/ledger_account_retrieve_response.rb +++ b/lib/whop_sdk/models/ledger_account_retrieve_response.rb @@ -282,7 +282,20 @@ class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel # @return [String, nil] required :phone, String, nil?: true - # @!method initialize(id:, address:, business_name:, business_representative:, email:, latest_verification:, phone:) + # @!attribute status + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + # + # @return [Symbol, WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status, nil] + required :status, + enum: -> { WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status }, + nil?: true + + # @!method initialize(id:, address:, business_name:, business_representative:, email:, latest_verification:, phone:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails} for more + # details. + # # The payout account associated with the LedgerAccount, if any. # # @param id [String] The unique identifier for the payout account. @@ -298,6 +311,8 @@ class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel # @param latest_verification [WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification, nil] The latest verification for the connected account. # # @param phone [String, nil] The business representative's phone + # + # @param status [Symbol, WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status, nil] The granular calculated statuses reflecting payout account KYC and withdrawal re # @see WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails#address class Address < WhopSDK::Internal::Type::BaseModel @@ -438,6 +453,24 @@ class LatestVerification < WhopSDK::Internal::Type::BaseModel # # @param status [Symbol, WhopSDK::Models::VerificationStatus] The current status of this verification session. end + + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + # + # @see WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails#status + module Status + extend WhopSDK::Internal::Type::Enum + + CONNECTED = :connected + DISABLED = :disabled + ACTION_REQUIRED = :action_required + PENDING_VERIFICATION = :pending_verification + VERIFICATION_FAILED = :verification_failed + NOT_STARTED = :not_started + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/whop_sdk/models/payout_account_status_updated_webhook_event.rb b/lib/whop_sdk/models/payout_account_status_updated_webhook_event.rb new file mode 100644 index 00000000..272e67f1 --- /dev/null +++ b/lib/whop_sdk/models/payout_account_status_updated_webhook_event.rb @@ -0,0 +1,297 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + class PayoutAccountStatusUpdatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # A unique ID for every single webhook request + # + # @return [String] + required :id, String + + # @!attribute api_version + # The API version for this webhook + # + # @return [Symbol, :v1] + required :api_version, const: :v1 + + # @!attribute data + # An object representing an account used for payouts. + # + # @return [WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data] + required :data, -> { WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data } + + # @!attribute timestamp + # The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @return [Time] + required :timestamp, Time + + # @!attribute type + # The webhook event type + # + # @return [Symbol, :"payout_account.status_updated"] + required :type, const: :"payout_account.status_updated" + + # @!attribute company_id + # The company ID that this webhook event is associated with + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!method initialize(id:, data:, timestamp:, company_id: nil, api_version: :v1, type: :"payout_account.status_updated") + # @param id [String] A unique ID for every single webhook request + # + # @param data [WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data] An object representing an account used for payouts. + # + # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server + # + # @param company_id [String, nil] The company ID that this webhook event is associated with + # + # @param api_version [Symbol, :v1] The API version for this webhook + # + # @param type [Symbol, :"payout_account.status_updated"] The webhook event type + + # @see WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent#data + class Data < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the payout account. + # + # @return [String] + required :id, String + + # @!attribute address + # The physical address associated with this payout account + # + # @return [WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::Address, nil] + required :address, -> { WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address }, nil?: true + + # @!attribute business_name + # The company's legal name + # + # @return [String, nil] + required :business_name, String, nil?: true + + # @!attribute business_representative + # The business representative for this payout account + # + # @return [WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative, nil] + required :business_representative, + -> { WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative }, + nil?: true + + # @!attribute email + # The email address of the representative + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute latest_verification + # The latest verification for the connected account. + # + # @return [WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification, nil] + required :latest_verification, + -> { WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification }, + nil?: true + + # @!attribute phone + # The business representative's phone + # + # @return [String, nil] + required :phone, String, nil?: true + + # @!attribute status + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + # + # @return [Symbol, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::Status, nil] + required :status, + enum: -> { + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status + }, + nil?: true + + # @!method initialize(id:, address:, business_name:, business_representative:, email:, latest_verification:, phone:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data} for more + # details. + # + # An object representing an account used for payouts. + # + # @param id [String] The unique identifier for the payout account. + # + # @param address [WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::Address, nil] The physical address associated with this payout account + # + # @param business_name [String, nil] The company's legal name + # + # @param business_representative [WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative, nil] The business representative for this payout account + # + # @param email [String, nil] The email address of the representative + # + # @param latest_verification [WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification, nil] The latest verification for the connected account. + # + # @param phone [String, nil] The business representative's phone + # + # @param status [Symbol, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::Status, nil] The granular calculated statuses reflecting payout account KYC and withdrawal re + + # @see WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city of the address. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The country of the address. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # The line 1 of the address. + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # The line 2 of the address. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # The postal code of the address. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # The state of the address. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!method initialize(city:, country:, line1:, line2:, postal_code:, state:) + # The physical address associated with this payout account + # + # @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 postal_code [String, nil] The postal code of the address. + # + # @param state [String, nil] The state of the address. + end + + # @see WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data#business_representative + class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel + # @!attribute date_of_birth + # The date of birth of the business representative in ISO 8601 format + # (YYYY-MM-DD). + # + # @return [String, nil] + required :date_of_birth, String, nil?: true + + # @!attribute first_name + # The first name of the business representative. + # + # @return [String, nil] + required :first_name, String, nil?: true + + # @!attribute last_name + # The last name of the business representative. + # + # @return [String, nil] + required :last_name, String, nil?: true + + # @!attribute middle_name + # The middle name of the business representative. + # + # @return [String, nil] + required :middle_name, String, nil?: true + + # @!method initialize(date_of_birth:, first_name:, last_name:, middle_name:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative} + # for more details. + # + # The business representative for this payout account + # + # @param date_of_birth [String, nil] The date of birth of the business representative in ISO 8601 format (YYYY-MM-DD) + # + # @param first_name [String, nil] The first name of the business representative. + # + # @param last_name [String, nil] The last name of the business representative. + # + # @param middle_name [String, nil] The middle name of the business representative. + end + + # @see WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data#latest_verification + class LatestVerification < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the verification. + # + # @return [String] + required :id, String + + # @!attribute last_error_code + # An error code for a verification attempt. + # + # @return [Symbol, WhopSDK::Models::VerificationErrorCode, nil] + required :last_error_code, enum: -> { WhopSDK::VerificationErrorCode }, nil?: true + + # @!attribute last_error_reason + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + # + # @return [String, nil] + required :last_error_reason, String, nil?: true + + # @!attribute status + # The current status of this verification session. + # + # @return [Symbol, WhopSDK::Models::VerificationStatus] + required :status, enum: -> { WhopSDK::VerificationStatus } + + # @!method initialize(id:, last_error_code:, last_error_reason:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification} + # for more details. + # + # The latest verification for the connected account. + # + # @param id [String] The unique identifier for the verification. + # + # @param last_error_code [Symbol, WhopSDK::Models::VerificationErrorCode, nil] An error code for a verification attempt. + # + # @param last_error_reason [String, nil] A human-readable explanation of the most recent verification error. Null if no e + # + # @param status [Symbol, WhopSDK::Models::VerificationStatus] The current status of this verification session. + end + + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + # + # @see WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data#status + module Status + extend WhopSDK::Internal::Type::Enum + + CONNECTED = :connected + DISABLED = :disabled + ACTION_REQUIRED = :action_required + PENDING_VERIFICATION = :pending_verification + VERIFICATION_FAILED = :verification_failed + NOT_STARTED = :not_started + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/whop_sdk/models/unwrap_webhook_event.rb b/lib/whop_sdk/models/unwrap_webhook_event.rb index 31f6c3d8..50d47624 100644 --- a/lib/whop_sdk/models/unwrap_webhook_event.rb +++ b/lib/whop_sdk/models/unwrap_webhook_event.rb @@ -44,6 +44,8 @@ module UnwrapWebhookEvent variant :"verification.succeeded", -> { WhopSDK::VerificationSucceededWebhookEvent } + variant :"payout_account.status_updated", -> { WhopSDK::PayoutAccountStatusUpdatedWebhookEvent } + variant :"payment.created", -> { WhopSDK::PaymentCreatedWebhookEvent } variant :"payment.succeeded", -> { WhopSDK::PaymentSucceededWebhookEvent } @@ -66,7 +68,7 @@ module UnwrapWebhookEvent -> { WhopSDK::MembershipCancelAtPeriodEndChangedWebhookEvent } # @!method self.variants - # @return [Array(WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::DisputeAlertCreatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent)] + # @return [Array(WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::DisputeAlertCreatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent)] end end end diff --git a/lib/whop_sdk/models/webhook_event.rb b/lib/whop_sdk/models/webhook_event.rb index dad6b03f..52b5b59a 100644 --- a/lib/whop_sdk/models/webhook_event.rb +++ b/lib/whop_sdk/models/webhook_event.rb @@ -24,6 +24,7 @@ module WebhookEvent COURSE_LESSON_INTERACTION_COMPLETED = :"course_lesson_interaction.completed" PAYOUT_METHOD_CREATED = :"payout_method.created" VERIFICATION_SUCCEEDED = :"verification.succeeded" + PAYOUT_ACCOUNT_STATUS_UPDATED = :"payout_account.status_updated" PAYMENT_CREATED = :"payment.created" PAYMENT_SUCCEEDED = :"payment.succeeded" PAYMENT_FAILED = :"payment.failed" diff --git a/lib/whop_sdk/resources/webhooks.rb b/lib/whop_sdk/resources/webhooks.rb index 3616b7e9..cc3643fc 100644 --- a/lib/whop_sdk/resources/webhooks.rb +++ b/lib/whop_sdk/resources/webhooks.rb @@ -170,7 +170,7 @@ def delete(id, params = {}) # # @param key [String, nil] The webhook signing key # - # @return [WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::DisputeAlertCreatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent] + # @return [WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PayoutMethodCreatedWebhookEvent, WhopSDK::Models::VerificationSucceededWebhookEvent, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent, WhopSDK::Models::PaymentCreatedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent, WhopSDK::Models::DisputeAlertCreatedWebhookEvent, WhopSDK::Models::MembershipCancelAtPeriodEndChangedWebhookEvent] def unwrap(payload, headers:, key: @client.webhook_key) if key.nil? raise ArgumentError.new("Cannot verify a webhook without a key on either the client's webhook_key or passed in as an argument") diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index b7843b77..2115495b 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -448,6 +448,9 @@ module WhopSDK PaymentVoidParams = WhopSDK::Models::PaymentVoidParams + PayoutAccountStatusUpdatedWebhookEvent = + WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent + PayoutDestinationCategory = WhopSDK::Models::PayoutDestinationCategory PayoutMethodCreatedWebhookEvent = diff --git a/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi b/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi index 36ee6aa4..89c4595c 100644 --- a/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +++ b/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi @@ -516,6 +516,17 @@ module WhopSDK sig { returns(T.nilable(String)) } attr_accessor :phone + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + sig do + returns( + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + ) + ) + end + attr_accessor :status + # The payout account associated with the LedgerAccount, if any. sig do params( @@ -534,7 +545,11 @@ module WhopSDK T.nilable( WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification::OrHash ), - phone: T.nilable(String) + phone: T.nilable(String), + status: + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::OrSymbol + ) ).returns(T.attached_class) end def self.new( @@ -551,7 +566,10 @@ module WhopSDK # The latest verification for the connected account. latest_verification:, # The business representative's phone - phone: + phone:, + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + status: ) end @@ -573,7 +591,11 @@ module WhopSDK T.nilable( WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification ), - phone: T.nilable(String) + phone: T.nilable(String), + status: + T.nilable( + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + ) } ) end @@ -783,6 +805,62 @@ module WhopSDK def to_hash end end + + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONNECTED = + T.let( + :connected, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + ) + DISABLED = + T.let( + :disabled, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + ) + ACTION_REQUIRED = + T.let( + :action_required, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + ) + PENDING_VERIFICATION = + T.let( + :pending_verification, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + ) + VERIFICATION_FAILED = + T.let( + :verification_failed, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + ) + NOT_STARTED = + T.let( + :not_started, + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/whop_sdk/models/payout_account_status_updated_webhook_event.rbi b/rbi/whop_sdk/models/payout_account_status_updated_webhook_event.rbi new file mode 100644 index 00000000..5a8cf185 --- /dev/null +++ b/rbi/whop_sdk/models/payout_account_status_updated_webhook_event.rbi @@ -0,0 +1,519 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutAccountStatusUpdatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent, + WhopSDK::Internal::AnyHash + ) + end + + # A unique ID for every single webhook request + sig { returns(String) } + attr_accessor :id + + # The API version for this webhook + sig { returns(Symbol) } + attr_accessor :api_version + + # An object representing an account used for payouts. + sig { returns(WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data) } + attr_reader :data + + sig do + params( + data: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::OrHash + ).void + end + attr_writer :data + + # The timestamp in ISO 8601 format that the webhook was sent at on the server + sig { returns(Time) } + attr_accessor :timestamp + + # The webhook event type + sig { returns(Symbol) } + attr_accessor :type + + # The company ID that this webhook event is associated with + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + sig do + params( + id: String, + data: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::OrHash, + timestamp: Time, + company_id: T.nilable(String), + api_version: Symbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # A unique ID for every single webhook request + id:, + # An object representing an account used for payouts. + data:, + # The timestamp in ISO 8601 format that the webhook was sent at on the server + timestamp:, + # The company ID that this webhook event is associated with + company_id: nil, + # The API version for this webhook + api_version: :v1, + # The webhook event type + type: :"payout_account.status_updated" + ) + end + + sig do + override.returns( + { + id: String, + api_version: Symbol, + data: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data, + timestamp: Time, + type: Symbol, + company_id: T.nilable(String) + } + ) + end + def to_hash + end + + class Data < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the payout account. + sig { returns(String) } + attr_accessor :id + + # The physical address associated with this payout account + sig do + returns( + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address::OrHash + ) + ).void + end + attr_writer :address + + # The company's legal name + sig { returns(T.nilable(String)) } + attr_accessor :business_name + + # The business representative for this payout account + sig do + returns( + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative + ) + ) + end + attr_reader :business_representative + + sig do + params( + business_representative: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative::OrHash + ) + ).void + end + attr_writer :business_representative + + # The email address of the representative + sig { returns(T.nilable(String)) } + attr_accessor :email + + # The latest verification for the connected account. + sig do + returns( + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification + ) + ) + end + attr_reader :latest_verification + + sig do + params( + latest_verification: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification::OrHash + ) + ).void + end + attr_writer :latest_verification + + # The business representative's phone + sig { returns(T.nilable(String)) } + attr_accessor :phone + + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + sig do + returns( + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + ) + ) + end + attr_accessor :status + + # An object representing an account used for payouts. + sig do + params( + id: String, + address: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address::OrHash + ), + business_name: T.nilable(String), + business_representative: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative::OrHash + ), + email: T.nilable(String), + latest_verification: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification::OrHash + ), + phone: T.nilable(String), + status: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::OrSymbol + ) + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the payout account. + id:, + # The physical address associated with this payout account + address:, + # The company's legal name + business_name:, + # The business representative for this payout account + business_representative:, + # The email address of the representative + email:, + # The latest verification for the connected account. + latest_verification:, + # The business representative's phone + phone:, + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + status: + ) + end + + sig do + override.returns( + { + id: String, + address: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address + ), + business_name: T.nilable(String), + business_representative: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative + ), + email: T.nilable(String), + latest_verification: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification + ), + phone: T.nilable(String), + status: + T.nilable( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + ) + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address, + 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 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 physical address associated with this payout account + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The city of the address. + city:, + # The country of the address. + country:, + # The line 1 of the address. + line1:, + # The line 2 of the address. + line2:, + # The postal code of the address. + postal_code:, + # The state of the address. + state: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative, + WhopSDK::Internal::AnyHash + ) + end + + # The date of birth of the business representative in ISO 8601 format + # (YYYY-MM-DD). + sig { returns(T.nilable(String)) } + attr_accessor :date_of_birth + + # The first name of the business representative. + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + # The last name of the business representative. + sig { returns(T.nilable(String)) } + attr_accessor :last_name + + # The middle name of the business representative. + sig { returns(T.nilable(String)) } + attr_accessor :middle_name + + # The business representative for this payout account + sig do + params( + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + middle_name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The date of birth of the business representative in ISO 8601 format + # (YYYY-MM-DD). + date_of_birth:, + # The first name of the business representative. + first_name:, + # The last name of the business representative. + last_name:, + # The middle name of the business representative. + middle_name: + ) + end + + sig do + override.returns( + { + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + middle_name: T.nilable(String) + } + ) + end + def to_hash + end + end + + class LatestVerification < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the verification. + sig { returns(String) } + attr_accessor :id + + # An error code for a verification attempt. + sig do + returns(T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol)) + end + attr_accessor :last_error_code + + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + sig { returns(T.nilable(String)) } + attr_accessor :last_error_reason + + # The current status of this verification session. + sig { returns(WhopSDK::VerificationStatus::TaggedSymbol) } + attr_accessor :status + + # The latest verification for the connected account. + sig do + params( + id: String, + last_error_code: + T.nilable(WhopSDK::VerificationErrorCode::OrSymbol), + last_error_reason: T.nilable(String), + status: WhopSDK::VerificationStatus::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the verification. + id:, + # An error code for a verification attempt. + last_error_code:, + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + last_error_reason:, + # The current status of this verification session. + status: + ) + end + + sig do + override.returns( + { + id: String, + last_error_code: + T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol), + last_error_reason: T.nilable(String), + status: WhopSDK::VerificationStatus::TaggedSymbol + } + ) + end + def to_hash + end + end + + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + module Status + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONNECTED = + T.let( + :connected, + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + ) + DISABLED = + T.let( + :disabled, + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + ) + ACTION_REQUIRED = + T.let( + :action_required, + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + ) + PENDING_VERIFICATION = + T.let( + :pending_verification, + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + ) + VERIFICATION_FAILED = + T.let( + :verification_failed, + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + ) + NOT_STARTED = + T.let( + :not_started, + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/whop_sdk/models/unwrap_webhook_event.rbi b/rbi/whop_sdk/models/unwrap_webhook_event.rbi index 2840d345..57879a68 100644 --- a/rbi/whop_sdk/models/unwrap_webhook_event.rbi +++ b/rbi/whop_sdk/models/unwrap_webhook_event.rbi @@ -26,6 +26,7 @@ module WhopSDK WhopSDK::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::PayoutMethodCreatedWebhookEvent, WhopSDK::VerificationSucceededWebhookEvent, + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent, WhopSDK::PaymentCreatedWebhookEvent, WhopSDK::PaymentSucceededWebhookEvent, WhopSDK::PaymentFailedWebhookEvent, diff --git a/rbi/whop_sdk/models/webhook_event.rbi b/rbi/whop_sdk/models/webhook_event.rbi index a73dbb0d..16984af1 100644 --- a/rbi/whop_sdk/models/webhook_event.rbi +++ b/rbi/whop_sdk/models/webhook_event.rbi @@ -49,6 +49,11 @@ module WhopSDK T.let(:"payout_method.created", WhopSDK::WebhookEvent::TaggedSymbol) VERIFICATION_SUCCEEDED = T.let(:"verification.succeeded", WhopSDK::WebhookEvent::TaggedSymbol) + PAYOUT_ACCOUNT_STATUS_UPDATED = + T.let( + :"payout_account.status_updated", + WhopSDK::WebhookEvent::TaggedSymbol + ) PAYMENT_CREATED = T.let(:"payment.created", WhopSDK::WebhookEvent::TaggedSymbol) PAYMENT_SUCCEEDED = diff --git a/rbi/whop_sdk/resources/webhooks.rbi b/rbi/whop_sdk/resources/webhooks.rbi index d2a8d043..e98dfd76 100644 --- a/rbi/whop_sdk/resources/webhooks.rbi +++ b/rbi/whop_sdk/resources/webhooks.rbi @@ -166,6 +166,7 @@ module WhopSDK WhopSDK::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::PayoutMethodCreatedWebhookEvent, WhopSDK::VerificationSucceededWebhookEvent, + WhopSDK::PayoutAccountStatusUpdatedWebhookEvent, WhopSDK::PaymentCreatedWebhookEvent, WhopSDK::PaymentSucceededWebhookEvent, WhopSDK::PaymentFailedWebhookEvent, diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index 14daf3c6..3a38237e 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -429,6 +429,8 @@ module WhopSDK class PaymentVoidParams = WhopSDK::Models::PaymentVoidParams + class PayoutAccountStatusUpdatedWebhookEvent = WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent + module PayoutDestinationCategory = WhopSDK::Models::PayoutDestinationCategory class PayoutMethodCreatedWebhookEvent = WhopSDK::Models::PayoutMethodCreatedWebhookEvent diff --git a/sig/whop_sdk/models/ledger_account_retrieve_response.rbs b/sig/whop_sdk/models/ledger_account_retrieve_response.rbs index dca6fa16..b0daddfb 100644 --- a/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +++ b/sig/whop_sdk/models/ledger_account_retrieve_response.rbs @@ -175,7 +175,8 @@ module WhopSDK business_representative: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::BusinessRepresentative?, email: String?, latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification?, - phone: String? + phone: String?, + status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status? } class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel @@ -193,6 +194,8 @@ module WhopSDK attr_accessor phone: String? + attr_accessor status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status? + def initialize: ( id: String, address: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Address?, @@ -200,7 +203,8 @@ module WhopSDK business_representative: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::BusinessRepresentative?, email: String?, latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification?, - phone: String? + phone: String?, + status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status? ) -> void def to_hash: -> { @@ -210,7 +214,8 @@ module WhopSDK business_representative: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::BusinessRepresentative?, email: String?, latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification?, - phone: String? + phone: String?, + status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status? } type address = @@ -318,6 +323,27 @@ module WhopSDK status: WhopSDK::Models::verification_status } end + + type status = + :connected + | :disabled + | :action_required + | :pending_verification + | :verification_failed + | :not_started + + module Status + extend WhopSDK::Internal::Type::Enum + + CONNECTED: :connected + DISABLED: :disabled + ACTION_REQUIRED: :action_required + PENDING_VERIFICATION: :pending_verification + VERIFICATION_FAILED: :verification_failed + NOT_STARTED: :not_started + + def self?.values: -> ::Array[WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status] + end end end end diff --git a/sig/whop_sdk/models/payout_account_status_updated_webhook_event.rbs b/sig/whop_sdk/models/payout_account_status_updated_webhook_event.rbs new file mode 100644 index 00000000..253165b4 --- /dev/null +++ b/sig/whop_sdk/models/payout_account_status_updated_webhook_event.rbs @@ -0,0 +1,224 @@ +module WhopSDK + module Models + type payout_account_status_updated_webhook_event = + { + id: String, + api_version: :v1, + data: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data, + timestamp: Time, + type: :"payout_account.status_updated", + company_id: String? + } + + class PayoutAccountStatusUpdatedWebhookEvent < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor api_version: :v1 + + attr_accessor data: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data + + attr_accessor timestamp: Time + + attr_accessor type: :"payout_account.status_updated" + + attr_accessor company_id: String? + + def initialize: ( + id: String, + data: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data, + timestamp: Time, + ?company_id: String?, + ?api_version: :v1, + ?type: :"payout_account.status_updated" + ) -> void + + def to_hash: -> { + id: String, + api_version: :v1, + data: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data, + timestamp: Time, + type: :"payout_account.status_updated", + company_id: String? + } + + type data = + { + id: String, + address: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address?, + business_name: String?, + business_representative: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative?, + email: String?, + latest_verification: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification?, + phone: String?, + status: WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status? + } + + class Data < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor address: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address? + + attr_accessor business_name: String? + + attr_accessor business_representative: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative? + + attr_accessor email: String? + + attr_accessor latest_verification: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification? + + attr_accessor phone: String? + + attr_accessor status: WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status? + + def initialize: ( + id: String, + address: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address?, + business_name: String?, + business_representative: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative?, + email: String?, + latest_verification: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification?, + phone: String?, + status: WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status? + ) -> void + + def to_hash: -> { + id: String, + address: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Address?, + business_name: String?, + business_representative: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::BusinessRepresentative?, + email: String?, + latest_verification: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification?, + phone: String?, + status: WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status? + } + + type address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type business_representative = + { + date_of_birth: String?, + first_name: String?, + last_name: String?, + middle_name: String? + } + + class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel + attr_accessor date_of_birth: String? + + attr_accessor first_name: String? + + attr_accessor last_name: String? + + attr_accessor middle_name: String? + + def initialize: ( + date_of_birth: String?, + first_name: String?, + last_name: String?, + middle_name: String? + ) -> void + + def to_hash: -> { + date_of_birth: String?, + first_name: String?, + last_name: String?, + middle_name: String? + } + end + + type latest_verification = + { + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + } + + class LatestVerification < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor last_error_code: WhopSDK::Models::verification_error_code? + + attr_accessor last_error_reason: String? + + attr_accessor status: WhopSDK::Models::verification_status + + def initialize: ( + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + ) -> void + + def to_hash: -> { + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + } + end + + type status = + :connected + | :disabled + | :action_required + | :pending_verification + | :verification_failed + | :not_started + + module Status + extend WhopSDK::Internal::Type::Enum + + CONNECTED: :connected + DISABLED: :disabled + ACTION_REQUIRED: :action_required + PENDING_VERIFICATION: :pending_verification + VERIFICATION_FAILED: :verification_failed + NOT_STARTED: :not_started + + def self?.values: -> ::Array[WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status] + end + end + end + end +end diff --git a/sig/whop_sdk/models/unwrap_webhook_event.rbs b/sig/whop_sdk/models/unwrap_webhook_event.rbs index 0e359c5a..39758566 100644 --- a/sig/whop_sdk/models/unwrap_webhook_event.rbs +++ b/sig/whop_sdk/models/unwrap_webhook_event.rbs @@ -19,6 +19,7 @@ module WhopSDK | WhopSDK::CourseLessonInteractionCompletedWebhookEvent | WhopSDK::PayoutMethodCreatedWebhookEvent | WhopSDK::VerificationSucceededWebhookEvent + | WhopSDK::PayoutAccountStatusUpdatedWebhookEvent | WhopSDK::PaymentCreatedWebhookEvent | WhopSDK::PaymentSucceededWebhookEvent | WhopSDK::PaymentFailedWebhookEvent diff --git a/sig/whop_sdk/models/webhook_event.rbs b/sig/whop_sdk/models/webhook_event.rbs index cd89e969..ae702e7e 100644 --- a/sig/whop_sdk/models/webhook_event.rbs +++ b/sig/whop_sdk/models/webhook_event.rbs @@ -19,6 +19,7 @@ module WhopSDK | :"course_lesson_interaction.completed" | :"payout_method.created" | :"verification.succeeded" + | :"payout_account.status_updated" | :"payment.created" | :"payment.succeeded" | :"payment.failed" @@ -51,6 +52,7 @@ module WhopSDK COURSE_LESSON_INTERACTION_COMPLETED: :"course_lesson_interaction.completed" PAYOUT_METHOD_CREATED: :"payout_method.created" VERIFICATION_SUCCEEDED: :"verification.succeeded" + PAYOUT_ACCOUNT_STATUS_UPDATED: :"payout_account.status_updated" PAYMENT_CREATED: :"payment.created" PAYMENT_SUCCEEDED: :"payment.succeeded" PAYMENT_FAILED: :"payment.failed" diff --git a/sig/whop_sdk/resources/webhooks.rbs b/sig/whop_sdk/resources/webhooks.rbs index 47ea4c96..1cfcff3e 100644 --- a/sig/whop_sdk/resources/webhooks.rbs +++ b/sig/whop_sdk/resources/webhooks.rbs @@ -59,6 +59,7 @@ module WhopSDK | WhopSDK::CourseLessonInteractionCompletedWebhookEvent | WhopSDK::PayoutMethodCreatedWebhookEvent | WhopSDK::VerificationSucceededWebhookEvent + | WhopSDK::PayoutAccountStatusUpdatedWebhookEvent | WhopSDK::PaymentCreatedWebhookEvent | WhopSDK::PaymentSucceededWebhookEvent | WhopSDK::PaymentFailedWebhookEvent From a0a3ca0022cdeed9b42b5b00a7d4e2f57ae4248b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:54:15 +0000 Subject: [PATCH 2/3] feat(api): manual updates --- .stats.yml | 4 +- lib/whop_sdk.rb | 6 + lib/whop_sdk/client.rb | 5 + lib/whop_sdk/models.rb | 6 + .../ledger_account_retrieve_response.rb | 26 +- .../payout_account_calculated_statuses.rb | 21 + .../models/payout_account_retrieve_params.rb | 20 + .../payout_account_retrieve_response.rb | 223 +++++++++++ ...ut_account_status_updated_webhook_event.rb | 28 +- .../models/verification_list_params.rb | 54 +++ .../models/verification_list_response.rb | 48 +++ lib/whop_sdk/resources/payout_accounts.rb | 39 ++ lib/whop_sdk/resources/verifications.rb | 37 ++ rbi/whop_sdk/client.rbi | 4 + rbi/whop_sdk/models.rbi | 7 + .../ledger_account_retrieve_response.rbi | 66 +--- .../payout_account_calculated_statuses.rbi | 51 +++ .../models/payout_account_retrieve_params.rbi | 38 ++ .../payout_account_retrieve_response.rbi | 370 ++++++++++++++++++ ...t_account_status_updated_webhook_event.rbi | 66 +--- .../models/verification_list_params.rbi | 75 ++++ .../models/verification_list_response.rbi | 69 ++++ rbi/whop_sdk/resources/payout_accounts.rbi | 31 ++ rbi/whop_sdk/resources/verifications.rbi | 35 ++ sig/whop_sdk/client.rbs | 2 + sig/whop_sdk/models.rbs | 6 + .../ledger_account_retrieve_response.rbs | 29 +- .../payout_account_calculated_statuses.rbs | 24 ++ .../models/payout_account_retrieve_params.rbs | 20 + .../payout_account_retrieve_response.rbs | 161 ++++++++ ...t_account_status_updated_webhook_event.rbs | 29 +- .../models/verification_list_params.rbs | 46 +++ .../models/verification_list_response.rbs | 35 ++ sig/whop_sdk/resources/payout_accounts.rbs | 12 + sig/whop_sdk/resources/verifications.rbs | 9 + .../resources/payout_accounts_test.rb | 28 ++ test/whop_sdk/resources/verifications_test.rb | 26 ++ 37 files changed, 1530 insertions(+), 226 deletions(-) create mode 100644 lib/whop_sdk/models/payout_account_calculated_statuses.rb create mode 100644 lib/whop_sdk/models/payout_account_retrieve_params.rb create mode 100644 lib/whop_sdk/models/payout_account_retrieve_response.rb create mode 100644 lib/whop_sdk/models/verification_list_params.rb create mode 100644 lib/whop_sdk/models/verification_list_response.rb create mode 100644 lib/whop_sdk/resources/payout_accounts.rb create mode 100644 rbi/whop_sdk/models/payout_account_calculated_statuses.rbi create mode 100644 rbi/whop_sdk/models/payout_account_retrieve_params.rbi create mode 100644 rbi/whop_sdk/models/payout_account_retrieve_response.rbi create mode 100644 rbi/whop_sdk/models/verification_list_params.rbi create mode 100644 rbi/whop_sdk/models/verification_list_response.rbi create mode 100644 rbi/whop_sdk/resources/payout_accounts.rbi create mode 100644 sig/whop_sdk/models/payout_account_calculated_statuses.rbs create mode 100644 sig/whop_sdk/models/payout_account_retrieve_params.rbs create mode 100644 sig/whop_sdk/models/payout_account_retrieve_response.rbs create mode 100644 sig/whop_sdk/models/verification_list_params.rbs create mode 100644 sig/whop_sdk/models/verification_list_response.rbs create mode 100644 sig/whop_sdk/resources/payout_accounts.rbs create mode 100644 test/whop_sdk/resources/payout_accounts_test.rb diff --git a/.stats.yml b/.stats.yml index fcc4c903..c14a3691 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 178 +configured_endpoints: 180 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-51fb88de05d428f3ea78a4b7ba2d5c6e04ae039816961e810f99d9d5d29bc015.yml openapi_spec_hash: d59179d7d9a835795741673012f20d79 -config_hash: e9bda7cddca13f2b41d8f7521ad36cf5 +config_hash: a9229678a4146beeb5be82ed0ae3d4f1 diff --git a/lib/whop_sdk.rb b/lib/whop_sdk.rb index a933414b..dae673e8 100644 --- a/lib/whop_sdk.rb +++ b/lib/whop_sdk.rb @@ -323,6 +323,9 @@ require_relative "whop_sdk/models/payment_retry_params" require_relative "whop_sdk/models/payment_succeeded_webhook_event" require_relative "whop_sdk/models/payment_void_params" +require_relative "whop_sdk/models/payout_account_calculated_statuses" +require_relative "whop_sdk/models/payout_account_retrieve_params" +require_relative "whop_sdk/models/payout_account_retrieve_response" require_relative "whop_sdk/models/payout_account_status_updated_webhook_event" require_relative "whop_sdk/models/payout_destination_category" require_relative "whop_sdk/models/payout_method_created_webhook_event" @@ -428,6 +431,8 @@ require_relative "whop_sdk/models/user_retrieve_params" require_relative "whop_sdk/models/user_update_profile_params" require_relative "whop_sdk/models/verification_error_code" +require_relative "whop_sdk/models/verification_list_params" +require_relative "whop_sdk/models/verification_list_response" require_relative "whop_sdk/models/verification_retrieve_params" require_relative "whop_sdk/models/verification_retrieve_response" require_relative "whop_sdk/models/verification_status" @@ -494,6 +499,7 @@ require_relative "whop_sdk/resources/notifications" require_relative "whop_sdk/resources/payment_methods" require_relative "whop_sdk/resources/payments" +require_relative "whop_sdk/resources/payout_accounts" require_relative "whop_sdk/resources/payout_methods" require_relative "whop_sdk/resources/plans" require_relative "whop_sdk/resources/products" diff --git a/lib/whop_sdk/client.rb b/lib/whop_sdk/client.rb index de17181a..7f2898f4 100644 --- a/lib/whop_sdk/client.rb +++ b/lib/whop_sdk/client.rb @@ -233,6 +233,10 @@ class Client < WhopSDK::Internal::Transport::BaseClient # @return [WhopSDK::Resources::ResolutionCenterCases] attr_reader :resolution_center_cases + # Payout accounts + # @return [WhopSDK::Resources::PayoutAccounts] + attr_reader :payout_accounts + # @api private # # @return [Hash{String=>String}] @@ -346,6 +350,7 @@ def initialize( @dm_channels = WhopSDK::Resources::DmChannels.new(client: self) @dispute_alerts = WhopSDK::Resources::DisputeAlerts.new(client: self) @resolution_center_cases = WhopSDK::Resources::ResolutionCenterCases.new(client: self) + @payout_accounts = WhopSDK::Resources::PayoutAccounts.new(client: self) end # Verifies a Whop user token diff --git a/lib/whop_sdk/models.rb b/lib/whop_sdk/models.rb index 6ca01338..b4a99496 100644 --- a/lib/whop_sdk/models.rb +++ b/lib/whop_sdk/models.rb @@ -471,6 +471,10 @@ module WhopSDK PaymentVoidParams = WhopSDK::Models::PaymentVoidParams + PayoutAccountCalculatedStatuses = WhopSDK::Models::PayoutAccountCalculatedStatuses + + PayoutAccountRetrieveParams = WhopSDK::Models::PayoutAccountRetrieveParams + PayoutAccountStatusUpdatedWebhookEvent = WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent PayoutDestinationCategory = WhopSDK::Models::PayoutDestinationCategory @@ -639,6 +643,8 @@ module WhopSDK VerificationErrorCode = WhopSDK::Models::VerificationErrorCode + VerificationListParams = WhopSDK::Models::VerificationListParams + VerificationRetrieveParams = WhopSDK::Models::VerificationRetrieveParams VerificationStatus = WhopSDK::Models::VerificationStatus diff --git a/lib/whop_sdk/models/ledger_account_retrieve_response.rb b/lib/whop_sdk/models/ledger_account_retrieve_response.rb index 234a2f7c..2555db24 100644 --- a/lib/whop_sdk/models/ledger_account_retrieve_response.rb +++ b/lib/whop_sdk/models/ledger_account_retrieve_response.rb @@ -286,10 +286,8 @@ class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel # The granular calculated statuses reflecting payout account KYC and withdrawal # readiness. # - # @return [Symbol, WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status, nil] - required :status, - enum: -> { WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status }, - nil?: true + # @return [Symbol, WhopSDK::Models::PayoutAccountCalculatedStatuses, nil] + required :status, enum: -> { WhopSDK::PayoutAccountCalculatedStatuses }, nil?: true # @!method initialize(id:, address:, business_name:, business_representative:, email:, latest_verification:, phone:, status:) # Some parameter documentations has been truncated, see @@ -312,7 +310,7 @@ class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel # # @param phone [String, nil] The business representative's phone # - # @param status [Symbol, WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status, nil] The granular calculated statuses reflecting payout account KYC and withdrawal re + # @param status [Symbol, WhopSDK::Models::PayoutAccountCalculatedStatuses, nil] The granular calculated statuses reflecting payout account KYC and withdrawal re # @see WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails#address class Address < WhopSDK::Internal::Type::BaseModel @@ -453,24 +451,6 @@ class LatestVerification < WhopSDK::Internal::Type::BaseModel # # @param status [Symbol, WhopSDK::Models::VerificationStatus] The current status of this verification session. end - - # The granular calculated statuses reflecting payout account KYC and withdrawal - # readiness. - # - # @see WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails#status - module Status - extend WhopSDK::Internal::Type::Enum - - CONNECTED = :connected - DISABLED = :disabled - ACTION_REQUIRED = :action_required - PENDING_VERIFICATION = :pending_verification - VERIFICATION_FAILED = :verification_failed - NOT_STARTED = :not_started - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/whop_sdk/models/payout_account_calculated_statuses.rb b/lib/whop_sdk/models/payout_account_calculated_statuses.rb new file mode 100644 index 00000000..e520f95f --- /dev/null +++ b/lib/whop_sdk/models/payout_account_calculated_statuses.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + module PayoutAccountCalculatedStatuses + extend WhopSDK::Internal::Type::Enum + + CONNECTED = :connected + DISABLED = :disabled + ACTION_REQUIRED = :action_required + PENDING_VERIFICATION = :pending_verification + VERIFICATION_FAILED = :verification_failed + NOT_STARTED = :not_started + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/whop_sdk/models/payout_account_retrieve_params.rb b/lib/whop_sdk/models/payout_account_retrieve_params.rb new file mode 100644 index 00000000..c3be9022 --- /dev/null +++ b/lib/whop_sdk/models/payout_account_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::PayoutAccounts#retrieve + class PayoutAccountRetrieveParams < 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/payout_account_retrieve_response.rb b/lib/whop_sdk/models/payout_account_retrieve_response.rb new file mode 100644 index 00000000..da6740da --- /dev/null +++ b/lib/whop_sdk/models/payout_account_retrieve_response.rb @@ -0,0 +1,223 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::PayoutAccounts#retrieve + class PayoutAccountRetrieveResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the payout account. + # + # @return [String] + required :id, String + + # @!attribute address + # The physical address associated with this payout account + # + # @return [WhopSDK::Models::PayoutAccountRetrieveResponse::Address, nil] + required :address, -> { WhopSDK::Models::PayoutAccountRetrieveResponse::Address }, nil?: true + + # @!attribute business_name + # The company's legal name + # + # @return [String, nil] + required :business_name, String, nil?: true + + # @!attribute business_representative + # The business representative for this payout account + # + # @return [WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative, nil] + required :business_representative, + -> { WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative }, + nil?: true + + # @!attribute email + # The email address of the representative + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute latest_verification + # The latest verification for the connected account. + # + # @return [WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification, nil] + required :latest_verification, + -> { WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification }, + nil?: true + + # @!attribute phone + # The business representative's phone + # + # @return [String, nil] + required :phone, String, nil?: true + + # @!attribute status + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + # + # @return [Symbol, WhopSDK::Models::PayoutAccountCalculatedStatuses, nil] + required :status, enum: -> { WhopSDK::PayoutAccountCalculatedStatuses }, nil?: true + + # @!method initialize(id:, address:, business_name:, business_representative:, email:, latest_verification:, phone:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutAccountRetrieveResponse} for more details. + # + # An object representing an account used for payouts. + # + # @param id [String] The unique identifier for the payout account. + # + # @param address [WhopSDK::Models::PayoutAccountRetrieveResponse::Address, nil] The physical address associated with this payout account + # + # @param business_name [String, nil] The company's legal name + # + # @param business_representative [WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative, nil] The business representative for this payout account + # + # @param email [String, nil] The email address of the representative + # + # @param latest_verification [WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification, nil] The latest verification for the connected account. + # + # @param phone [String, nil] The business representative's phone + # + # @param status [Symbol, WhopSDK::Models::PayoutAccountCalculatedStatuses, nil] The granular calculated statuses reflecting payout account KYC and withdrawal re + + # @see WhopSDK::Models::PayoutAccountRetrieveResponse#address + class Address < WhopSDK::Internal::Type::BaseModel + # @!attribute city + # The city of the address. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # The country of the address. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute line1 + # The line 1 of the address. + # + # @return [String, nil] + required :line1, String, nil?: true + + # @!attribute line2 + # The line 2 of the address. + # + # @return [String, nil] + required :line2, String, nil?: true + + # @!attribute postal_code + # The postal code of the address. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # The state of the address. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!method initialize(city:, country:, line1:, line2:, postal_code:, state:) + # The physical address associated with this payout account + # + # @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 postal_code [String, nil] The postal code of the address. + # + # @param state [String, nil] The state of the address. + end + + # @see WhopSDK::Models::PayoutAccountRetrieveResponse#business_representative + class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel + # @!attribute date_of_birth + # The date of birth of the business representative in ISO 8601 format + # (YYYY-MM-DD). + # + # @return [String, nil] + required :date_of_birth, String, nil?: true + + # @!attribute first_name + # The first name of the business representative. + # + # @return [String, nil] + required :first_name, String, nil?: true + + # @!attribute last_name + # The last name of the business representative. + # + # @return [String, nil] + required :last_name, String, nil?: true + + # @!attribute middle_name + # The middle name of the business representative. + # + # @return [String, nil] + required :middle_name, String, nil?: true + + # @!method initialize(date_of_birth:, first_name:, last_name:, middle_name:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative} for + # more details. + # + # The business representative for this payout account + # + # @param date_of_birth [String, nil] The date of birth of the business representative in ISO 8601 format (YYYY-MM-DD) + # + # @param first_name [String, nil] The first name of the business representative. + # + # @param last_name [String, nil] The last name of the business representative. + # + # @param middle_name [String, nil] The middle name of the business representative. + end + + # @see WhopSDK::Models::PayoutAccountRetrieveResponse#latest_verification + class LatestVerification < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the verification. + # + # @return [String] + required :id, String + + # @!attribute last_error_code + # An error code for a verification attempt. + # + # @return [Symbol, WhopSDK::Models::VerificationErrorCode, nil] + required :last_error_code, enum: -> { WhopSDK::VerificationErrorCode }, nil?: true + + # @!attribute last_error_reason + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + # + # @return [String, nil] + required :last_error_reason, String, nil?: true + + # @!attribute status + # The current status of this verification session. + # + # @return [Symbol, WhopSDK::Models::VerificationStatus] + required :status, enum: -> { WhopSDK::VerificationStatus } + + # @!method initialize(id:, last_error_code:, last_error_reason:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification} for more + # details. + # + # The latest verification for the connected account. + # + # @param id [String] The unique identifier for the verification. + # + # @param last_error_code [Symbol, WhopSDK::Models::VerificationErrorCode, nil] An error code for a verification attempt. + # + # @param last_error_reason [String, nil] A human-readable explanation of the most recent verification error. Null if no e + # + # @param status [Symbol, WhopSDK::Models::VerificationStatus] The current status of this verification session. + end + end + end +end diff --git a/lib/whop_sdk/models/payout_account_status_updated_webhook_event.rb b/lib/whop_sdk/models/payout_account_status_updated_webhook_event.rb index 272e67f1..8d4ad0e6 100644 --- a/lib/whop_sdk/models/payout_account_status_updated_webhook_event.rb +++ b/lib/whop_sdk/models/payout_account_status_updated_webhook_event.rb @@ -104,12 +104,8 @@ class Data < WhopSDK::Internal::Type::BaseModel # The granular calculated statuses reflecting payout account KYC and withdrawal # readiness. # - # @return [Symbol, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::Status, nil] - required :status, - enum: -> { - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status - }, - nil?: true + # @return [Symbol, WhopSDK::Models::PayoutAccountCalculatedStatuses, nil] + required :status, enum: -> { WhopSDK::PayoutAccountCalculatedStatuses }, nil?: true # @!method initialize(id:, address:, business_name:, business_representative:, email:, latest_verification:, phone:, status:) # Some parameter documentations has been truncated, see @@ -132,7 +128,7 @@ class Data < WhopSDK::Internal::Type::BaseModel # # @param phone [String, nil] The business representative's phone # - # @param status [Symbol, WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::Status, nil] The granular calculated statuses reflecting payout account KYC and withdrawal re + # @param status [Symbol, WhopSDK::Models::PayoutAccountCalculatedStatuses, nil] The granular calculated statuses reflecting payout account KYC and withdrawal re # @see WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data#address class Address < WhopSDK::Internal::Type::BaseModel @@ -273,24 +269,6 @@ class LatestVerification < WhopSDK::Internal::Type::BaseModel # # @param status [Symbol, WhopSDK::Models::VerificationStatus] The current status of this verification session. end - - # The granular calculated statuses reflecting payout account KYC and withdrawal - # readiness. - # - # @see WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data#status - module Status - extend WhopSDK::Internal::Type::Enum - - CONNECTED = :connected - DISABLED = :disabled - ACTION_REQUIRED = :action_required - PENDING_VERIFICATION = :pending_verification - VERIFICATION_FAILED = :verification_failed - NOT_STARTED = :not_started - - # @!method self.values - # @return [Array] - end end end end diff --git a/lib/whop_sdk/models/verification_list_params.rb b/lib/whop_sdk/models/verification_list_params.rb new file mode 100644 index 00000000..8f302d0d --- /dev/null +++ b/lib/whop_sdk/models/verification_list_params.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Verifications#list + class VerificationListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + # @!attribute payout_account_id + # The unique identifier of the payout account to list verifications for. + # + # @return [String] + required :payout_account_id, String + + # @!attribute after + # Returns the elements in the list that come after the specified cursor. + # + # @return [String, nil] + optional :after, String, nil?: true + + # @!attribute before + # Returns the elements in the list that come before the specified cursor. + # + # @return [String, nil] + optional :before, String, nil?: true + + # @!attribute first + # Returns the first _n_ elements from the list. + # + # @return [Integer, nil] + optional :first, Integer, nil?: true + + # @!attribute last + # Returns the last _n_ elements from the list. + # + # @return [Integer, nil] + optional :last, Integer, nil?: true + + # @!method initialize(payout_account_id:, after: nil, before: nil, first: nil, last: nil, request_options: {}) + # @param payout_account_id [String] The unique identifier of the payout account to list verifications for. + # + # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # + # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # + # @param first [Integer, nil] Returns the first _n_ elements from the list. + # + # @param last [Integer, nil] Returns the last _n_ elements from the list. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/whop_sdk/models/verification_list_response.rb b/lib/whop_sdk/models/verification_list_response.rb new file mode 100644 index 00000000..80c7c370 --- /dev/null +++ b/lib/whop_sdk/models/verification_list_response.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module WhopSDK + module Models + # @see WhopSDK::Resources::Verifications#list + class VerificationListResponse < WhopSDK::Internal::Type::BaseModel + # @!attribute id + # The unique identifier for the verification. + # + # @return [String] + required :id, String + + # @!attribute last_error_code + # An error code for a verification attempt. + # + # @return [Symbol, WhopSDK::Models::VerificationErrorCode, nil] + required :last_error_code, enum: -> { WhopSDK::VerificationErrorCode }, nil?: true + + # @!attribute last_error_reason + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + # + # @return [String, nil] + required :last_error_reason, String, nil?: true + + # @!attribute status + # The current status of this verification session. + # + # @return [Symbol, WhopSDK::Models::VerificationStatus] + required :status, enum: -> { WhopSDK::VerificationStatus } + + # @!method initialize(id:, last_error_code:, last_error_reason:, status:) + # Some parameter documentations has been truncated, see + # {WhopSDK::Models::VerificationListResponse} for more details. + # + # An identity verification session used to confirm a person or entity's identity + # for payout account eligibility. + # + # @param id [String] The unique identifier for the verification. + # + # @param last_error_code [Symbol, WhopSDK::Models::VerificationErrorCode, nil] An error code for a verification attempt. + # + # @param last_error_reason [String, nil] A human-readable explanation of the most recent verification error. Null if no e + # + # @param status [Symbol, WhopSDK::Models::VerificationStatus] The current status of this verification session. + end + end +end diff --git a/lib/whop_sdk/resources/payout_accounts.rb b/lib/whop_sdk/resources/payout_accounts.rb new file mode 100644 index 00000000..294e7107 --- /dev/null +++ b/lib/whop_sdk/resources/payout_accounts.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module WhopSDK + module Resources + # Payout accounts + class PayoutAccounts + # Retrieves the details of an existing payout account. + # + # Required permissions: + # + # - `payout:account:read` + # + # @overload retrieve(id, request_options: {}) + # + # @param id [String] The unique identifier of the payout account to retrieve. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Models::PayoutAccountRetrieveResponse] + # + # @see WhopSDK::Models::PayoutAccountRetrieveParams + def retrieve(id, params = {}) + @client.request( + method: :get, + path: ["payout_accounts/%1$s", id], + model: WhopSDK::Models::PayoutAccountRetrieveResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [WhopSDK::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/whop_sdk/resources/verifications.rb b/lib/whop_sdk/resources/verifications.rb index 4890329e..65af7443 100644 --- a/lib/whop_sdk/resources/verifications.rb +++ b/lib/whop_sdk/resources/verifications.rb @@ -28,6 +28,43 @@ def retrieve(id, params = {}) ) end + # Returns a list of identity verifications for a payout account, ordered by most + # recent first. + # + # Required permissions: + # + # - `payout:account:read` + # + # @overload list(payout_account_id:, after: nil, before: nil, first: nil, last: nil, request_options: {}) + # + # @param payout_account_id [String] The unique identifier of the payout account to list verifications for. + # + # @param after [String, nil] Returns the elements in the list that come after the specified cursor. + # + # @param before [String, nil] Returns the elements in the list that come before the specified cursor. + # + # @param first [Integer, nil] Returns the first _n_ elements from the list. + # + # @param last [Integer, nil] Returns the last _n_ elements from the list. + # + # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [WhopSDK::Internal::CursorPage] + # + # @see WhopSDK::Models::VerificationListParams + def list(params) + parsed, options = WhopSDK::VerificationListParams.dump_request(params) + query = WhopSDK::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "verifications", + query: query, + page: WhopSDK::Internal::CursorPage, + model: WhopSDK::Models::VerificationListResponse, + options: options + ) + end + # @api private # # @param client [WhopSDK::Client] diff --git a/rbi/whop_sdk/client.rbi b/rbi/whop_sdk/client.rbi index ee4fdfdc..eae08caa 100644 --- a/rbi/whop_sdk/client.rbi +++ b/rbi/whop_sdk/client.rbi @@ -228,6 +228,10 @@ module WhopSDK sig { returns(WhopSDK::Resources::ResolutionCenterCases) } attr_reader :resolution_center_cases + # Payout accounts + sig { returns(WhopSDK::Resources::PayoutAccounts) } + attr_reader :payout_accounts + # @api private sig { override.returns(T::Hash[String, String]) } private def auth_headers diff --git a/rbi/whop_sdk/models.rbi b/rbi/whop_sdk/models.rbi index 2115495b..96e74f4c 100644 --- a/rbi/whop_sdk/models.rbi +++ b/rbi/whop_sdk/models.rbi @@ -448,6 +448,11 @@ module WhopSDK PaymentVoidParams = WhopSDK::Models::PaymentVoidParams + PayoutAccountCalculatedStatuses = + WhopSDK::Models::PayoutAccountCalculatedStatuses + + PayoutAccountRetrieveParams = WhopSDK::Models::PayoutAccountRetrieveParams + PayoutAccountStatusUpdatedWebhookEvent = WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent @@ -626,6 +631,8 @@ module WhopSDK VerificationErrorCode = WhopSDK::Models::VerificationErrorCode + VerificationListParams = WhopSDK::Models::VerificationListParams + VerificationRetrieveParams = WhopSDK::Models::VerificationRetrieveParams VerificationStatus = WhopSDK::Models::VerificationStatus diff --git a/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi b/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi index 89c4595c..509a537c 100644 --- a/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +++ b/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi @@ -520,9 +520,7 @@ module WhopSDK # readiness. sig do returns( - T.nilable( - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol - ) + T.nilable(WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol) ) end attr_accessor :status @@ -547,9 +545,7 @@ module WhopSDK ), phone: T.nilable(String), status: - T.nilable( - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::OrSymbol - ) + T.nilable(WhopSDK::PayoutAccountCalculatedStatuses::OrSymbol) ).returns(T.attached_class) end def self.new( @@ -594,7 +590,7 @@ module WhopSDK phone: T.nilable(String), status: T.nilable( - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol + WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol ) } ) @@ -805,62 +801,6 @@ module WhopSDK def to_hash end end - - # The granular calculated statuses reflecting payout account KYC and withdrawal - # readiness. - module Status - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CONNECTED = - T.let( - :connected, - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol - ) - DISABLED = - T.let( - :disabled, - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol - ) - ACTION_REQUIRED = - T.let( - :action_required, - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol - ) - PENDING_VERIFICATION = - T.let( - :pending_verification, - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol - ) - VERIFICATION_FAILED = - T.let( - :verification_failed, - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol - ) - NOT_STARTED = - T.let( - :not_started, - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::Status::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/whop_sdk/models/payout_account_calculated_statuses.rbi b/rbi/whop_sdk/models/payout_account_calculated_statuses.rbi new file mode 100644 index 00000000..62c01afc --- /dev/null +++ b/rbi/whop_sdk/models/payout_account_calculated_statuses.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module WhopSDK + module Models + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + module PayoutAccountCalculatedStatuses + extend WhopSDK::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, WhopSDK::PayoutAccountCalculatedStatuses) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONNECTED = + T.let( + :connected, + WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol + ) + DISABLED = + T.let(:disabled, WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol) + ACTION_REQUIRED = + T.let( + :action_required, + WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol + ) + PENDING_VERIFICATION = + T.let( + :pending_verification, + WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol + ) + VERIFICATION_FAILED = + T.let( + :verification_failed, + WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol + ) + NOT_STARTED = + T.let( + :not_started, + WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol + ) + + sig do + override.returns( + T::Array[WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/whop_sdk/models/payout_account_retrieve_params.rbi b/rbi/whop_sdk/models/payout_account_retrieve_params.rbi new file mode 100644 index 00000000..d9b600f3 --- /dev/null +++ b/rbi/whop_sdk/models/payout_account_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutAccountRetrieveParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + WhopSDK::PayoutAccountRetrieveParams, + 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/payout_account_retrieve_response.rbi b/rbi/whop_sdk/models/payout_account_retrieve_response.rbi new file mode 100644 index 00000000..0e5d430e --- /dev/null +++ b/rbi/whop_sdk/models/payout_account_retrieve_response.rbi @@ -0,0 +1,370 @@ +# typed: strong + +module WhopSDK + module Models + class PayoutAccountRetrieveResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutAccountRetrieveResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the payout account. + sig { returns(String) } + attr_accessor :id + + # The physical address associated with this payout account + sig do + returns( + T.nilable(WhopSDK::Models::PayoutAccountRetrieveResponse::Address) + ) + end + attr_reader :address + + sig do + params( + address: + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::Address::OrHash + ) + ).void + end + attr_writer :address + + # The company's legal name + sig { returns(T.nilable(String)) } + attr_accessor :business_name + + # The business representative for this payout account + sig do + returns( + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative + ) + ) + end + attr_reader :business_representative + + sig do + params( + business_representative: + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative::OrHash + ) + ).void + end + attr_writer :business_representative + + # The email address of the representative + sig { returns(T.nilable(String)) } + attr_accessor :email + + # The latest verification for the connected account. + sig do + returns( + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification + ) + ) + end + attr_reader :latest_verification + + sig do + params( + latest_verification: + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification::OrHash + ) + ).void + end + attr_writer :latest_verification + + # The business representative's phone + sig { returns(T.nilable(String)) } + attr_accessor :phone + + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + sig do + returns( + T.nilable(WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol) + ) + end + attr_accessor :status + + # An object representing an account used for payouts. + sig do + params( + id: String, + address: + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::Address::OrHash + ), + business_name: T.nilable(String), + business_representative: + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative::OrHash + ), + email: T.nilable(String), + latest_verification: + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification::OrHash + ), + phone: T.nilable(String), + status: T.nilable(WhopSDK::PayoutAccountCalculatedStatuses::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the payout account. + id:, + # The physical address associated with this payout account + address:, + # The company's legal name + business_name:, + # The business representative for this payout account + business_representative:, + # The email address of the representative + email:, + # The latest verification for the connected account. + latest_verification:, + # The business representative's phone + phone:, + # The granular calculated statuses reflecting payout account KYC and withdrawal + # readiness. + status: + ) + end + + sig do + override.returns( + { + id: String, + address: + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::Address + ), + business_name: T.nilable(String), + business_representative: + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative + ), + email: T.nilable(String), + latest_verification: + T.nilable( + WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification + ), + phone: T.nilable(String), + status: + T.nilable(WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol) + } + ) + end + def to_hash + end + + class Address < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutAccountRetrieveResponse::Address, + 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 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 physical address associated with this payout account + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The city of the address. + city:, + # The country of the address. + country:, + # The line 1 of the address. + line1:, + # The line 2 of the address. + line2:, + # The postal code of the address. + postal_code:, + # The state of the address. + state: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + line1: T.nilable(String), + line2: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String) + } + ) + end + def to_hash + end + end + + class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative, + WhopSDK::Internal::AnyHash + ) + end + + # The date of birth of the business representative in ISO 8601 format + # (YYYY-MM-DD). + sig { returns(T.nilable(String)) } + attr_accessor :date_of_birth + + # The first name of the business representative. + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + # The last name of the business representative. + sig { returns(T.nilable(String)) } + attr_accessor :last_name + + # The middle name of the business representative. + sig { returns(T.nilable(String)) } + attr_accessor :middle_name + + # The business representative for this payout account + sig do + params( + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + middle_name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The date of birth of the business representative in ISO 8601 format + # (YYYY-MM-DD). + date_of_birth:, + # The first name of the business representative. + first_name:, + # The last name of the business representative. + last_name:, + # The middle name of the business representative. + middle_name: + ) + end + + sig do + override.returns( + { + date_of_birth: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + middle_name: T.nilable(String) + } + ) + end + def to_hash + end + end + + class LatestVerification < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the verification. + sig { returns(String) } + attr_accessor :id + + # An error code for a verification attempt. + sig { returns(T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol)) } + attr_accessor :last_error_code + + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + sig { returns(T.nilable(String)) } + attr_accessor :last_error_reason + + # The current status of this verification session. + sig { returns(WhopSDK::VerificationStatus::TaggedSymbol) } + attr_accessor :status + + # The latest verification for the connected account. + sig do + params( + id: String, + last_error_code: + T.nilable(WhopSDK::VerificationErrorCode::OrSymbol), + last_error_reason: T.nilable(String), + status: WhopSDK::VerificationStatus::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the verification. + id:, + # An error code for a verification attempt. + last_error_code:, + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + last_error_reason:, + # The current status of this verification session. + status: + ) + end + + sig do + override.returns( + { + id: String, + last_error_code: + T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol), + last_error_reason: T.nilable(String), + status: WhopSDK::VerificationStatus::TaggedSymbol + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/whop_sdk/models/payout_account_status_updated_webhook_event.rbi b/rbi/whop_sdk/models/payout_account_status_updated_webhook_event.rbi index 5a8cf185..5c27b9fe 100644 --- a/rbi/whop_sdk/models/payout_account_status_updated_webhook_event.rbi +++ b/rbi/whop_sdk/models/payout_account_status_updated_webhook_event.rbi @@ -172,9 +172,7 @@ module WhopSDK # readiness. sig do returns( - T.nilable( - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol - ) + T.nilable(WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol) ) end attr_accessor :status @@ -199,9 +197,7 @@ module WhopSDK ), phone: T.nilable(String), status: - T.nilable( - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::OrSymbol - ) + T.nilable(WhopSDK::PayoutAccountCalculatedStatuses::OrSymbol) ).returns(T.attached_class) end def self.new( @@ -246,7 +242,7 @@ module WhopSDK phone: T.nilable(String), status: T.nilable( - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol + WhopSDK::PayoutAccountCalculatedStatuses::TaggedSymbol ) } ) @@ -457,62 +453,6 @@ module WhopSDK def to_hash end end - - # The granular calculated statuses reflecting payout account KYC and withdrawal - # readiness. - module Status - extend WhopSDK::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CONNECTED = - T.let( - :connected, - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol - ) - DISABLED = - T.let( - :disabled, - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol - ) - ACTION_REQUIRED = - T.let( - :action_required, - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol - ) - PENDING_VERIFICATION = - T.let( - :pending_verification, - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol - ) - VERIFICATION_FAILED = - T.let( - :verification_failed, - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol - ) - NOT_STARTED = - T.let( - :not_started, - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::Status::TaggedSymbol - ] - ) - end - def self.values - end - end end end end diff --git a/rbi/whop_sdk/models/verification_list_params.rbi b/rbi/whop_sdk/models/verification_list_params.rbi new file mode 100644 index 00000000..c5aded88 --- /dev/null +++ b/rbi/whop_sdk/models/verification_list_params.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module WhopSDK + module Models + class VerificationListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(WhopSDK::VerificationListParams, WhopSDK::Internal::AnyHash) + end + + # The unique identifier of the payout account to list verifications for. + sig { returns(String) } + attr_accessor :payout_account_id + + # Returns the elements in the list that come after the specified cursor. + sig { returns(T.nilable(String)) } + attr_accessor :after + + # Returns the elements in the list that come before the specified cursor. + sig { returns(T.nilable(String)) } + attr_accessor :before + + # Returns the first _n_ elements from the list. + sig { returns(T.nilable(Integer)) } + attr_accessor :first + + # Returns the last _n_ elements from the list. + sig { returns(T.nilable(Integer)) } + attr_accessor :last + + sig do + params( + payout_account_id: String, + after: T.nilable(String), + before: T.nilable(String), + first: T.nilable(Integer), + last: T.nilable(Integer), + request_options: WhopSDK::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The unique identifier of the payout account to list verifications for. + payout_account_id:, + # Returns the elements in the list that come after the specified cursor. + after: nil, + # Returns the elements in the list that come before the specified cursor. + before: nil, + # Returns the first _n_ elements from the list. + first: nil, + # Returns the last _n_ elements from the list. + last: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + payout_account_id: String, + after: T.nilable(String), + before: T.nilable(String), + first: T.nilable(Integer), + last: T.nilable(Integer), + request_options: WhopSDK::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/models/verification_list_response.rbi b/rbi/whop_sdk/models/verification_list_response.rbi new file mode 100644 index 00000000..ba0426a6 --- /dev/null +++ b/rbi/whop_sdk/models/verification_list_response.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module WhopSDK + module Models + class VerificationListResponse < WhopSDK::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + WhopSDK::Models::VerificationListResponse, + WhopSDK::Internal::AnyHash + ) + end + + # The unique identifier for the verification. + sig { returns(String) } + attr_accessor :id + + # An error code for a verification attempt. + sig { returns(T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol)) } + attr_accessor :last_error_code + + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + sig { returns(T.nilable(String)) } + attr_accessor :last_error_reason + + # The current status of this verification session. + sig { returns(WhopSDK::VerificationStatus::TaggedSymbol) } + attr_accessor :status + + # An identity verification session used to confirm a person or entity's identity + # for payout account eligibility. + sig do + params( + id: String, + last_error_code: T.nilable(WhopSDK::VerificationErrorCode::OrSymbol), + last_error_reason: T.nilable(String), + status: WhopSDK::VerificationStatus::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The unique identifier for the verification. + id:, + # An error code for a verification attempt. + last_error_code:, + # A human-readable explanation of the most recent verification error. Null if no + # error has occurred. + last_error_reason:, + # The current status of this verification session. + status: + ) + end + + sig do + override.returns( + { + id: String, + last_error_code: + T.nilable(WhopSDK::VerificationErrorCode::TaggedSymbol), + last_error_reason: T.nilable(String), + status: WhopSDK::VerificationStatus::TaggedSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/whop_sdk/resources/payout_accounts.rbi b/rbi/whop_sdk/resources/payout_accounts.rbi new file mode 100644 index 00000000..99b1833a --- /dev/null +++ b/rbi/whop_sdk/resources/payout_accounts.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module WhopSDK + module Resources + # Payout accounts + class PayoutAccounts + # Retrieves the details of an existing payout account. + # + # Required permissions: + # + # - `payout:account:read` + sig do + params( + id: String, + request_options: WhopSDK::RequestOptions::OrHash + ).returns(WhopSDK::Models::PayoutAccountRetrieveResponse) + end + def retrieve( + # The unique identifier of the payout account to retrieve. + id, + request_options: {} + ) + end + + # @api private + sig { params(client: WhopSDK::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/whop_sdk/resources/verifications.rbi b/rbi/whop_sdk/resources/verifications.rbi index eb6c5fe1..b77d0e30 100644 --- a/rbi/whop_sdk/resources/verifications.rbi +++ b/rbi/whop_sdk/resources/verifications.rbi @@ -22,6 +22,41 @@ module WhopSDK ) end + # Returns a list of identity verifications for a payout account, ordered by most + # recent first. + # + # Required permissions: + # + # - `payout:account:read` + sig do + params( + payout_account_id: String, + after: T.nilable(String), + before: T.nilable(String), + first: T.nilable(Integer), + last: T.nilable(Integer), + request_options: WhopSDK::RequestOptions::OrHash + ).returns( + WhopSDK::Internal::CursorPage[ + WhopSDK::Models::VerificationListResponse + ] + ) + end + def list( + # The unique identifier of the payout account to list verifications for. + payout_account_id:, + # Returns the elements in the list that come after the specified cursor. + after: nil, + # Returns the elements in the list that come before the specified cursor. + before: nil, + # Returns the first _n_ elements from the list. + first: nil, + # Returns the last _n_ elements from the list. + last: nil, + request_options: {} + ) + end + # @api private sig { params(client: WhopSDK::Client).returns(T.attached_class) } def self.new(client:) diff --git a/sig/whop_sdk/client.rbs b/sig/whop_sdk/client.rbs index 4611d31c..65846278 100644 --- a/sig/whop_sdk/client.rbs +++ b/sig/whop_sdk/client.rbs @@ -116,6 +116,8 @@ module WhopSDK attr_reader resolution_center_cases: WhopSDK::Resources::ResolutionCenterCases + attr_reader payout_accounts: WhopSDK::Resources::PayoutAccounts + private def auth_headers: -> ::Hash[String, String] def initialize: ( diff --git a/sig/whop_sdk/models.rbs b/sig/whop_sdk/models.rbs index 3a38237e..74a54487 100644 --- a/sig/whop_sdk/models.rbs +++ b/sig/whop_sdk/models.rbs @@ -429,6 +429,10 @@ module WhopSDK class PaymentVoidParams = WhopSDK::Models::PaymentVoidParams + module PayoutAccountCalculatedStatuses = WhopSDK::Models::PayoutAccountCalculatedStatuses + + class PayoutAccountRetrieveParams = WhopSDK::Models::PayoutAccountRetrieveParams + class PayoutAccountStatusUpdatedWebhookEvent = WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent module PayoutDestinationCategory = WhopSDK::Models::PayoutDestinationCategory @@ -597,6 +601,8 @@ module WhopSDK module VerificationErrorCode = WhopSDK::Models::VerificationErrorCode + class VerificationListParams = WhopSDK::Models::VerificationListParams + class VerificationRetrieveParams = WhopSDK::Models::VerificationRetrieveParams module VerificationStatus = WhopSDK::Models::VerificationStatus diff --git a/sig/whop_sdk/models/ledger_account_retrieve_response.rbs b/sig/whop_sdk/models/ledger_account_retrieve_response.rbs index b0daddfb..a9435452 100644 --- a/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +++ b/sig/whop_sdk/models/ledger_account_retrieve_response.rbs @@ -176,7 +176,7 @@ module WhopSDK email: String?, latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification?, phone: String?, - status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status? + status: WhopSDK::Models::payout_account_calculated_statuses? } class PayoutAccountDetails < WhopSDK::Internal::Type::BaseModel @@ -194,7 +194,7 @@ module WhopSDK attr_accessor phone: String? - attr_accessor status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status? + attr_accessor status: WhopSDK::Models::payout_account_calculated_statuses? def initialize: ( id: String, @@ -204,7 +204,7 @@ module WhopSDK email: String?, latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification?, phone: String?, - status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status? + status: WhopSDK::Models::payout_account_calculated_statuses? ) -> void def to_hash: -> { @@ -215,7 +215,7 @@ module WhopSDK email: String?, latest_verification: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::LatestVerification?, phone: String?, - status: WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status? + status: WhopSDK::Models::payout_account_calculated_statuses? } type address = @@ -323,27 +323,6 @@ module WhopSDK status: WhopSDK::Models::verification_status } end - - type status = - :connected - | :disabled - | :action_required - | :pending_verification - | :verification_failed - | :not_started - - module Status - extend WhopSDK::Internal::Type::Enum - - CONNECTED: :connected - DISABLED: :disabled - ACTION_REQUIRED: :action_required - PENDING_VERIFICATION: :pending_verification - VERIFICATION_FAILED: :verification_failed - NOT_STARTED: :not_started - - def self?.values: -> ::Array[WhopSDK::Models::LedgerAccountRetrieveResponse::PayoutAccountDetails::status] - end end end end diff --git a/sig/whop_sdk/models/payout_account_calculated_statuses.rbs b/sig/whop_sdk/models/payout_account_calculated_statuses.rbs new file mode 100644 index 00000000..69d1accf --- /dev/null +++ b/sig/whop_sdk/models/payout_account_calculated_statuses.rbs @@ -0,0 +1,24 @@ +module WhopSDK + module Models + type payout_account_calculated_statuses = + :connected + | :disabled + | :action_required + | :pending_verification + | :verification_failed + | :not_started + + module PayoutAccountCalculatedStatuses + extend WhopSDK::Internal::Type::Enum + + CONNECTED: :connected + DISABLED: :disabled + ACTION_REQUIRED: :action_required + PENDING_VERIFICATION: :pending_verification + VERIFICATION_FAILED: :verification_failed + NOT_STARTED: :not_started + + def self?.values: -> ::Array[WhopSDK::Models::payout_account_calculated_statuses] + end + end +end diff --git a/sig/whop_sdk/models/payout_account_retrieve_params.rbs b/sig/whop_sdk/models/payout_account_retrieve_params.rbs new file mode 100644 index 00000000..f440aebd --- /dev/null +++ b/sig/whop_sdk/models/payout_account_retrieve_params.rbs @@ -0,0 +1,20 @@ +module WhopSDK + module Models + type payout_account_retrieve_params = + { id: String } & WhopSDK::Internal::Type::request_parameters + + class PayoutAccountRetrieveParams < 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/payout_account_retrieve_response.rbs b/sig/whop_sdk/models/payout_account_retrieve_response.rbs new file mode 100644 index 00000000..e6e21e63 --- /dev/null +++ b/sig/whop_sdk/models/payout_account_retrieve_response.rbs @@ -0,0 +1,161 @@ +module WhopSDK + module Models + type payout_account_retrieve_response = + { + id: String, + address: WhopSDK::Models::PayoutAccountRetrieveResponse::Address?, + business_name: String?, + business_representative: WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative?, + email: String?, + latest_verification: WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification?, + phone: String?, + status: WhopSDK::Models::payout_account_calculated_statuses? + } + + class PayoutAccountRetrieveResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor address: WhopSDK::Models::PayoutAccountRetrieveResponse::Address? + + attr_accessor business_name: String? + + attr_accessor business_representative: WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative? + + attr_accessor email: String? + + attr_accessor latest_verification: WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification? + + attr_accessor phone: String? + + attr_accessor status: WhopSDK::Models::payout_account_calculated_statuses? + + def initialize: ( + id: String, + address: WhopSDK::Models::PayoutAccountRetrieveResponse::Address?, + business_name: String?, + business_representative: WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative?, + email: String?, + latest_verification: WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification?, + phone: String?, + status: WhopSDK::Models::payout_account_calculated_statuses? + ) -> void + + def to_hash: -> { + id: String, + address: WhopSDK::Models::PayoutAccountRetrieveResponse::Address?, + business_name: String?, + business_representative: WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative?, + email: String?, + latest_verification: WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification?, + phone: String?, + status: WhopSDK::Models::payout_account_calculated_statuses? + } + + type address = + { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + + class Address < WhopSDK::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor line1: String? + + attr_accessor line2: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + def initialize: ( + city: String?, + country: String?, + line1: String?, + line2: String?, + postal_code: String?, + state: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + :line1 => String?, + :line2 => String?, + postal_code: String?, + state: String? + } + end + + type business_representative = + { + date_of_birth: String?, + first_name: String?, + last_name: String?, + middle_name: String? + } + + class BusinessRepresentative < WhopSDK::Internal::Type::BaseModel + attr_accessor date_of_birth: String? + + attr_accessor first_name: String? + + attr_accessor last_name: String? + + attr_accessor middle_name: String? + + def initialize: ( + date_of_birth: String?, + first_name: String?, + last_name: String?, + middle_name: String? + ) -> void + + def to_hash: -> { + date_of_birth: String?, + first_name: String?, + last_name: String?, + middle_name: String? + } + end + + type latest_verification = + { + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + } + + class LatestVerification < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor last_error_code: WhopSDK::Models::verification_error_code? + + attr_accessor last_error_reason: String? + + attr_accessor status: WhopSDK::Models::verification_status + + def initialize: ( + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + ) -> void + + def to_hash: -> { + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + } + end + end + end +end diff --git a/sig/whop_sdk/models/payout_account_status_updated_webhook_event.rbs b/sig/whop_sdk/models/payout_account_status_updated_webhook_event.rbs index 253165b4..e28246b7 100644 --- a/sig/whop_sdk/models/payout_account_status_updated_webhook_event.rbs +++ b/sig/whop_sdk/models/payout_account_status_updated_webhook_event.rbs @@ -50,7 +50,7 @@ module WhopSDK email: String?, latest_verification: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification?, phone: String?, - status: WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status? + status: WhopSDK::Models::payout_account_calculated_statuses? } class Data < WhopSDK::Internal::Type::BaseModel @@ -68,7 +68,7 @@ module WhopSDK attr_accessor phone: String? - attr_accessor status: WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status? + attr_accessor status: WhopSDK::Models::payout_account_calculated_statuses? def initialize: ( id: String, @@ -78,7 +78,7 @@ module WhopSDK email: String?, latest_verification: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification?, phone: String?, - status: WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status? + status: WhopSDK::Models::payout_account_calculated_statuses? ) -> void def to_hash: -> { @@ -89,7 +89,7 @@ module WhopSDK email: String?, latest_verification: WhopSDK::PayoutAccountStatusUpdatedWebhookEvent::Data::LatestVerification?, phone: String?, - status: WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status? + status: WhopSDK::Models::payout_account_calculated_statuses? } type address = @@ -197,27 +197,6 @@ module WhopSDK status: WhopSDK::Models::verification_status } end - - type status = - :connected - | :disabled - | :action_required - | :pending_verification - | :verification_failed - | :not_started - - module Status - extend WhopSDK::Internal::Type::Enum - - CONNECTED: :connected - DISABLED: :disabled - ACTION_REQUIRED: :action_required - PENDING_VERIFICATION: :pending_verification - VERIFICATION_FAILED: :verification_failed - NOT_STARTED: :not_started - - def self?.values: -> ::Array[WhopSDK::Models::PayoutAccountStatusUpdatedWebhookEvent::Data::status] - end end end end diff --git a/sig/whop_sdk/models/verification_list_params.rbs b/sig/whop_sdk/models/verification_list_params.rbs new file mode 100644 index 00000000..6a48e44c --- /dev/null +++ b/sig/whop_sdk/models/verification_list_params.rbs @@ -0,0 +1,46 @@ +module WhopSDK + module Models + type verification_list_params = + { + payout_account_id: String, + after: String?, + before: String?, + first: Integer?, + last: Integer? + } + & WhopSDK::Internal::Type::request_parameters + + class VerificationListParams < WhopSDK::Internal::Type::BaseModel + extend WhopSDK::Internal::Type::RequestParameters::Converter + include WhopSDK::Internal::Type::RequestParameters + + attr_accessor payout_account_id: String + + attr_accessor after: String? + + attr_accessor before: String? + + attr_accessor first: Integer? + + attr_accessor last: Integer? + + def initialize: ( + payout_account_id: String, + ?after: String?, + ?before: String?, + ?first: Integer?, + ?last: Integer?, + ?request_options: WhopSDK::request_opts + ) -> void + + def to_hash: -> { + payout_account_id: String, + after: String?, + before: String?, + first: Integer?, + last: Integer?, + request_options: WhopSDK::RequestOptions + } + end + end +end diff --git a/sig/whop_sdk/models/verification_list_response.rbs b/sig/whop_sdk/models/verification_list_response.rbs new file mode 100644 index 00000000..91673921 --- /dev/null +++ b/sig/whop_sdk/models/verification_list_response.rbs @@ -0,0 +1,35 @@ +module WhopSDK + module Models + type verification_list_response = + { + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + } + + class VerificationListResponse < WhopSDK::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor last_error_code: WhopSDK::Models::verification_error_code? + + attr_accessor last_error_reason: String? + + attr_accessor status: WhopSDK::Models::verification_status + + def initialize: ( + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + ) -> void + + def to_hash: -> { + id: String, + last_error_code: WhopSDK::Models::verification_error_code?, + last_error_reason: String?, + status: WhopSDK::Models::verification_status + } + end + end +end diff --git a/sig/whop_sdk/resources/payout_accounts.rbs b/sig/whop_sdk/resources/payout_accounts.rbs new file mode 100644 index 00000000..39285b4e --- /dev/null +++ b/sig/whop_sdk/resources/payout_accounts.rbs @@ -0,0 +1,12 @@ +module WhopSDK + module Resources + class PayoutAccounts + def retrieve: ( + String id, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Models::PayoutAccountRetrieveResponse + + def initialize: (client: WhopSDK::Client) -> void + end + end +end diff --git a/sig/whop_sdk/resources/verifications.rbs b/sig/whop_sdk/resources/verifications.rbs index bc8bf196..93318ad8 100644 --- a/sig/whop_sdk/resources/verifications.rbs +++ b/sig/whop_sdk/resources/verifications.rbs @@ -6,6 +6,15 @@ module WhopSDK ?request_options: WhopSDK::request_opts ) -> WhopSDK::Models::VerificationRetrieveResponse + def list: ( + payout_account_id: String, + ?after: String?, + ?before: String?, + ?first: Integer?, + ?last: Integer?, + ?request_options: WhopSDK::request_opts + ) -> WhopSDK::Internal::CursorPage[WhopSDK::Models::VerificationListResponse] + def initialize: (client: WhopSDK::Client) -> void end end diff --git a/test/whop_sdk/resources/payout_accounts_test.rb b/test/whop_sdk/resources/payout_accounts_test.rb new file mode 100644 index 00000000..1b451686 --- /dev/null +++ b/test/whop_sdk/resources/payout_accounts_test.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class WhopSDK::Test::Resources::PayoutAccountsTest < WhopSDK::Test::ResourceTest + def test_retrieve + skip("Mock server tests are disabled") + + response = @whop.payout_accounts.retrieve("poact_xxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Models::PayoutAccountRetrieveResponse + end + + assert_pattern do + response => { + id: String, + address: WhopSDK::Models::PayoutAccountRetrieveResponse::Address | nil, + business_name: String | nil, + business_representative: WhopSDK::Models::PayoutAccountRetrieveResponse::BusinessRepresentative | nil, + email: String | nil, + latest_verification: WhopSDK::Models::PayoutAccountRetrieveResponse::LatestVerification | nil, + phone: String | nil, + status: WhopSDK::PayoutAccountCalculatedStatuses | nil + } + end + end +end diff --git a/test/whop_sdk/resources/verifications_test.rb b/test/whop_sdk/resources/verifications_test.rb index 2be40ef1..6705246a 100644 --- a/test/whop_sdk/resources/verifications_test.rb +++ b/test/whop_sdk/resources/verifications_test.rb @@ -21,4 +21,30 @@ def test_retrieve } end end + + def test_list_required_params + skip("Mock server tests are disabled") + + response = @whop.verifications.list(payout_account_id: "poact_xxxxxxxxxxxx") + + assert_pattern do + response => WhopSDK::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => WhopSDK::Models::VerificationListResponse + end + + assert_pattern do + row => { + id: String, + last_error_code: WhopSDK::VerificationErrorCode | nil, + last_error_reason: String | nil, + status: WhopSDK::VerificationStatus + } + end + end end From 93421725c14ba75b73dc83fbbffe5d7c75f59aa6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:54:42 +0000 Subject: [PATCH 3/3] release: 0.0.33 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/whop_sdk/version.rb | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 41dea332..18a5b4e2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.32" + ".": "0.0.33" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 056a0ed4..3a9b3153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.0.33 (2026-03-12) + +Full Changelog: [v0.0.32...v0.0.33](https://github.com/whopio/whopsdk-ruby/compare/v0.0.32...v0.0.33) + +### Features + +* **api:** api update ([e9bdc24](https://github.com/whopio/whopsdk-ruby/commit/e9bdc24914a094959bb450165e5c7c261cf0063e)) +* **api:** manual updates ([a0a3ca0](https://github.com/whopio/whopsdk-ruby/commit/a0a3ca0022cdeed9b42b5b00a7d4e2f57ae4248b)) + ## 0.0.32 (2026-03-11) Full Changelog: [v0.0.31...v0.0.32](https://github.com/whopio/whopsdk-ruby/compare/v0.0.31...v0.0.32) diff --git a/Gemfile.lock b/Gemfile.lock index 421ff44d..0094da64 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - whop_sdk (0.0.32) + whop_sdk (0.0.33) cgi connection_pool standardwebhooks diff --git a/README.md b/README.md index ec7f72b2..ab7fedf8 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.32" +gem "whop_sdk", "~> 0.0.33" ``` diff --git a/lib/whop_sdk/version.rb b/lib/whop_sdk/version.rb index 95aac0f0..06665b99 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.32" + VERSION = "0.0.33" end