whop_sdk 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +12 -0
  5. data/lib/whop_sdk/models/account_link_create_params.rb +62 -0
  6. data/lib/whop_sdk/models/account_link_create_response.rb +28 -0
  7. data/lib/whop_sdk/models/app_build_create_params.rb +9 -1
  8. data/lib/whop_sdk/models/app_build_list_params.rb +17 -1
  9. data/lib/whop_sdk/models/app_list_params.rb +1 -0
  10. data/lib/whop_sdk/models/authorized_user_list_params.rb +17 -1
  11. data/lib/whop_sdk/models/checkout_configuration_list_params.rb +17 -1
  12. data/lib/whop_sdk/models/company_list_params.rb +17 -1
  13. data/lib/whop_sdk/models/dispute_list_params.rb +17 -1
  14. data/lib/whop_sdk/models/entry_list_params.rb +17 -1
  15. data/lib/whop_sdk/models/experience_list_params.rb +17 -1
  16. data/lib/whop_sdk/models/invoice_list_params.rb +17 -1
  17. data/lib/whop_sdk/models/payment.rb +90 -1
  18. data/lib/whop_sdk/models/payment_create_params.rb +307 -0
  19. data/lib/whop_sdk/models/payment_list_response.rb +90 -1
  20. data/lib/whop_sdk/models/payment_method_types.rb +1 -0
  21. data/lib/whop_sdk/models/payment_token_list_params.rb +78 -0
  22. data/lib/whop_sdk/models/payment_token_list_response.rb +86 -0
  23. data/lib/whop_sdk/models/payment_token_retrieve_params.rb +22 -0
  24. data/lib/whop_sdk/models/payment_token_retrieve_response.rb +86 -0
  25. data/lib/whop_sdk/models/plan_create_params.rb +3 -21
  26. data/lib/whop_sdk/models/plan_list_params.rb +17 -1
  27. data/lib/whop_sdk/models/product_list_params.rb +17 -1
  28. data/lib/whop_sdk/models/product_update_params.rb +1 -61
  29. data/lib/whop_sdk/models/promo_code_list_params.rb +17 -1
  30. data/lib/whop_sdk/models/refund_list_params.rb +17 -1
  31. data/lib/whop_sdk/models/review_list_params.rb +17 -1
  32. data/lib/whop_sdk/models/setup_intent.rb +253 -0
  33. data/lib/whop_sdk/models/setup_intent_canceled_webhook_event.rb +52 -0
  34. data/lib/whop_sdk/models/setup_intent_list_params.rb +78 -0
  35. data/lib/whop_sdk/models/setup_intent_list_response.rb +255 -0
  36. data/lib/whop_sdk/models/setup_intent_requires_action_webhook_event.rb +52 -0
  37. data/lib/whop_sdk/models/setup_intent_retrieve_params.rb +14 -0
  38. data/lib/whop_sdk/models/setup_intent_status.rb +18 -0
  39. data/lib/whop_sdk/models/setup_intent_succeeded_webhook_event.rb +52 -0
  40. data/lib/whop_sdk/models/transfer_list_params.rb +17 -1
  41. data/lib/whop_sdk/models/unwrap_webhook_event.rb +7 -1
  42. data/lib/whop_sdk/models.rb +22 -0
  43. data/lib/whop_sdk/resources/account_links.rb +47 -0
  44. data/lib/whop_sdk/resources/app_builds.rb +8 -2
  45. data/lib/whop_sdk/resources/authorized_users.rb +5 -1
  46. data/lib/whop_sdk/resources/checkout_configurations.rb +5 -1
  47. data/lib/whop_sdk/resources/companies.rb +5 -1
  48. data/lib/whop_sdk/resources/disputes.rb +5 -1
  49. data/lib/whop_sdk/resources/entries.rb +5 -1
  50. data/lib/whop_sdk/resources/experiences.rb +5 -1
  51. data/lib/whop_sdk/resources/invoices.rb +5 -1
  52. data/lib/whop_sdk/resources/payment_tokens.rb +83 -0
  53. data/lib/whop_sdk/resources/payments.rb +48 -0
  54. data/lib/whop_sdk/resources/plans.rb +7 -7
  55. data/lib/whop_sdk/resources/products.rb +6 -4
  56. data/lib/whop_sdk/resources/promo_codes.rb +5 -1
  57. data/lib/whop_sdk/resources/refunds.rb +5 -1
  58. data/lib/whop_sdk/resources/reviews.rb +5 -1
  59. data/lib/whop_sdk/resources/setup_intents.rb +83 -0
  60. data/lib/whop_sdk/resources/transfers.rb +5 -1
  61. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  62. data/lib/whop_sdk/version.rb +1 -1
  63. data/lib/whop_sdk.rb +19 -0
  64. data/manifest.yaml +1 -0
  65. data/rbi/whop_sdk/client.rbi +9 -0
  66. data/rbi/whop_sdk/models/account_link_create_params.rbi +101 -0
  67. data/rbi/whop_sdk/models/account_link_create_response.rbi +38 -0
  68. data/rbi/whop_sdk/models/app_build_create_params.rbi +8 -0
  69. data/rbi/whop_sdk/models/app_build_list_params.rbi +16 -0
  70. data/rbi/whop_sdk/models/app_list_params.rbi +5 -0
  71. data/rbi/whop_sdk/models/authorized_user_list_params.rbi +16 -0
  72. data/rbi/whop_sdk/models/checkout_configuration_list_params.rbi +16 -0
  73. data/rbi/whop_sdk/models/company_list_params.rbi +16 -0
  74. data/rbi/whop_sdk/models/dispute_list_params.rbi +16 -0
  75. data/rbi/whop_sdk/models/entry_list_params.rbi +16 -0
  76. data/rbi/whop_sdk/models/experience_list_params.rbi +16 -0
  77. data/rbi/whop_sdk/models/invoice_list_params.rbi +16 -0
  78. data/rbi/whop_sdk/models/payment.rbi +142 -0
  79. data/rbi/whop_sdk/models/payment_create_params.rbi +384 -0
  80. data/rbi/whop_sdk/models/payment_list_response.rbi +167 -0
  81. data/rbi/whop_sdk/models/payment_method_types.rbi +1 -0
  82. data/rbi/whop_sdk/models/payment_token_list_params.rbi +99 -0
  83. data/rbi/whop_sdk/models/payment_token_list_response.rbi +139 -0
  84. data/rbi/whop_sdk/models/payment_token_retrieve_params.rbi +40 -0
  85. data/rbi/whop_sdk/models/payment_token_retrieve_response.rbi +144 -0
  86. data/rbi/whop_sdk/models/plan_create_params.rbi +2 -22
  87. data/rbi/whop_sdk/models/plan_list_params.rbi +16 -0
  88. data/rbi/whop_sdk/models/product_list_params.rbi +16 -0
  89. data/rbi/whop_sdk/models/product_update_params.rbi +0 -110
  90. data/rbi/whop_sdk/models/promo_code_list_params.rbi +16 -0
  91. data/rbi/whop_sdk/models/refund_list_params.rbi +16 -0
  92. data/rbi/whop_sdk/models/review_list_params.rbi +16 -0
  93. data/rbi/whop_sdk/models/setup_intent.rbi +412 -0
  94. data/rbi/whop_sdk/models/setup_intent_canceled_webhook_event.rbi +77 -0
  95. data/rbi/whop_sdk/models/setup_intent_list_params.rbi +99 -0
  96. data/rbi/whop_sdk/models/setup_intent_list_response.rbi +492 -0
  97. data/rbi/whop_sdk/models/setup_intent_requires_action_webhook_event.rbi +77 -0
  98. data/rbi/whop_sdk/models/setup_intent_retrieve_params.rbi +27 -0
  99. data/rbi/whop_sdk/models/setup_intent_status.rbi +25 -0
  100. data/rbi/whop_sdk/models/setup_intent_succeeded_webhook_event.rbi +77 -0
  101. data/rbi/whop_sdk/models/transfer_list_params.rbi +16 -0
  102. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -0
  103. data/rbi/whop_sdk/models.rbi +25 -0
  104. data/rbi/whop_sdk/resources/account_links.rbi +39 -0
  105. data/rbi/whop_sdk/resources/app_builds.rbi +9 -0
  106. data/rbi/whop_sdk/resources/authorized_users.rbi +6 -0
  107. data/rbi/whop_sdk/resources/checkout_configurations.rbi +6 -0
  108. data/rbi/whop_sdk/resources/companies.rbi +6 -0
  109. data/rbi/whop_sdk/resources/disputes.rbi +6 -0
  110. data/rbi/whop_sdk/resources/entries.rbi +6 -0
  111. data/rbi/whop_sdk/resources/experiences.rbi +6 -0
  112. data/rbi/whop_sdk/resources/invoices.rbi +6 -0
  113. data/rbi/whop_sdk/resources/payment_tokens.rbi +76 -0
  114. data/rbi/whop_sdk/resources/payments.rbi +42 -0
  115. data/rbi/whop_sdk/resources/plans.rbi +7 -9
  116. data/rbi/whop_sdk/resources/products.rbi +6 -9
  117. data/rbi/whop_sdk/resources/promo_codes.rbi +6 -0
  118. data/rbi/whop_sdk/resources/refunds.rbi +6 -0
  119. data/rbi/whop_sdk/resources/reviews.rbi +6 -0
  120. data/rbi/whop_sdk/resources/setup_intents.rbi +77 -0
  121. data/rbi/whop_sdk/resources/transfers.rbi +6 -0
  122. data/rbi/whop_sdk/resources/webhooks.rbi +3 -0
  123. data/sig/whop_sdk/client.rbs +6 -0
  124. data/sig/whop_sdk/models/account_link_create_params.rbs +52 -0
  125. data/sig/whop_sdk/models/account_link_create_response.rbs +15 -0
  126. data/sig/whop_sdk/models/app_build_create_params.rbs +5 -0
  127. data/sig/whop_sdk/models/app_build_list_params.rbs +10 -0
  128. data/sig/whop_sdk/models/app_list_params.rbs +2 -0
  129. data/sig/whop_sdk/models/authorized_user_list_params.rbs +10 -0
  130. data/sig/whop_sdk/models/checkout_configuration_list_params.rbs +10 -0
  131. data/sig/whop_sdk/models/company_list_params.rbs +10 -0
  132. data/sig/whop_sdk/models/dispute_list_params.rbs +10 -0
  133. data/sig/whop_sdk/models/entry_list_params.rbs +10 -0
  134. data/sig/whop_sdk/models/experience_list_params.rbs +10 -0
  135. data/sig/whop_sdk/models/invoice_list_params.rbs +10 -0
  136. data/sig/whop_sdk/models/payment.rbs +69 -0
  137. data/sig/whop_sdk/models/payment_create_params.rbs +210 -0
  138. data/sig/whop_sdk/models/payment_list_response.rbs +69 -0
  139. data/sig/whop_sdk/models/payment_method_types.rbs +2 -0
  140. data/sig/whop_sdk/models/payment_token_list_params.rbs +61 -0
  141. data/sig/whop_sdk/models/payment_token_list_response.rbs +67 -0
  142. data/sig/whop_sdk/models/payment_token_retrieve_params.rbs +23 -0
  143. data/sig/whop_sdk/models/payment_token_retrieve_response.rbs +67 -0
  144. data/sig/whop_sdk/models/plan_create_params.rbs +0 -10
  145. data/sig/whop_sdk/models/plan_list_params.rbs +10 -0
  146. data/sig/whop_sdk/models/product_list_params.rbs +10 -0
  147. data/sig/whop_sdk/models/product_update_params.rbs +0 -36
  148. data/sig/whop_sdk/models/promo_code_list_params.rbs +10 -0
  149. data/sig/whop_sdk/models/refund_list_params.rbs +10 -0
  150. data/sig/whop_sdk/models/review_list_params.rbs +10 -0
  151. data/sig/whop_sdk/models/setup_intent.rbs +189 -0
  152. data/sig/whop_sdk/models/setup_intent_canceled_webhook_event.rbs +40 -0
  153. data/sig/whop_sdk/models/setup_intent_list_params.rbs +61 -0
  154. data/sig/whop_sdk/models/setup_intent_list_response.rbs +193 -0
  155. data/sig/whop_sdk/models/setup_intent_requires_action_webhook_event.rbs +40 -0
  156. data/sig/whop_sdk/models/setup_intent_retrieve_params.rbs +15 -0
  157. data/sig/whop_sdk/models/setup_intent_status.rbs +17 -0
  158. data/sig/whop_sdk/models/setup_intent_succeeded_webhook_event.rbs +40 -0
  159. data/sig/whop_sdk/models/transfer_list_params.rbs +10 -0
  160. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
  161. data/sig/whop_sdk/models.rbs +22 -0
  162. data/sig/whop_sdk/resources/account_links.rbs +15 -0
  163. data/sig/whop_sdk/resources/app_builds.rbs +3 -0
  164. data/sig/whop_sdk/resources/authorized_users.rbs +2 -0
  165. data/sig/whop_sdk/resources/checkout_configurations.rbs +2 -0
  166. data/sig/whop_sdk/resources/companies.rbs +2 -0
  167. data/sig/whop_sdk/resources/disputes.rbs +2 -0
  168. data/sig/whop_sdk/resources/entries.rbs +2 -0
  169. data/sig/whop_sdk/resources/experiences.rbs +2 -0
  170. data/sig/whop_sdk/resources/invoices.rbs +2 -0
  171. data/sig/whop_sdk/resources/payment_tokens.rbs +25 -0
  172. data/sig/whop_sdk/resources/payments.rbs +9 -0
  173. data/sig/whop_sdk/resources/plans.rbs +2 -2
  174. data/sig/whop_sdk/resources/products.rbs +2 -1
  175. data/sig/whop_sdk/resources/promo_codes.rbs +2 -0
  176. data/sig/whop_sdk/resources/refunds.rbs +2 -0
  177. data/sig/whop_sdk/resources/reviews.rbs +2 -0
  178. data/sig/whop_sdk/resources/setup_intents.rbs +24 -0
  179. data/sig/whop_sdk/resources/transfers.rbs +2 -0
  180. data/sig/whop_sdk/resources/webhooks.rbs +3 -0
  181. metadata +56 -2
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntentCanceledWebhookEvent < WhopSDK::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # A unique ID for every single webhook request
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute api_version
13
+ # The API version for this webhook
14
+ #
15
+ # @return [Symbol, :v1]
16
+ required :api_version, const: :v1
17
+
18
+ # @!attribute data
19
+ # An object representing a setup intent, which is a flow for allowing a customer
20
+ # to add a payment method to their account without making a purchase.
21
+ #
22
+ # @return [WhopSDK::Models::SetupIntent]
23
+ required :data, -> { WhopSDK::SetupIntent }
24
+
25
+ # @!attribute timestamp
26
+ # The timestamp in ISO 8601 format that the webhook was sent at on the server
27
+ #
28
+ # @return [Time]
29
+ required :timestamp, Time
30
+
31
+ # @!attribute type
32
+ # The webhook event type
33
+ #
34
+ # @return [Symbol, :"setup_intent.canceled"]
35
+ required :type, const: :"setup_intent.canceled"
36
+
37
+ # @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"setup_intent.canceled")
38
+ # Some parameter documentations has been truncated, see
39
+ # {WhopSDK::Models::SetupIntentCanceledWebhookEvent} for more details.
40
+ #
41
+ # @param id [String] A unique ID for every single webhook request
42
+ #
43
+ # @param data [WhopSDK::Models::SetupIntent] An object representing a setup intent, which is a flow for allowing a customer t
44
+ #
45
+ # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server
46
+ #
47
+ # @param api_version [Symbol, :v1] The API version for this webhook
48
+ #
49
+ # @param type [Symbol, :"setup_intent.canceled"] The webhook event type
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::SetupIntents#list
6
+ class SetupIntentListParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute company_id
11
+ # The ID of the company to list setup intents for
12
+ #
13
+ # @return [String]
14
+ required :company_id, String
15
+
16
+ # @!attribute after
17
+ # Returns the elements in the list that come after the specified cursor.
18
+ #
19
+ # @return [String, nil]
20
+ optional :after, String, nil?: true
21
+
22
+ # @!attribute before
23
+ # Returns the elements in the list that come before the specified cursor.
24
+ #
25
+ # @return [String, nil]
26
+ optional :before, String, nil?: true
27
+
28
+ # @!attribute created_after
29
+ # The minimum creation date to filter by
30
+ #
31
+ # @return [Time, nil]
32
+ optional :created_after, Time, nil?: true
33
+
34
+ # @!attribute created_before
35
+ # The maximum creation date to filter by
36
+ #
37
+ # @return [Time, nil]
38
+ optional :created_before, Time, nil?: true
39
+
40
+ # @!attribute direction
41
+ # The direction of the sort.
42
+ #
43
+ # @return [Symbol, WhopSDK::Models::Direction, nil]
44
+ optional :direction, enum: -> { WhopSDK::Direction }, nil?: true
45
+
46
+ # @!attribute first
47
+ # Returns the first _n_ elements from the list.
48
+ #
49
+ # @return [Integer, nil]
50
+ optional :first, Integer, nil?: true
51
+
52
+ # @!attribute last
53
+ # Returns the last _n_ elements from the list.
54
+ #
55
+ # @return [Integer, nil]
56
+ optional :last, Integer, nil?: true
57
+
58
+ # @!method initialize(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {})
59
+ # @param company_id [String] The ID of the company to list setup intents for
60
+ #
61
+ # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
62
+ #
63
+ # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
64
+ #
65
+ # @param created_after [Time, nil] The minimum creation date to filter by
66
+ #
67
+ # @param created_before [Time, nil] The maximum creation date to filter by
68
+ #
69
+ # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort.
70
+ #
71
+ # @param first [Integer, nil] Returns the first _n_ elements from the list.
72
+ #
73
+ # @param last [Integer, nil] Returns the last _n_ elements from the list.
74
+ #
75
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,255 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::SetupIntents#list
6
+ class SetupIntentListResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The setup intent ID
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute checkout_configuration
14
+ # The checkout configuration associated with the setup intent
15
+ #
16
+ # @return [WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration, nil]
17
+ required :checkout_configuration,
18
+ -> { WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration },
19
+ nil?: true
20
+
21
+ # @!attribute company
22
+ # The company of the setup intent
23
+ #
24
+ # @return [WhopSDK::Models::SetupIntentListResponse::Company, nil]
25
+ required :company, -> { WhopSDK::Models::SetupIntentListResponse::Company }, nil?: true
26
+
27
+ # @!attribute created_at
28
+ # The datetime the payment was created
29
+ #
30
+ # @return [Time]
31
+ required :created_at, Time
32
+
33
+ # @!attribute error_message
34
+ # The error message, if any.
35
+ #
36
+ # @return [String, nil]
37
+ required :error_message, String, nil?: true
38
+
39
+ # @!attribute member
40
+ # The member connected to the setup intent
41
+ #
42
+ # @return [WhopSDK::Models::SetupIntentListResponse::Member, nil]
43
+ required :member, -> { WhopSDK::Models::SetupIntentListResponse::Member }, nil?: true
44
+
45
+ # @!attribute metadata
46
+ # The metadata associated with the setup intent
47
+ #
48
+ # @return [Hash{Symbol=>Object}, nil]
49
+ required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true
50
+
51
+ # @!attribute payment_token
52
+ # The payment token created during the setup, if available.
53
+ #
54
+ # @return [WhopSDK::Models::SetupIntentListResponse::PaymentToken, nil]
55
+ required :payment_token, -> { WhopSDK::Models::SetupIntentListResponse::PaymentToken }, nil?: true
56
+
57
+ # @!attribute status
58
+ # The status of the setup intent
59
+ #
60
+ # @return [Symbol, WhopSDK::Models::SetupIntentStatus]
61
+ required :status, enum: -> { WhopSDK::SetupIntentStatus }
62
+
63
+ # @!method initialize(id:, checkout_configuration:, company:, created_at:, error_message:, member:, metadata:, payment_token:, status:)
64
+ # An object representing a setup intent, which is a flow for allowing a customer
65
+ # to add a payment method to their account without making a purchase.
66
+ #
67
+ # @param id [String] The setup intent ID
68
+ #
69
+ # @param checkout_configuration [WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration, nil] The checkout configuration associated with the setup intent
70
+ #
71
+ # @param company [WhopSDK::Models::SetupIntentListResponse::Company, nil] The company of the setup intent
72
+ #
73
+ # @param created_at [Time] The datetime the payment was created
74
+ #
75
+ # @param error_message [String, nil] The error message, if any.
76
+ #
77
+ # @param member [WhopSDK::Models::SetupIntentListResponse::Member, nil] The member connected to the setup intent
78
+ #
79
+ # @param metadata [Hash{Symbol=>Object}, nil] The metadata associated with the setup intent
80
+ #
81
+ # @param payment_token [WhopSDK::Models::SetupIntentListResponse::PaymentToken, nil] The payment token created during the setup, if available.
82
+ #
83
+ # @param status [Symbol, WhopSDK::Models::SetupIntentStatus] The status of the setup intent
84
+
85
+ # @see WhopSDK::Models::SetupIntentListResponse#checkout_configuration
86
+ class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel
87
+ # @!attribute id
88
+ # The ID of the checkout configuration
89
+ #
90
+ # @return [String]
91
+ required :id, String
92
+
93
+ # @!method initialize(id:)
94
+ # The checkout configuration associated with the setup intent
95
+ #
96
+ # @param id [String] The ID of the checkout configuration
97
+ end
98
+
99
+ # @see WhopSDK::Models::SetupIntentListResponse#company
100
+ class Company < WhopSDK::Internal::Type::BaseModel
101
+ # @!attribute id
102
+ # The ID (tag) of the company.
103
+ #
104
+ # @return [String]
105
+ required :id, String
106
+
107
+ # @!method initialize(id:)
108
+ # The company of the setup intent
109
+ #
110
+ # @param id [String] The ID (tag) of the company.
111
+ end
112
+
113
+ # @see WhopSDK::Models::SetupIntentListResponse#member
114
+ class Member < WhopSDK::Internal::Type::BaseModel
115
+ # @!attribute id
116
+ # The ID of the member
117
+ #
118
+ # @return [String]
119
+ required :id, String
120
+
121
+ # @!attribute user
122
+ # The user for this member, if any.
123
+ #
124
+ # @return [WhopSDK::Models::SetupIntentListResponse::Member::User, nil]
125
+ required :user, -> { WhopSDK::Models::SetupIntentListResponse::Member::User }, nil?: true
126
+
127
+ # @!method initialize(id:, user:)
128
+ # The member connected to the setup intent
129
+ #
130
+ # @param id [String] The ID of the member
131
+ #
132
+ # @param user [WhopSDK::Models::SetupIntentListResponse::Member::User, nil] The user for this member, if any.
133
+
134
+ # @see WhopSDK::Models::SetupIntentListResponse::Member#user
135
+ class User < WhopSDK::Internal::Type::BaseModel
136
+ # @!attribute id
137
+ # The internal ID of the user account.
138
+ #
139
+ # @return [String]
140
+ required :id, String
141
+
142
+ # @!attribute email
143
+ # The digital mailing address of the user.
144
+ #
145
+ # @return [String, nil]
146
+ required :email, String, nil?: true
147
+
148
+ # @!attribute name
149
+ # The user's full name.
150
+ #
151
+ # @return [String, nil]
152
+ required :name, String, nil?: true
153
+
154
+ # @!attribute username
155
+ # The whop username.
156
+ #
157
+ # @return [String]
158
+ required :username, String
159
+
160
+ # @!method initialize(id:, email:, name:, username:)
161
+ # The user for this member, if any.
162
+ #
163
+ # @param id [String] The internal ID of the user account.
164
+ #
165
+ # @param email [String, nil] The digital mailing address of the user.
166
+ #
167
+ # @param name [String, nil] The user's full name.
168
+ #
169
+ # @param username [String] The whop username.
170
+ end
171
+ end
172
+
173
+ # @see WhopSDK::Models::SetupIntentListResponse#payment_token
174
+ class PaymentToken < WhopSDK::Internal::Type::BaseModel
175
+ # @!attribute id
176
+ # The ID of the payment token
177
+ #
178
+ # @return [String]
179
+ required :id, String
180
+
181
+ # @!attribute card
182
+ # The card data associated with the payment token, if its a debit or credit card
183
+ # token.
184
+ #
185
+ # @return [WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card, nil]
186
+ required :card, -> { WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card }, nil?: true
187
+
188
+ # @!attribute created_at
189
+ # The date and time the payment token was created
190
+ #
191
+ # @return [Time]
192
+ required :created_at, Time
193
+
194
+ # @!attribute payment_method_type
195
+ # The payment method type of the payment token
196
+ #
197
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
198
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
199
+
200
+ # @!method initialize(id:, card:, created_at:, payment_method_type:)
201
+ # Some parameter documentations has been truncated, see
202
+ # {WhopSDK::Models::SetupIntentListResponse::PaymentToken} for more details.
203
+ #
204
+ # The payment token created during the setup, if available.
205
+ #
206
+ # @param id [String] The ID of the payment token
207
+ #
208
+ # @param card [WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card, nil] The card data associated with the payment token, if its a debit or credit card t
209
+ #
210
+ # @param created_at [Time] The date and time the payment token was created
211
+ #
212
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment token
213
+
214
+ # @see WhopSDK::Models::SetupIntentListResponse::PaymentToken#card
215
+ class Card < WhopSDK::Internal::Type::BaseModel
216
+ # @!attribute brand
217
+ # Possible card brands that a payment token can have
218
+ #
219
+ # @return [Symbol, WhopSDK::Models::CardBrands, nil]
220
+ required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
221
+
222
+ # @!attribute exp_month
223
+ # Card expiration month, like 03 for March.
224
+ #
225
+ # @return [Integer, nil]
226
+ required :exp_month, Integer, nil?: true
227
+
228
+ # @!attribute exp_year
229
+ # Card expiration year, like 27 for 2027.
230
+ #
231
+ # @return [Integer, nil]
232
+ required :exp_year, Integer, nil?: true
233
+
234
+ # @!attribute last4
235
+ # Last four digits of the card.
236
+ #
237
+ # @return [String, nil]
238
+ required :last4, String, nil?: true
239
+
240
+ # @!method initialize(brand:, exp_month:, exp_year:, last4:)
241
+ # The card data associated with the payment token, if its a debit or credit card
242
+ # token.
243
+ #
244
+ # @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
245
+ #
246
+ # @param exp_month [Integer, nil] Card expiration month, like 03 for March.
247
+ #
248
+ # @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
249
+ #
250
+ # @param last4 [String, nil] Last four digits of the card.
251
+ end
252
+ end
253
+ end
254
+ end
255
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntentRequiresActionWebhookEvent < WhopSDK::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # A unique ID for every single webhook request
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute api_version
13
+ # The API version for this webhook
14
+ #
15
+ # @return [Symbol, :v1]
16
+ required :api_version, const: :v1
17
+
18
+ # @!attribute data
19
+ # An object representing a setup intent, which is a flow for allowing a customer
20
+ # to add a payment method to their account without making a purchase.
21
+ #
22
+ # @return [WhopSDK::Models::SetupIntent]
23
+ required :data, -> { WhopSDK::SetupIntent }
24
+
25
+ # @!attribute timestamp
26
+ # The timestamp in ISO 8601 format that the webhook was sent at on the server
27
+ #
28
+ # @return [Time]
29
+ required :timestamp, Time
30
+
31
+ # @!attribute type
32
+ # The webhook event type
33
+ #
34
+ # @return [Symbol, :"setup_intent.requires_action"]
35
+ required :type, const: :"setup_intent.requires_action"
36
+
37
+ # @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"setup_intent.requires_action")
38
+ # Some parameter documentations has been truncated, see
39
+ # {WhopSDK::Models::SetupIntentRequiresActionWebhookEvent} for more details.
40
+ #
41
+ # @param id [String] A unique ID for every single webhook request
42
+ #
43
+ # @param data [WhopSDK::Models::SetupIntent] An object representing a setup intent, which is a flow for allowing a customer t
44
+ #
45
+ # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server
46
+ #
47
+ # @param api_version [Symbol, :v1] The API version for this webhook
48
+ #
49
+ # @param type [Symbol, :"setup_intent.requires_action"] The webhook event type
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::SetupIntents#retrieve
6
+ class SetupIntentRetrieveParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # The status of the setup intent.
6
+ module SetupIntentStatus
7
+ extend WhopSDK::Internal::Type::Enum
8
+
9
+ PROCESSING = :processing
10
+ SUCCEEDED = :succeeded
11
+ CANCELED = :canceled
12
+ REQUIRES_ACTION = :requires_action
13
+
14
+ # @!method self.values
15
+ # @return [Array<Symbol>]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntentSucceededWebhookEvent < WhopSDK::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # A unique ID for every single webhook request
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute api_version
13
+ # The API version for this webhook
14
+ #
15
+ # @return [Symbol, :v1]
16
+ required :api_version, const: :v1
17
+
18
+ # @!attribute data
19
+ # An object representing a setup intent, which is a flow for allowing a customer
20
+ # to add a payment method to their account without making a purchase.
21
+ #
22
+ # @return [WhopSDK::Models::SetupIntent]
23
+ required :data, -> { WhopSDK::SetupIntent }
24
+
25
+ # @!attribute timestamp
26
+ # The timestamp in ISO 8601 format that the webhook was sent at on the server
27
+ #
28
+ # @return [Time]
29
+ required :timestamp, Time
30
+
31
+ # @!attribute type
32
+ # The webhook event type
33
+ #
34
+ # @return [Symbol, :"setup_intent.succeeded"]
35
+ required :type, const: :"setup_intent.succeeded"
36
+
37
+ # @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"setup_intent.succeeded")
38
+ # Some parameter documentations has been truncated, see
39
+ # {WhopSDK::Models::SetupIntentSucceededWebhookEvent} for more details.
40
+ #
41
+ # @param id [String] A unique ID for every single webhook request
42
+ #
43
+ # @param data [WhopSDK::Models::SetupIntent] An object representing a setup intent, which is a flow for allowing a customer t
44
+ #
45
+ # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server
46
+ #
47
+ # @param api_version [Symbol, :v1] The API version for this webhook
48
+ #
49
+ # @param type [Symbol, :"setup_intent.succeeded"] The webhook event type
50
+ end
51
+ end
52
+ end
@@ -19,6 +19,18 @@ module WhopSDK
19
19
  # @return [String, nil]
20
20
  optional :before, String, nil?: true
21
21
 
22
+ # @!attribute created_after
23
+ # The minimum creation date to filter by
24
+ #
25
+ # @return [Time, nil]
26
+ optional :created_after, Time, nil?: true
27
+
28
+ # @!attribute created_before
29
+ # The maximum creation date to filter by
30
+ #
31
+ # @return [Time, nil]
32
+ optional :created_before, Time, nil?: true
33
+
22
34
  # @!attribute destination_id
23
35
  # Filter transfers to only those that were sent to this destination account.
24
36
  # (user_xxx, biz_xxx, ldgr_xxx)
@@ -57,7 +69,7 @@ module WhopSDK
57
69
  # @return [String, nil]
58
70
  optional :origin_id, String, nil?: true
59
71
 
60
- # @!method initialize(after: nil, before: nil, destination_id: nil, direction: nil, first: nil, last: nil, order: nil, origin_id: nil, request_options: {})
72
+ # @!method initialize(after: nil, before: nil, created_after: nil, created_before: nil, destination_id: nil, direction: nil, first: nil, last: nil, order: nil, origin_id: nil, request_options: {})
61
73
  # Some parameter documentations has been truncated, see
62
74
  # {WhopSDK::Models::TransferListParams} for more details.
63
75
  #
@@ -65,6 +77,10 @@ module WhopSDK
65
77
  #
66
78
  # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
67
79
  #
80
+ # @param created_after [Time, nil] The minimum creation date to filter by
81
+ #
82
+ # @param created_before [Time, nil] The maximum creation date to filter by
83
+ #
68
84
  # @param destination_id [String, nil] Filter transfers to only those that were sent to this destination account. (user
69
85
  #
70
86
  # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort.
@@ -25,6 +25,12 @@ module WhopSDK
25
25
 
26
26
  variant -> { WhopSDK::EntryDeletedWebhookEvent }
27
27
 
28
+ variant -> { WhopSDK::SetupIntentRequiresActionWebhookEvent }
29
+
30
+ variant -> { WhopSDK::SetupIntentSucceededWebhookEvent }
31
+
32
+ variant -> { WhopSDK::SetupIntentCanceledWebhookEvent }
33
+
28
34
  variant -> { WhopSDK::CourseLessonInteractionCompletedWebhookEvent }
29
35
 
30
36
  variant -> { WhopSDK::PaymentSucceededWebhookEvent }
@@ -42,7 +48,7 @@ module WhopSDK
42
48
  variant -> { WhopSDK::RefundUpdatedWebhookEvent }
43
49
 
44
50
  # @!method self.variants
45
- # @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::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent)]
51
+ # @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::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent)]
46
52
  end
47
53
  end
48
54
  end
@@ -45,6 +45,8 @@ module WhopSDK
45
45
 
46
46
  AccessTokenCreateParams = WhopSDK::Models::AccessTokenCreateParams
47
47
 
48
+ AccountLinkCreateParams = WhopSDK::Models::AccountLinkCreateParams
49
+
48
50
  App = WhopSDK::Models::App
49
51
 
50
52
  AppBuild = WhopSDK::Models::AppBuild
@@ -342,6 +344,8 @@ module WhopSDK
342
344
 
343
345
  Payment = WhopSDK::Models::Payment
344
346
 
347
+ PaymentCreateParams = WhopSDK::Models::PaymentCreateParams
348
+
345
349
  PaymentFailedWebhookEvent = WhopSDK::Models::PaymentFailedWebhookEvent
346
350
 
347
351
  PaymentListParams = WhopSDK::Models::PaymentListParams
@@ -360,6 +364,10 @@ module WhopSDK
360
364
 
361
365
  PaymentSucceededWebhookEvent = WhopSDK::Models::PaymentSucceededWebhookEvent
362
366
 
367
+ PaymentTokenListParams = WhopSDK::Models::PaymentTokenListParams
368
+
369
+ PaymentTokenRetrieveParams = WhopSDK::Models::PaymentTokenRetrieveParams
370
+
363
371
  PaymentVoidParams = WhopSDK::Models::PaymentVoidParams
364
372
 
365
373
  Plan = WhopSDK::Models::Plan
@@ -438,6 +446,20 @@ module WhopSDK
438
446
 
439
447
  ReviewStatus = WhopSDK::Models::ReviewStatus
440
448
 
449
+ SetupIntent = WhopSDK::Models::SetupIntent
450
+
451
+ SetupIntentCanceledWebhookEvent = WhopSDK::Models::SetupIntentCanceledWebhookEvent
452
+
453
+ SetupIntentListParams = WhopSDK::Models::SetupIntentListParams
454
+
455
+ SetupIntentRequiresActionWebhookEvent = WhopSDK::Models::SetupIntentRequiresActionWebhookEvent
456
+
457
+ SetupIntentRetrieveParams = WhopSDK::Models::SetupIntentRetrieveParams
458
+
459
+ SetupIntentStatus = WhopSDK::Models::SetupIntentStatus
460
+
461
+ SetupIntentSucceededWebhookEvent = WhopSDK::Models::SetupIntentSucceededWebhookEvent
462
+
441
463
  Shipment = WhopSDK::Models::Shipment
442
464
 
443
465
  ShipmentCarrier = WhopSDK::Models::ShipmentCarrier
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Resources
5
+ class AccountLinks
6
+ # Some parameter documentations has been truncated, see
7
+ # {WhopSDK::Models::AccountLinkCreateParams} for more details.
8
+ #
9
+ # Generates a url that a user can be directed to in order to access their
10
+ # sub-merchant account. For example, they can visit the hosted payouts portal or
11
+ # the hosted KYC onboarding flow.
12
+ #
13
+ # @overload create(company_id:, refresh_url:, return_url:, use_case:, request_options: {})
14
+ #
15
+ # @param company_id [String] The ID of the Company to generate the url for. The company must be a sub-merchan
16
+ #
17
+ # @param refresh_url [String] The URL to redirect to if the session expires and needs to be re-authenticated d
18
+ #
19
+ # @param return_url [String] The URL to redirect to when the customer wants to return to your site.
20
+ #
21
+ # @param use_case [Symbol, WhopSDK::Models::AccountLinkCreateParams::UseCase] The use case for which the link will be used.
22
+ #
23
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
24
+ #
25
+ # @return [WhopSDK::Models::AccountLinkCreateResponse]
26
+ #
27
+ # @see WhopSDK::Models::AccountLinkCreateParams
28
+ def create(params)
29
+ parsed, options = WhopSDK::AccountLinkCreateParams.dump_request(params)
30
+ @client.request(
31
+ method: :post,
32
+ path: "account_links",
33
+ body: parsed,
34
+ model: WhopSDK::Models::AccountLinkCreateResponse,
35
+ options: options
36
+ )
37
+ end
38
+
39
+ # @api private
40
+ #
41
+ # @param client [WhopSDK::Client]
42
+ def initialize(client:)
43
+ @client = client
44
+ end
45
+ end
46
+ end
47
+ end