straddle 0.3.0 → 0.5.0

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 (265) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +127 -0
  3. data/README.md +32 -1
  4. data/lib/straddle/client.rb +49 -1
  5. data/lib/straddle/internal/transport/base_client.rb +5 -0
  6. data/lib/straddle/internal/transport/pooled_net_requester.rb +13 -11
  7. data/lib/straddle/internal/util.rb +61 -10
  8. data/lib/straddle/models/bridge/link_create_paykey_response.rb +8 -0
  9. data/lib/straddle/models/bridge/link_create_tan_response.rb +8 -0
  10. data/lib/straddle/models/charge_cancel_params.rb +8 -1
  11. data/lib/straddle/models/charge_create_params.rb +22 -4
  12. data/lib/straddle/models/charge_get_params.rb +7 -1
  13. data/lib/straddle/models/charge_hold_params.rb +8 -1
  14. data/lib/straddle/models/charge_release_params.rb +8 -1
  15. data/lib/straddle/models/charge_unmask_params.rb +7 -1
  16. data/lib/straddle/models/charge_unmask_response.rb +190 -5
  17. data/lib/straddle/models/charge_update_params.rb +11 -4
  18. data/lib/straddle/models/charge_v1.rb +188 -5
  19. data/lib/straddle/models/customer_delete_params.rb +7 -1
  20. data/lib/straddle/models/customer_get_params.rb +7 -1
  21. data/lib/straddle/models/customer_unmasked_params.rb +7 -1
  22. data/lib/straddle/models/customer_update_params.rb +8 -1
  23. data/lib/straddle/models/customers/review_decision_params.rb +8 -1
  24. data/lib/straddle/models/customers/review_get_params.rb +7 -1
  25. data/lib/straddle/models/customers/review_refresh_review_params.rb +7 -1
  26. data/lib/straddle/models/embed/account_get_params.rb +11 -1
  27. data/lib/straddle/models/embed/account_list_params.rb +8 -1
  28. data/lib/straddle/models/embed/account_onboard_params.rb +7 -1
  29. data/lib/straddle/models/embed/account_paged_v1.rb +4 -0
  30. data/lib/straddle/models/embed/account_simulate_params.rb +7 -1
  31. data/lib/straddle/models/embed/account_update_params.rb +8 -1
  32. data/lib/straddle/models/embed/account_v1.rb +4 -0
  33. data/lib/straddle/models/embed/accounts/capability_request_create_params.rb +8 -1
  34. data/lib/straddle/models/embed/accounts/capability_request_list_params.rb +8 -1
  35. data/lib/straddle/models/embed/accounts/capability_request_paged_v1.rb +9 -1
  36. data/lib/straddle/models/embed/address_v1.rb +14 -38
  37. data/lib/straddle/models/embed/linked_bank_account_cancel_params.rb +7 -1
  38. data/lib/straddle/models/embed/linked_bank_account_get_params.rb +7 -1
  39. data/lib/straddle/models/embed/linked_bank_account_unmask_params.rb +7 -1
  40. data/lib/straddle/models/embed/linked_bank_account_update_params.rb +8 -1
  41. data/lib/straddle/models/embed/organization_get_params.rb +7 -1
  42. data/lib/straddle/models/embed/representative.rb +2 -2
  43. data/lib/straddle/models/embed/representative_create_params.rb +2 -2
  44. data/lib/straddle/models/embed/representative_get_params.rb +7 -1
  45. data/lib/straddle/models/embed/representative_paged.rb +2 -2
  46. data/lib/straddle/models/embed/representative_unmask_params.rb +7 -1
  47. data/lib/straddle/models/embed/representative_update_params.rb +10 -3
  48. data/lib/straddle/models/funding_event_get_params.rb +7 -1
  49. data/lib/straddle/models/funding_event_list_params.rb +105 -1
  50. data/lib/straddle/models/funding_event_summary_item_v1.rb +128 -1
  51. data/lib/straddle/models/funding_event_summary_paged_v1.rb +128 -1
  52. data/lib/straddle/models/paykey_cancel_params.rb +7 -1
  53. data/lib/straddle/models/paykey_get_params.rb +7 -1
  54. data/lib/straddle/models/paykey_list_params.rb +40 -1
  55. data/lib/straddle/models/paykey_reveal_params.rb +7 -1
  56. data/lib/straddle/models/paykey_reveal_response.rb +8 -0
  57. data/lib/straddle/models/paykey_summary_paged_v1.rb +19 -1
  58. data/lib/straddle/models/paykey_unmasked_params.rb +7 -1
  59. data/lib/straddle/models/paykey_unmasked_v1.rb +8 -0
  60. data/lib/straddle/models/paykey_update_balance_params.rb +7 -1
  61. data/lib/straddle/models/paykey_v1.rb +19 -1
  62. data/lib/straddle/models/paykeys/review_decision_params.rb +7 -1
  63. data/lib/straddle/models/paykeys/review_get_params.rb +7 -1
  64. data/lib/straddle/models/paykeys/review_get_response.rb +19 -4
  65. data/lib/straddle/models/paykeys/review_refresh_review_params.rb +7 -1
  66. data/lib/straddle/models/payment_list_params.rb +71 -1
  67. data/lib/straddle/models/payment_summary_paged_v1.rb +110 -4
  68. data/lib/straddle/models/payout_cancel_params.rb +8 -1
  69. data/lib/straddle/models/payout_create_params.rb +22 -4
  70. data/lib/straddle/models/payout_get_params.rb +7 -1
  71. data/lib/straddle/models/payout_hold_params.rb +8 -1
  72. data/lib/straddle/models/payout_release_params.rb +8 -1
  73. data/lib/straddle/models/payout_unmask_params.rb +7 -1
  74. data/lib/straddle/models/payout_unmask_response.rb +193 -5
  75. data/lib/straddle/models/payout_update_params.rb +11 -4
  76. data/lib/straddle/models/payout_upload_authorization_document_params.rb +57 -0
  77. data/lib/straddle/models/payout_v1.rb +188 -5
  78. data/lib/straddle/models/status_details_v1.rb +7 -0
  79. data/lib/straddle/models.rb +2 -0
  80. data/lib/straddle/resources/bridge/link.rb +12 -6
  81. data/lib/straddle/resources/bridge.rb +13 -1
  82. data/lib/straddle/resources/charges.rb +13 -8
  83. data/lib/straddle/resources/customers/review.rb +7 -1
  84. data/lib/straddle/resources/customers.rb +23 -10
  85. data/lib/straddle/resources/embed/accounts/capability_requests.rb +9 -4
  86. data/lib/straddle/resources/embed/accounts.rb +29 -15
  87. data/lib/straddle/resources/embed/linked_bank_accounts.rb +11 -6
  88. data/lib/straddle/resources/embed/organizations.rb +7 -2
  89. data/lib/straddle/resources/embed/representatives.rb +15 -8
  90. data/lib/straddle/resources/embed.rb +19 -0
  91. data/lib/straddle/resources/funding_events.rb +22 -3
  92. data/lib/straddle/resources/paykeys/review.rb +7 -2
  93. data/lib/straddle/resources/paykeys.rb +42 -11
  94. data/lib/straddle/resources/payments.rb +30 -6
  95. data/lib/straddle/resources/payouts.rb +60 -7
  96. data/lib/straddle/version.rb +1 -1
  97. data/lib/straddle.rb +2 -0
  98. data/manifest.yaml +1 -0
  99. data/rbi/straddle/client.rbi +34 -0
  100. data/rbi/straddle/internal/util.rbi +29 -1
  101. data/rbi/straddle/models/bridge/link_create_paykey_response.rbi +40 -0
  102. data/rbi/straddle/models/bridge/link_create_tan_response.rbi +40 -0
  103. data/rbi/straddle/models/charge_cancel_params.rbi +6 -0
  104. data/rbi/straddle/models/charge_create_params.rbi +29 -3
  105. data/rbi/straddle/models/charge_get_params.rbi +6 -0
  106. data/rbi/straddle/models/charge_hold_params.rbi +6 -0
  107. data/rbi/straddle/models/charge_release_params.rbi +6 -0
  108. data/rbi/straddle/models/charge_unmask_params.rbi +6 -0
  109. data/rbi/straddle/models/charge_unmask_response.rbi +396 -6
  110. data/rbi/straddle/models/charge_update_params.rbi +9 -3
  111. data/rbi/straddle/models/charge_v1.rbi +364 -6
  112. data/rbi/straddle/models/customer_delete_params.rbi +6 -0
  113. data/rbi/straddle/models/customer_get_params.rbi +6 -0
  114. data/rbi/straddle/models/customer_unmasked_params.rbi +6 -0
  115. data/rbi/straddle/models/customer_update_params.rbi +6 -0
  116. data/rbi/straddle/models/customers/review_decision_params.rbi +6 -0
  117. data/rbi/straddle/models/customers/review_get_params.rbi +6 -0
  118. data/rbi/straddle/models/customers/review_refresh_review_params.rbi +6 -0
  119. data/rbi/straddle/models/embed/account_get_params.rbi +13 -1
  120. data/rbi/straddle/models/embed/account_list_params.rbi +9 -0
  121. data/rbi/straddle/models/embed/account_onboard_params.rbi +6 -0
  122. data/rbi/straddle/models/embed/account_paged_v1.rbi +20 -0
  123. data/rbi/straddle/models/embed/account_simulate_params.rbi +6 -0
  124. data/rbi/straddle/models/embed/account_update_params.rbi +6 -0
  125. data/rbi/straddle/models/embed/account_v1.rbi +20 -0
  126. data/rbi/straddle/models/embed/accounts/capability_request_create_params.rbi +6 -0
  127. data/rbi/straddle/models/embed/accounts/capability_request_list_params.rbi +6 -0
  128. data/rbi/straddle/models/embed/accounts/capability_request_paged_v1.rbi +8 -0
  129. data/rbi/straddle/models/embed/address_v1.rbi +18 -42
  130. data/rbi/straddle/models/embed/linked_bank_account_cancel_params.rbi +6 -0
  131. data/rbi/straddle/models/embed/linked_bank_account_get_params.rbi +11 -1
  132. data/rbi/straddle/models/embed/linked_bank_account_unmask_params.rbi +11 -1
  133. data/rbi/straddle/models/embed/linked_bank_account_update_params.rbi +6 -0
  134. data/rbi/straddle/models/embed/organization_get_params.rbi +11 -1
  135. data/rbi/straddle/models/embed/representative.rbi +2 -2
  136. data/rbi/straddle/models/embed/representative_create_params.rbi +2 -2
  137. data/rbi/straddle/models/embed/representative_get_params.rbi +11 -1
  138. data/rbi/straddle/models/embed/representative_paged.rbi +2 -2
  139. data/rbi/straddle/models/embed/representative_unmask_params.rbi +11 -1
  140. data/rbi/straddle/models/embed/representative_update_params.rbi +8 -2
  141. data/rbi/straddle/models/funding_event_get_params.rbi +6 -0
  142. data/rbi/straddle/models/funding_event_list_params.rbi +333 -0
  143. data/rbi/straddle/models/funding_event_summary_item_v1.rbi +392 -0
  144. data/rbi/straddle/models/funding_event_summary_paged_v1.rbi +393 -0
  145. data/rbi/straddle/models/paykey_cancel_params.rbi +6 -0
  146. data/rbi/straddle/models/paykey_get_params.rbi +6 -0
  147. data/rbi/straddle/models/paykey_list_params.rbi +52 -0
  148. data/rbi/straddle/models/paykey_reveal_params.rbi +6 -0
  149. data/rbi/straddle/models/paykey_reveal_response.rbi +40 -0
  150. data/rbi/straddle/models/paykey_summary_paged_v1.rbi +55 -3
  151. data/rbi/straddle/models/paykey_unmasked_params.rbi +6 -0
  152. data/rbi/straddle/models/paykey_unmasked_v1.rbi +40 -0
  153. data/rbi/straddle/models/paykey_update_balance_params.rbi +6 -0
  154. data/rbi/straddle/models/paykey_v1.rbi +52 -3
  155. data/rbi/straddle/models/paykeys/review_decision_params.rbi +6 -0
  156. data/rbi/straddle/models/paykeys/review_get_params.rbi +6 -0
  157. data/rbi/straddle/models/paykeys/review_get_response.rbi +55 -18
  158. data/rbi/straddle/models/paykeys/review_refresh_review_params.rbi +6 -0
  159. data/rbi/straddle/models/payment_list_params.rbi +126 -0
  160. data/rbi/straddle/models/payment_summary_paged_v1.rbi +214 -6
  161. data/rbi/straddle/models/payout_cancel_params.rbi +6 -0
  162. data/rbi/straddle/models/payout_create_params.rbi +29 -3
  163. data/rbi/straddle/models/payout_get_params.rbi +6 -0
  164. data/rbi/straddle/models/payout_hold_params.rbi +6 -0
  165. data/rbi/straddle/models/payout_release_params.rbi +6 -0
  166. data/rbi/straddle/models/payout_unmask_params.rbi +6 -0
  167. data/rbi/straddle/models/payout_unmask_response.rbi +393 -3
  168. data/rbi/straddle/models/payout_update_params.rbi +9 -3
  169. data/rbi/straddle/models/payout_upload_authorization_document_params.rbi +88 -0
  170. data/rbi/straddle/models/payout_v1.rbi +361 -3
  171. data/rbi/straddle/models/status_details_v1.rbi +29 -0
  172. data/rbi/straddle/models.rbi +3 -0
  173. data/rbi/straddle/resources/bridge/link.rbi +12 -6
  174. data/rbi/straddle/resources/bridge.rbi +13 -1
  175. data/rbi/straddle/resources/charges.rbi +13 -8
  176. data/rbi/straddle/resources/customers/review.rbi +7 -1
  177. data/rbi/straddle/resources/customers.rbi +20 -8
  178. data/rbi/straddle/resources/embed/accounts/capability_requests.rbi +6 -2
  179. data/rbi/straddle/resources/embed/accounts.rbi +22 -10
  180. data/rbi/straddle/resources/embed/linked_bank_accounts.rbi +8 -4
  181. data/rbi/straddle/resources/embed/organizations.rbi +4 -0
  182. data/rbi/straddle/resources/embed/representatives.rbi +12 -6
  183. data/rbi/straddle/resources/embed.rbi +19 -0
  184. data/rbi/straddle/resources/funding_events.rbi +27 -0
  185. data/rbi/straddle/resources/paykeys/review.rbi +7 -2
  186. data/rbi/straddle/resources/paykeys.rbi +32 -8
  187. data/rbi/straddle/resources/payments.rbi +28 -3
  188. data/rbi/straddle/resources/payouts.rbi +44 -7
  189. data/sig/straddle/internal/util.rbs +14 -0
  190. data/sig/straddle/models/bridge/link_create_paykey_response.rbs +17 -1
  191. data/sig/straddle/models/bridge/link_create_tan_response.rbs +17 -1
  192. data/sig/straddle/models/charge_cancel_params.rbs +5 -0
  193. data/sig/straddle/models/charge_create_params.rbs +18 -4
  194. data/sig/straddle/models/charge_get_params.rbs +5 -0
  195. data/sig/straddle/models/charge_hold_params.rbs +5 -0
  196. data/sig/straddle/models/charge_release_params.rbs +5 -0
  197. data/sig/straddle/models/charge_unmask_params.rbs +5 -0
  198. data/sig/straddle/models/charge_unmask_response.rbs +166 -7
  199. data/sig/straddle/models/charge_update_params.rbs +9 -4
  200. data/sig/straddle/models/charge_v1.rbs +166 -7
  201. data/sig/straddle/models/customer_delete_params.rbs +5 -0
  202. data/sig/straddle/models/customer_get_params.rbs +5 -0
  203. data/sig/straddle/models/customer_unmasked_params.rbs +5 -0
  204. data/sig/straddle/models/customer_update_params.rbs +5 -0
  205. data/sig/straddle/models/customers/review_decision_params.rbs +5 -0
  206. data/sig/straddle/models/customers/review_get_params.rbs +5 -0
  207. data/sig/straddle/models/customers/review_refresh_review_params.rbs +5 -0
  208. data/sig/straddle/models/embed/account_get_params.rbs +5 -1
  209. data/sig/straddle/models/embed/account_list_params.rbs +7 -0
  210. data/sig/straddle/models/embed/account_onboard_params.rbs +5 -0
  211. data/sig/straddle/models/embed/account_paged_v1.rbs +18 -2
  212. data/sig/straddle/models/embed/account_simulate_params.rbs +5 -0
  213. data/sig/straddle/models/embed/account_update_params.rbs +5 -0
  214. data/sig/straddle/models/embed/account_v1.rbs +18 -2
  215. data/sig/straddle/models/embed/accounts/capability_request_create_params.rbs +5 -0
  216. data/sig/straddle/models/embed/accounts/capability_request_list_params.rbs +5 -0
  217. data/sig/straddle/models/embed/accounts/capability_request_paged_v1.rbs +5 -0
  218. data/sig/straddle/models/embed/address_v1.rbs +12 -27
  219. data/sig/straddle/models/embed/linked_bank_account_cancel_params.rbs +10 -1
  220. data/sig/straddle/models/embed/linked_bank_account_get_params.rbs +9 -1
  221. data/sig/straddle/models/embed/linked_bank_account_unmask_params.rbs +9 -1
  222. data/sig/straddle/models/embed/linked_bank_account_update_params.rbs +5 -0
  223. data/sig/straddle/models/embed/organization_get_params.rbs +5 -1
  224. data/sig/straddle/models/embed/representative_get_params.rbs +9 -1
  225. data/sig/straddle/models/embed/representative_unmask_params.rbs +9 -1
  226. data/sig/straddle/models/embed/representative_update_params.rbs +5 -0
  227. data/sig/straddle/models/funding_event_get_params.rbs +5 -0
  228. data/sig/straddle/models/funding_event_list_params.rbs +125 -0
  229. data/sig/straddle/models/funding_event_summary_item_v1.rbs +164 -0
  230. data/sig/straddle/models/funding_event_summary_paged_v1.rbs +164 -0
  231. data/sig/straddle/models/paykey_cancel_params.rbs +5 -0
  232. data/sig/straddle/models/paykey_get_params.rbs +5 -0
  233. data/sig/straddle/models/paykey_list_params.rbs +31 -1
  234. data/sig/straddle/models/paykey_reveal_params.rbs +5 -0
  235. data/sig/straddle/models/paykey_reveal_response.rbs +17 -1
  236. data/sig/straddle/models/paykey_summary_paged_v1.rbs +25 -4
  237. data/sig/straddle/models/paykey_unmasked_params.rbs +5 -0
  238. data/sig/straddle/models/paykey_unmasked_v1.rbs +17 -1
  239. data/sig/straddle/models/paykey_update_balance_params.rbs +5 -0
  240. data/sig/straddle/models/paykey_v1.rbs +25 -4
  241. data/sig/straddle/models/paykeys/review_decision_params.rbs +5 -0
  242. data/sig/straddle/models/paykeys/review_get_params.rbs +5 -0
  243. data/sig/straddle/models/paykeys/review_get_response.rbs +28 -10
  244. data/sig/straddle/models/paykeys/review_refresh_review_params.rbs +5 -0
  245. data/sig/straddle/models/payment_list_params.rbs +80 -2
  246. data/sig/straddle/models/payment_summary_paged_v1.rbs +89 -7
  247. data/sig/straddle/models/payout_cancel_params.rbs +5 -0
  248. data/sig/straddle/models/payout_create_params.rbs +18 -4
  249. data/sig/straddle/models/payout_get_params.rbs +5 -0
  250. data/sig/straddle/models/payout_hold_params.rbs +5 -0
  251. data/sig/straddle/models/payout_release_params.rbs +5 -0
  252. data/sig/straddle/models/payout_unmask_params.rbs +5 -0
  253. data/sig/straddle/models/payout_unmask_response.rbs +163 -4
  254. data/sig/straddle/models/payout_update_params.rbs +9 -4
  255. data/sig/straddle/models/payout_upload_authorization_document_params.rbs +59 -0
  256. data/sig/straddle/models/payout_v1.rbs +163 -4
  257. data/sig/straddle/models/status_details_v1.rbs +14 -0
  258. data/sig/straddle/models.rbs +2 -0
  259. data/sig/straddle/resources/charges.rbs +2 -2
  260. data/sig/straddle/resources/embed/accounts.rbs +1 -0
  261. data/sig/straddle/resources/funding_events.rbs +4 -0
  262. data/sig/straddle/resources/paykeys.rbs +4 -0
  263. data/sig/straddle/resources/payments.rbs +7 -0
  264. data/sig/straddle/resources/payouts.rbs +12 -2
  265. metadata +19 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e5e80a1c1b53b3a5f149984bc7e7fbb1ae782caee1a4c9683ffcb96559733a7
4
- data.tar.gz: 376d8c6d7ee586b2d7e61dad2947fae516565306f9ad6d4754273c38568bfa8d
3
+ metadata.gz: c565d8666792b9e9e15e8037302268c3be6544daa5c3e230411d2c835e0e82ff
4
+ data.tar.gz: 721c8b3563e20f209e8bebdb74bb3c50a7b230c82f9eca7e4699827d8c0906a8
5
5
  SHA512:
6
- metadata.gz: 57024a8ac2cbc21595f1d7eb0896f367273cda63b109d206fe0ef5168f8eb9c91bf47550c509c5b74bac8ff745366678acd1a433566d67278cc780c4698f1a24
7
- data.tar.gz: 7128242298fe0136fdbaa3b3e87ead934ba990d6bf99aed938229b034cd90e903a8fb51989dd8cd89c1eb53ae9d70411547aad962c7812898e966fde32292bc3
6
+ metadata.gz: 06a0293faaecfa000fd3af9a8f58695c57632560055a8dda0ffa15a35d3407240b29e5f6a5a6eed792aded8594988e06c143d881caa7a7896f33aa321c4378f8
7
+ data.tar.gz: 7b852b929d99776ba583e670adb08e5ddcfe4c418110659a38298be600b14d8a9b87d964b1eb9c6b75b6d0ee2d560a638c9cae00eeeff20d59436e8e326ad5d3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,132 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 (2026-08-20)
4
+
5
+ Full Changelog: [v0.4.0...v0.5.0](https://github.com/straddleio/straddle-ruby/compare/v0.4.0...v0.5.0)
6
+
7
+ ### Features
8
+
9
+ * **docs:** Preliminary update to SDK Spec ([e7b29ac](https://github.com/straddleio/straddle-ruby/commit/e7b29ac6f7e7f724df5efe7363b660e8f9a89cfa))
10
+ * **docs:** Preliminary update to SDK Spec ([ed5e050](https://github.com/straddleio/straddle-ruby/commit/ed5e05094ff6f4a235ef5391e2f703fb407f6d3b))
11
+ * **docs:** Preliminary update to SDK Spec ([7c0bb4e](https://github.com/straddleio/straddle-ruby/commit/7c0bb4ef05b1a44561b64fb5a79c630872749059))
12
+ * **docs:** Preliminary update to SDK Spec ([7002bf6](https://github.com/straddleio/straddle-ruby/commit/7002bf6fac839b1dc36efb16dd314de81233989d))
13
+ * **docs:** Preliminary update to SDK Spec ([c47e7c8](https://github.com/straddleio/straddle-ruby/commit/c47e7c8b792f4ad29d58c0de1ed0b0b798387bb1))
14
+ * **docs:** Preliminary update to SDK Spec ([26c3cb7](https://github.com/straddleio/straddle-ruby/commit/26c3cb7493ee9dbfc74d6ca50957ec389e17b6e3))
15
+ * **docs:** Preliminary update to SDK Spec ([e0cc45e](https://github.com/straddleio/straddle-ruby/commit/e0cc45ee2fa2e92222c197a5f623c4646db4a150))
16
+ * **docs:** Preliminary update to SDK Spec ([f6ff7e9](https://github.com/straddleio/straddle-ruby/commit/f6ff7e965acc866271017a12571d9cd9cbe3555e))
17
+ * **docs:** Preliminary update to SDK Spec ([069900e](https://github.com/straddleio/straddle-ruby/commit/069900e9afbc11761aaaba9bf2da9ca483eb91b9))
18
+ * **docs:** Preliminary update to SDK Spec ([b75c086](https://github.com/straddleio/straddle-ruby/commit/b75c08610abfb58987d3e4f967e86fec6d0858f1))
19
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([a22c44c](https://github.com/straddleio/straddle-ruby/commit/a22c44c216033b0e7139e2a7a145aff4306f5aab))
20
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([288cb36](https://github.com/straddleio/straddle-ruby/commit/288cb36bc01644ad79b36a74a51bca05823e601d))
21
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([2054d2d](https://github.com/straddleio/straddle-ruby/commit/2054d2d6013b2a5e9590b9c367691940dad6a35a))
22
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([00ed553](https://github.com/straddleio/straddle-ruby/commit/00ed5533f68d5a5544bdad919cad27f4c7cffcd1))
23
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([7002e3b](https://github.com/straddleio/straddle-ruby/commit/7002e3b61de10383548251a079dee909e012b5d7))
24
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([400fba0](https://github.com/straddleio/straddle-ruby/commit/400fba0874ab2c2cab4f5c563c70c1b5133a8d9c))
25
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([0b6a3e6](https://github.com/straddleio/straddle-ruby/commit/0b6a3e62ce018a034b1a22f52be0c541d9db8aa6))
26
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([1a6840c](https://github.com/straddleio/straddle-ruby/commit/1a6840c843dba1f817dcbac2b224536ae69810cb))
27
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([c9e050b](https://github.com/straddleio/straddle-ruby/commit/c9e050b1e63ae60c5946bcd96523fdc9101529ef))
28
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([dc39609](https://github.com/straddleio/straddle-ruby/commit/dc39609d6658b6e2c137047eaa07d09e03fe3bbe))
29
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([efed5dd](https://github.com/straddleio/straddle-ruby/commit/efed5ddd1f6b99bf5eddaf61e169682c1dd6eee9))
30
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([977268e](https://github.com/straddleio/straddle-ruby/commit/977268e0e20e577961ab293ef45742e6b1f225aa))
31
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([0ffc081](https://github.com/straddleio/straddle-ruby/commit/0ffc081971f6bb4097bc432c2851064842a31d78))
32
+ * **stlc:** configurable CI runner and private-production-repo support in workflow templates ([8510658](https://github.com/straddleio/straddle-ruby/commit/85106582fe5e52651f06179d95406fdfbe01514e))
33
+ * support setting headers via env ([1035a65](https://github.com/straddleio/straddle-ruby/commit/1035a65355f65811ae5a5e93ef3fb8fed7d64061))
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * align path encoding with RFC 3986 section 3.3 ([a1c1ca0](https://github.com/straddleio/straddle-ruby/commit/a1c1ca05b98340a96927e521646b98ec7127c388))
39
+ * **client:** elide content type header on requests without body ([f8b0052](https://github.com/straddleio/straddle-ruby/commit/f8b0052437d42a064e2f99eb3369d83253bd0020))
40
+ * **client:** send content-type header for requests with an omitted optional body ([c7d6ae5](https://github.com/straddleio/straddle-ruby/commit/c7d6ae5c76e1688bf57b094759c95d5f99c3d993))
41
+ * **internal:** correct multipart form field name encoding ([c3fe8ba](https://github.com/straddleio/straddle-ruby/commit/c3fe8baca80d691689f17cf3ff465094bfe86fd9))
42
+ * multipart encoding for file arrays ([b45ee2f](https://github.com/straddleio/straddle-ruby/commit/b45ee2ff796e02cc8f2386219fb6d7c2716cd03a))
43
+ * variable name typo ([3840f23](https://github.com/straddleio/straddle-ruby/commit/3840f23f47dead5d75012c9071a06b1a33dc92ec))
44
+
45
+
46
+ ### Chores
47
+
48
+ * **ci:** support opting out of skipping builds on metadata-only commits ([d92ad12](https://github.com/straddleio/straddle-ruby/commit/d92ad12b3d78aa92e5aeba1c39d12bfc7917420b))
49
+ * **internal:** allow the mock server port to be set with STAINLESS_MOCK_PORT ([c45511c](https://github.com/straddleio/straddle-ruby/commit/c45511c71f985869840a1f41a178e759ee6038d4))
50
+ * **internal:** bound formatter parallelism to CPU count ([6434980](https://github.com/straddleio/straddle-ruby/commit/64349804ab8b9ad6263e156c7007136dda591c4c))
51
+ * **internal:** more robust bootstrap script ([1a07668](https://github.com/straddleio/straddle-ruby/commit/1a076684b8e059d19bc70380ac4ffc7719fa8b61))
52
+ * **tests:** bump steady to v0.20.1 ([b415e2c](https://github.com/straddleio/straddle-ruby/commit/b415e2c8779f8fefb4190303d42e624ce7d32b7d))
53
+ * **tests:** bump steady to v0.20.2 ([0b8bd79](https://github.com/straddleio/straddle-ruby/commit/0b8bd793d05c72366b45bbeee667897d0675bf45))
54
+ * **tests:** bump steady to v0.22.1 ([acfadaa](https://github.com/straddleio/straddle-ruby/commit/acfadaaf986ebd3eca6851eee5617345e061865c))
55
+
56
+ ## 0.4.0 (2026-03-25)
57
+
58
+ Full Changelog: [v0.3.0...v0.4.0](https://github.com/straddleio/straddle-ruby/compare/v0.3.0...v0.4.0)
59
+
60
+ ### Features
61
+
62
+ * **docs:** Preliminary update to SDK Spec ([a994089](https://github.com/straddleio/straddle-ruby/commit/a99408935f4845971d9651ad7fee5d717236cc4b))
63
+ * **docs:** Preliminary update to SDK Spec ([e0c673c](https://github.com/straddleio/straddle-ruby/commit/e0c673c0b019a12538459577ea1ace160157be9f))
64
+ * **docs:** Preliminary update to SDK Spec ([ab49d6a](https://github.com/straddleio/straddle-ruby/commit/ab49d6aa46cb99d6730e1f5948bbcfb5415ce78c))
65
+ * **docs:** Preliminary update to SDK Spec ([2bb0ce7](https://github.com/straddleio/straddle-ruby/commit/2bb0ce7d9596b697ddf32df5ef277ca55d4b95cb))
66
+ * **docs:** Preliminary update to SDK Spec ([759a24a](https://github.com/straddleio/straddle-ruby/commit/759a24a18fc47e03f99ea25c72e6b5e648803de6))
67
+ * **docs:** Preliminary update to SDK Spec ([2f15e87](https://github.com/straddleio/straddle-ruby/commit/2f15e87de5dbb4dab8160231011b4caf010baeb6))
68
+ * **docs:** Preliminary update to SDK Spec ([65fe483](https://github.com/straddleio/straddle-ruby/commit/65fe483c98ad3d3c4a901f10c9bfc1b5ef96d257))
69
+ * **docs:** Preliminary update to SDK Spec ([35942d0](https://github.com/straddleio/straddle-ruby/commit/35942d0627af65b581371c283021844fd8a0bf81))
70
+ * **docs:** Preliminary update to SDK Spec ([b287450](https://github.com/straddleio/straddle-ruby/commit/b287450f5ab5ee21243ba0b0c1458beb72f92832))
71
+ * **docs:** Preliminary update to SDK Spec ([caa3e6e](https://github.com/straddleio/straddle-ruby/commit/caa3e6eaedca057efac14a95278655388a870ffb))
72
+ * **docs:** Preliminary update to SDK Spec ([da1a4e5](https://github.com/straddleio/straddle-ruby/commit/da1a4e5c2d0ad6b62c2971b2eaa20146965e178d))
73
+ * **docs:** Preliminary update to SDK Spec ([12c8533](https://github.com/straddleio/straddle-ruby/commit/12c853310303cb4b4342b5c278cb7941f480f103))
74
+ * **docs:** Preliminary update to SDK Spec ([2bb2562](https://github.com/straddleio/straddle-ruby/commit/2bb2562e097739663f25b260d1007041b9109f0f))
75
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([abb8de9](https://github.com/straddleio/straddle-ruby/commit/abb8de9e06161d6ce2ae94b798b4387df8d1a24c))
76
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([6e446e6](https://github.com/straddleio/straddle-ruby/commit/6e446e60dc383c9d3c6184811af093d28b6e1cd8))
77
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([d908ee6](https://github.com/straddleio/straddle-ruby/commit/d908ee634a5ae9ac456e569a3295da27cc4c990e))
78
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([898c39b](https://github.com/straddleio/straddle-ruby/commit/898c39bec0902f40eb06355d6804b497b6cffe2b))
79
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([cc470c8](https://github.com/straddleio/straddle-ruby/commit/cc470c8ad0504432f4b808b37127aa79efff9833))
80
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([99ed5a2](https://github.com/straddleio/straddle-ruby/commit/99ed5a21f9e79a9390bf092c2d51138ea0d84b2d))
81
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([d2ead91](https://github.com/straddleio/straddle-ruby/commit/d2ead91f78dec78cac9d524abf5428c1fa22a720))
82
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([46a0ab3](https://github.com/straddleio/straddle-ruby/commit/46a0ab30f644faa810fa509bd8f104847b88c978))
83
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([ef7fd5f](https://github.com/straddleio/straddle-ruby/commit/ef7fd5f87a68ce095c9b367c8a7f2edca5fe23be))
84
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([454257f](https://github.com/straddleio/straddle-ruby/commit/454257f19eb94916cea2e2f62d4855a540e6f36f))
85
+ * **docs:** Release Updates to SDK based on Open API Spec (Final) ([327f383](https://github.com/straddleio/straddle-ruby/commit/327f38385cacf75acf5cffc2c3fd9e49d6d6b858))
86
+
87
+
88
+ ### Bug Fixes
89
+
90
+ * calling `break` out of streams should be instantaneous ([65a7035](https://github.com/straddleio/straddle-ruby/commit/65a70353f1184a41f6d49e25eef0bdbc7072159a))
91
+ * **client:** always add content-length to post body, even when empty ([30dd077](https://github.com/straddleio/straddle-ruby/commit/30dd077007ef4d18699681aaeb38c3ce96e6f71a))
92
+ * **client:** loosen json header parsing ([89a2422](https://github.com/straddleio/straddle-ruby/commit/89a24221918e69c4d1d416c8112e8e5d60462197))
93
+ * **docs:** fix mcp installation instructions for remote servers ([4e9f0b8](https://github.com/straddleio/straddle-ruby/commit/4e9f0b845fdd847d19237ec4fca8f271eafa110e))
94
+ * issue where json.parse errors when receiving HTTP 204 with nobody ([50718b8](https://github.com/straddleio/straddle-ruby/commit/50718b8169bbda3a2ebc1c0b5bc5424ad8080391))
95
+ * properly mock time in ruby ci tests ([c17150a](https://github.com/straddleio/straddle-ruby/commit/c17150a4ea48337ef433acb3d789c4b71192272f))
96
+
97
+
98
+ ### Chores
99
+
100
+ * **ci:** add build step ([b284348](https://github.com/straddleio/straddle-ruby/commit/b284348c52ff380e366b3605688904e4b54a48ee))
101
+ * **ci:** skip lint on metadata-only changes ([2d5b557](https://github.com/straddleio/straddle-ruby/commit/2d5b557ca8ee74326d4acfe1d1a4aa0669d486d2))
102
+ * **ci:** skip uploading artifacts on stainless-internal branches ([58dafed](https://github.com/straddleio/straddle-ruby/commit/58dafed680488b92024a9eff72374720d421fd6f))
103
+ * **docs:** remove www prefix ([27edb53](https://github.com/straddleio/straddle-ruby/commit/27edb5337b03002d5eb1738b5d92ed1c01463c1d))
104
+ * explicitly require "base64" gem ([f100e97](https://github.com/straddleio/straddle-ruby/commit/f100e97c7e621d0b1ab88ad0c89ee76a0fe45396))
105
+ * fix typo in descriptions ([a2523b7](https://github.com/straddleio/straddle-ruby/commit/a2523b75912086c1843324095984a19b650ff704))
106
+ * **internal:** codegen related update ([8e7cf9a](https://github.com/straddleio/straddle-ruby/commit/8e7cf9acaf4489577db186a2d22e77a955b4906e))
107
+ * **internal:** codegen related update ([8e5e7ea](https://github.com/straddleio/straddle-ruby/commit/8e5e7ea45e9ff012fb2205e6fe9a1e6a0d7dd1e8))
108
+ * **internal:** codegen related update ([1a5e921](https://github.com/straddleio/straddle-ruby/commit/1a5e92121000780f6decf5e835a5546d013d4143))
109
+ * **internal:** tweak CI branches ([3ae860c](https://github.com/straddleio/straddle-ruby/commit/3ae860c3fd991bdb8f23e9810dfd3e602429182b))
110
+ * **internal:** update `actions/checkout` version ([cc750a5](https://github.com/straddleio/straddle-ruby/commit/cc750a510782578f720e3df4fe7f0ad8f1ac7cc5))
111
+ * **internal:** update gitignore ([a710798](https://github.com/straddleio/straddle-ruby/commit/a710798ef83f1345cfdaf96796907539d91c6700))
112
+ * move `cgi` into dependencies for ruby 4 ([bb397c4](https://github.com/straddleio/straddle-ruby/commit/bb397c497907aa40e381dab916a0e2643329476a))
113
+ * **test:** do not count install time for mock server timeout ([e00275d](https://github.com/straddleio/straddle-ruby/commit/e00275d5c3bc65beecc0b3e8d84937f850823d32))
114
+ * **tests:** bump steady to v0.19.4 ([d71d7c1](https://github.com/straddleio/straddle-ruby/commit/d71d7c1efd4d9aff7794dfe094c4a78362302e35))
115
+ * **tests:** bump steady to v0.19.5 ([c6cdca9](https://github.com/straddleio/straddle-ruby/commit/c6cdca9d1ea9be5d8957236da28d805b9f9703c1))
116
+ * **tests:** bump steady to v0.19.6 ([c6117b1](https://github.com/straddleio/straddle-ruby/commit/c6117b1ccca3bf562a2342f69ed9d1ad5f1f3c70))
117
+ * **tests:** bump steady to v0.19.7 ([a15b004](https://github.com/straddleio/straddle-ruby/commit/a15b00439585eaac4d5973dcc58e9651ef1b7e80))
118
+ * update mock server docs ([62f9869](https://github.com/straddleio/straddle-ruby/commit/62f98690bfdb9297542060f54d13159d3b37059f))
119
+
120
+
121
+ ### Documentation
122
+
123
+ * prominently feature MCP server setup in root SDK readmes ([91ed678](https://github.com/straddleio/straddle-ruby/commit/91ed678dc60cdd67aee12901542a3e956410fcd0))
124
+
125
+
126
+ ### Refactors
127
+
128
+ * **tests:** switch from prism to steady ([3a1546c](https://github.com/straddleio/straddle-ruby/commit/3a1546c87187ebda73423d2397295e37ba1fac40))
129
+
3
130
  ## 0.3.0 (2025-11-16)
4
131
 
5
132
  Full Changelog: [v0.2.0...v0.3.0](https://github.com/straddleio/straddle-ruby/compare/v0.2.0...v0.3.0)
data/README.md CHANGED
@@ -4,6 +4,15 @@ The Straddle Ruby library provides convenient access to the Straddle REST API fr
4
4
 
5
5
  It is generated with [Stainless](https://www.stainless.com/).
6
6
 
7
+ ## MCP Server
8
+
9
+ Use the Straddle MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
10
+
11
+ [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40straddlecom%2Fstraddle-mcp&config=eyJuYW1lIjoiQHN0cmFkZGxlY29tL3N0cmFkZGxlLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL3N0cmFkZGxlLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7Ingtc3RyYWRkbGUtYXBpLWtleSI6Ik15IEFQSSBLZXkifX0)
12
+ [![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40straddlecom%2Fstraddle-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fstraddle.stlmcp.com%22%2C%22headers%22%3A%7B%22x-straddle-api-key%22%3A%22My%20API%20Key%22%7D%7D)
13
+
14
+ > Note: You may need to set environment variables in your MCP client.
15
+
7
16
  ## Documentation
8
17
 
9
18
  Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/straddle).
@@ -17,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
17
26
  <!-- x-release-please-start-version -->
18
27
 
19
28
  ```ruby
20
- gem "straddle", "~> 0.3.0"
29
+ gem "straddle", "~> 0.5.0"
21
30
  ```
22
31
 
23
32
  <!-- x-release-please-end -->
@@ -76,6 +85,28 @@ if page.next_page?
76
85
  end
77
86
  ```
78
87
 
88
+ ### File uploads
89
+
90
+ Request parameters that correspond to file uploads can be passed as raw contents, a [`Pathname`](https://rubyapi.org/3.2/o/pathname) instance, [`StringIO`](https://rubyapi.org/3.2/o/stringio), or more.
91
+
92
+ ```ruby
93
+ require "pathname"
94
+
95
+ # Use `Pathname` to send the filename and/or avoid paging a large file into memory:
96
+ payout_v1 = straddle.payouts.upload_authorization_document(file: Pathname("/path/to/file"))
97
+
98
+ # Alternatively, pass file contents or a `StringIO` directly:
99
+ payout_v1 = straddle.payouts.upload_authorization_document(file: File.read("/path/to/file"))
100
+
101
+ # Or, to control the filename and/or content type:
102
+ File = Straddle::FilePart.new(File.read("/path/to/file"), filename: "/path/to/file", content_type: "…")
103
+ payout_v1 = straddle.payouts.upload_authorization_document(file: File)
104
+
105
+ puts(payout_v1.data)
106
+ ```
107
+
108
+ Note that you can also pass a raw `IO` descriptor, but this disables retries, as the library can't be sure if the descriptor is a file or pipe (which cannot be rewound).
109
+
79
110
  ### Handling errors
80
111
 
81
112
  When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Straddle::Errors::APIError` will be thrown:
@@ -28,24 +28,58 @@ module Straddle
28
28
  # @return [Straddle::Resources::Embed]
29
29
  attr_reader :embed
30
30
 
31
+ # Bridge provides a comprehensive suite of tools for connecting customer bank
32
+ # accounts. Use it to generate secure widget sessions for instant account
33
+ # verification, accept tokens from major providers like Plaid and Finicity, or
34
+ # verify accounts directly via our API. Bridge handles all sensitive banking
35
+ # credentials and ensures secure, compliant connections with support for 90% of US
36
+ # bank accounts.
31
37
  # @return [Straddle::Resources::Bridge]
32
38
  attr_reader :bridge
33
39
 
40
+ # Customers represent the end users who send or receive payments through your
41
+ # integration. Each customer undergoes automatic identity verification and fraud
42
+ # screening upon creation. Use customers to track payment history, manage bank
43
+ # account connections, and maintain a secure record of all transactions associated
44
+ # with a user. Customers can be either individuals or businesses with appropriate
45
+ # compliance checks for each type.
34
46
  # @return [Straddle::Resources::Customers]
35
47
  attr_reader :customers
36
48
 
49
+ # Paykeys are secure tokens that link verified customer identities to their bank
50
+ # accounts. Each Paykey includes built-in balance checking, fraud detection
51
+ # through LSTM machine learning models, and can be reused for subscriptions and
52
+ # recurring payments without storing sensitive data. Paykeys eliminate fraud by
53
+ # ensuring the person initiating payment owns the funding account.
37
54
  # @return [Straddle::Resources::Paykeys]
38
55
  attr_reader :paykeys
39
56
 
57
+ # Charges represent attempts to debit money from a customer's bank account using a
58
+ # Paykey. Each charge includes automatic balance verification, real-time fraud
59
+ # screening, and multi-rail optimization and detailed status tracking throughout
60
+ # the payment lifecycle. Use charges to accept bank payments with confidence
61
+ # knowing every transaction is protected.
40
62
  # @return [Straddle::Resources::Charges]
41
63
  attr_reader :charges
42
64
 
65
+ # Funding events represent all money movement between Straddle and an Account's
66
+ # external bank accounts. They are automatically generated when charges settle or
67
+ # payouts are initiated. Each event provides detailed tracking of settlement
68
+ # status, fee breakdowns, and reconciliation data across both incoming and
69
+ # outgoing transfers. Use funding events to monitor your platform's entire money
70
+ # movement lifecycle.
43
71
  # @return [Straddle::Resources::FundingEvents]
44
72
  attr_reader :funding_events
45
73
 
74
+ # Payments provide endpoints to filter both Charges and Payouts with multiple
75
+ # different parameters.
46
76
  # @return [Straddle::Resources::Payments]
47
77
  attr_reader :payments
48
78
 
79
+ # Payouts represent transfers from Straddle to customer bank accounts. Create
80
+ # payouts to handle disbursements, process refunds, or manage marketplace
81
+ # settlements. Use payouts to send money quickly and securely with the most
82
+ # cost-effective rail automatically selected.
49
83
  # @return [Straddle::Resources::Payouts]
50
84
  attr_reader :payouts
51
85
 
@@ -101,6 +135,19 @@ module Straddle
101
135
  raise ArgumentError.new("api_key is required, and can be set via environ: \"STRADDLE_API_KEY\"")
102
136
  end
103
137
 
138
+ headers = {}
139
+ custom_headers_env = ENV["STRADDLE_CUSTOM_HEADERS"]
140
+ unless custom_headers_env.nil?
141
+ parsed = {}
142
+ custom_headers_env.split("\n").each do |line|
143
+ colon = line.index(":")
144
+ unless colon.nil?
145
+ parsed[line[0...colon].strip] = line[(colon + 1)..].strip
146
+ end
147
+ end
148
+ headers = parsed.merge(headers)
149
+ end
150
+
104
151
  @api_key = api_key.to_s
105
152
 
106
153
  super(
@@ -108,7 +155,8 @@ module Straddle
108
155
  timeout: timeout,
109
156
  max_retries: max_retries,
110
157
  initial_retry_delay: initial_retry_delay,
111
- max_retry_delay: max_retry_delay
158
+ max_retry_delay: max_retry_delay,
159
+ headers: headers
112
160
  )
113
161
 
114
162
  @embed = Straddle::Resources::Embed.new(client: self)
@@ -306,6 +306,11 @@ module Straddle
306
306
  Straddle::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
307
307
  end
308
308
 
309
+ # Generated methods always pass `req[:body]` for operations that define a
310
+ # request body, so only elide the content-type header when the operation
311
+ # has no body at all, not when an optional body param was omitted.
312
+ headers.delete("content-type") if body.nil? && !req.key?(:body)
313
+
309
314
  url = Straddle::Internal::Util.join_parsed_uri(
310
315
  @base_url_components,
311
316
  {**req, path: path, query: query}
@@ -75,7 +75,7 @@ module Straddle
75
75
 
76
76
  case body
77
77
  in nil
78
- nil
78
+ req["content-length"] ||= 0 unless req["transfer-encoding"]
79
79
  in String
80
80
  req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
81
81
  req.body_stream = Straddle::Internal::Util::ReadIOAdapter.new(body, &blk)
@@ -153,17 +153,19 @@ module Straddle
153
153
  end
154
154
 
155
155
  self.class.calibrate_socket_timeout(conn, deadline)
156
- conn.request(req) do |rsp|
157
- y << [req, rsp]
158
- break if finished
159
-
160
- rsp.read_body do |bytes|
161
- y << bytes.force_encoding(Encoding::BINARY)
162
- break if finished
163
-
164
- self.class.calibrate_socket_timeout(conn, deadline)
156
+ ::Kernel.catch(:jump) do
157
+ conn.request(req) do |rsp|
158
+ y << [req, rsp]
159
+ ::Kernel.throw(:jump) if finished
160
+
161
+ rsp.read_body do |bytes|
162
+ y << bytes.force_encoding(Encoding::BINARY)
163
+ ::Kernel.throw(:jump) if finished
164
+
165
+ self.class.calibrate_socket_timeout(conn, deadline)
166
+ end
167
+ eof = true
165
168
  end
166
- eof = true
167
169
  end
168
170
  end
169
171
  ensure
@@ -157,7 +157,7 @@ module Straddle
157
157
  in Hash | nil => coerced
158
158
  coerced
159
159
  else
160
- message = "Expected a #{Hash} or #{Straddle::Internal::Type::BaseModel}, got #{data.inspect}"
160
+ message = "Expected a #{Hash} or #{Straddle::Internal::Type::BaseModel}, got #{input.inspect}"
161
161
  raise ArgumentError.new(message)
162
162
  end
163
163
  end
@@ -237,6 +237,11 @@ module Straddle
237
237
  end
238
238
  end
239
239
 
240
+ # @type [Regexp]
241
+ #
242
+ # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
243
+ RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
244
+
240
245
  class << self
241
246
  # @api private
242
247
  #
@@ -247,6 +252,15 @@ module Straddle
247
252
  "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
248
253
  end
249
254
 
255
+ # @api private
256
+ #
257
+ # @param path [String, Integer]
258
+ #
259
+ # @return [String]
260
+ def encode_path(path)
261
+ path.to_s.gsub(Straddle::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
262
+ end
263
+
250
264
  # @api private
251
265
  #
252
266
  # @param path [String, Array<String>]
@@ -259,7 +273,7 @@ module Straddle
259
273
  in []
260
274
  ""
261
275
  in [String => p, *interpolations]
262
- encoded = interpolations.map { ERB::Util.url_encode(_1) }
276
+ encoded = interpolations.map { encode_path(_1) }
263
277
  format(p, *encoded)
264
278
  end
265
279
  end
@@ -485,11 +499,42 @@ module Straddle
485
499
  end
486
500
 
487
501
  # @type [Regexp]
488
- JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}
502
+ JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}
489
503
  # @type [Regexp]
490
504
  JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491
505
 
492
506
  class << self
507
+ # @api private
508
+ #
509
+ # @param query [Hash{Symbol=>Object}]
510
+ #
511
+ # @return [Hash{Symbol=>Object}]
512
+ def encode_query_params(query)
513
+ out = {}
514
+ query.each { write_query_param_element!(out, _1, _2) }
515
+ out
516
+ end
517
+
518
+ # @api private
519
+ #
520
+ # @param collection [Hash{Symbol=>Object}]
521
+ # @param key [String]
522
+ # @param element [Object]
523
+ #
524
+ # @return [nil]
525
+ private def write_query_param_element!(collection, key, element)
526
+ case element
527
+ in Hash
528
+ element.each do |name, value|
529
+ write_query_param_element!(collection, "#{key}[#{name}]", value)
530
+ end
531
+ in Array
532
+ collection[key] = element.map(&:to_s).join(",")
533
+ else
534
+ collection[key] = element.to_s
535
+ end
536
+ end
537
+
493
538
  # @api private
494
539
  #
495
540
  # @param y [Enumerator::Yielder]
@@ -540,16 +585,15 @@ module Straddle
540
585
  y << "Content-Disposition: form-data"
541
586
 
542
587
  unless key.nil?
543
- name = ERB::Util.url_encode(key.to_s)
544
- y << "; name=\"#{name}\""
588
+ y << "; name=\"#{key}\""
545
589
  end
546
590
 
547
591
  case val
548
592
  in Straddle::FilePart unless val.filename.nil?
549
- filename = ERB::Util.url_encode(val.filename)
593
+ filename = encode_path(val.filename)
550
594
  y << "; filename=\"#{filename}\""
551
595
  in Pathname | IO
552
- filename = ERB::Util.url_encode(::File.basename(val.to_path))
596
+ filename = encode_path(::File.basename(val.to_path))
553
597
  y << "; filename=\"#{filename}\""
554
598
  else
555
599
  end
@@ -566,6 +610,7 @@ module Straddle
566
610
  #
567
611
  # @return [Array(String, Enumerable<String>)]
568
612
  private def encode_multipart_streaming(body)
613
+ # rubocop:disable Style/CaseEquality
569
614
  # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
570
615
  boundary = SecureRandom.urlsafe_base64(46)
571
616
 
@@ -575,7 +620,7 @@ module Straddle
575
620
  in Hash
576
621
  body.each do |key, val|
577
622
  case val
578
- in Array if val.all? { primitive?(_1) }
623
+ in Array if val.all? { primitive?(_1) || Straddle::Internal::Type::FileInput === _1 }
579
624
  val.each do |v|
580
625
  write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
581
626
  end
@@ -591,6 +636,7 @@ module Straddle
591
636
 
592
637
  fused_io = fused_enum(strio) { closing.each(&:call) }
593
638
  [boundary, fused_io]
639
+ # rubocop:enable Style/CaseEquality
594
640
  end
595
641
 
596
642
  # @api private
@@ -657,7 +703,8 @@ module Straddle
657
703
  def decode_content(headers, stream:, suppress_error: false)
658
704
  case (content_type = headers["content-type"])
659
705
  in Straddle::Internal::Util::JSON_CONTENT
660
- json = stream.to_a.join
706
+ return nil if (json = stream.to_a.join).empty?
707
+
661
708
  begin
662
709
  JSON.parse(json, symbolize_names: true)
663
710
  rescue JSON::ParserError => e
@@ -667,7 +714,11 @@ module Straddle
667
714
  in Straddle::Internal::Util::JSONL_CONTENT
668
715
  lines = decode_lines(stream)
669
716
  chain_fused(lines) do |y|
670
- lines.each { y << JSON.parse(_1, symbolize_names: true) }
717
+ lines.each do
718
+ next if _1.empty?
719
+
720
+ y << JSON.parse(_1, symbolize_names: true)
721
+ end
671
722
  end
672
723
  in %r{^text/event-stream}
673
724
  lines = decode_lines(stream)
@@ -238,6 +238,7 @@ module Straddle
238
238
  INACTIVE = :inactive
239
239
  REJECTED = :rejected
240
240
  REVIEW = :review
241
+ BLOCKED = :blocked
241
242
 
242
243
  # @!method self.values
243
244
  # @return [Array<Symbol>]
@@ -393,6 +394,13 @@ module Straddle
393
394
  OK = :ok
394
395
  OTHER_NETWORK_RETURN = :other_network_return
395
396
  PAYOUT_REFUSED = :payout_refused
397
+ CANCEL_REQUEST = :cancel_request
398
+ FAILED_VERIFICATION = :failed_verification
399
+ REQUIRE_REVIEW = :require_review
400
+ BLOCKED_BY_SYSTEM = :blocked_by_system
401
+ WATCHTOWER_REVIEW = :watchtower_review
402
+ VALIDATING = :validating
403
+ AUTO_HOLD = :auto_hold
396
404
 
397
405
  # @!method self.values
398
406
  # @return [Array<Symbol>]
@@ -238,6 +238,7 @@ module Straddle
238
238
  INACTIVE = :inactive
239
239
  REJECTED = :rejected
240
240
  REVIEW = :review
241
+ BLOCKED = :blocked
241
242
 
242
243
  # @!method self.values
243
244
  # @return [Array<Symbol>]
@@ -393,6 +394,13 @@ module Straddle
393
394
  OK = :ok
394
395
  OTHER_NETWORK_RETURN = :other_network_return
395
396
  PAYOUT_REFUSED = :payout_refused
397
+ CANCEL_REQUEST = :cancel_request
398
+ FAILED_VERIFICATION = :failed_verification
399
+ REQUIRE_REVIEW = :require_review
400
+ BLOCKED_BY_SYSTEM = :blocked_by_system
401
+ WATCHTOWER_REVIEW = :watchtower_review
402
+ VALIDATING = :validating
403
+ AUTO_HOLD = :auto_hold
396
404
 
397
405
  # @!method self.values
398
406
  # @return [Array<Symbol>]
@@ -7,6 +7,11 @@ module Straddle
7
7
  extend Straddle::Internal::Type::RequestParameters::Converter
8
8
  include Straddle::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
10
15
  # @!attribute reason
11
16
  # Details about why the charge status was updated.
12
17
  #
@@ -33,7 +38,9 @@ module Straddle
33
38
  # @return [String, nil]
34
39
  optional :straddle_account_id, String
35
40
 
36
- # @!method initialize(reason: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
41
+ # @!method initialize(id:, reason: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
42
+ # @param id [String]
43
+ #
37
44
  # @param reason [String, nil] Details about why the charge status was updated.
38
45
  #
39
46
  # @param correlation_id [String]
@@ -36,8 +36,8 @@ module Straddle
36
36
  # @!attribute description
37
37
  # An arbitrary description for the charge.
38
38
  #
39
- # @return [String]
40
- required :description, String
39
+ # @return [String, nil]
40
+ required :description, String, nil?: true
41
41
 
42
42
  # @!attribute device
43
43
  #
@@ -103,7 +103,7 @@ module Straddle
103
103
  #
104
104
  # @param currency [String] The currency of the charge. Only USD is supported.
105
105
  #
106
- # @param description [String] An arbitrary description for the charge.
106
+ # @param description [String, nil] An arbitrary description for the charge.
107
107
  #
108
108
  # @param device [Straddle::Models::DeviceInfoV1]
109
109
  #
@@ -132,15 +132,31 @@ module Straddle
132
132
  # @return [Symbol, Straddle::Models::ChargeCreateParams::Config::BalanceCheck]
133
133
  required :balance_check, enum: -> { Straddle::ChargeCreateParams::Config::BalanceCheck }
134
134
 
135
+ # @!attribute auto_hold
136
+ # Defines whether to automatically place this charge on hold after being created.
137
+ #
138
+ # @return [Boolean, nil]
139
+ optional :auto_hold, Straddle::Internal::Type::Boolean, nil?: true
140
+
141
+ # @!attribute auto_hold_message
142
+ # The reason the charge is being automatically held on creation.
143
+ #
144
+ # @return [String, nil]
145
+ optional :auto_hold_message, String, nil?: true
146
+
135
147
  # @!attribute sandbox_outcome
136
148
  # Payment will simulate processing if not Standard.
137
149
  #
138
150
  # @return [Symbol, Straddle::Models::ChargeCreateParams::Config::SandboxOutcome, nil]
139
151
  optional :sandbox_outcome, enum: -> { Straddle::ChargeCreateParams::Config::SandboxOutcome }
140
152
 
141
- # @!method initialize(balance_check:, sandbox_outcome: nil)
153
+ # @!method initialize(balance_check:, auto_hold: nil, auto_hold_message: nil, sandbox_outcome: nil)
142
154
  # @param balance_check [Symbol, Straddle::Models::ChargeCreateParams::Config::BalanceCheck] Defines whether to check the customer's balance before processing the charge.
143
155
  #
156
+ # @param auto_hold [Boolean, nil] Defines whether to automatically place this charge on hold after being created.
157
+ #
158
+ # @param auto_hold_message [String, nil] The reason the charge is being automatically held on creation.
159
+ #
144
160
  # @param sandbox_outcome [Symbol, Straddle::Models::ChargeCreateParams::Config::SandboxOutcome] Payment will simulate processing if not Standard.
145
161
 
146
162
  # Defines whether to check the customer's balance before processing the charge.
@@ -174,6 +190,8 @@ module Straddle
174
190
  REVERSED_CUSTOMER_DISPUTE = :reversed_customer_dispute
175
191
  FAILED_CLOSED_BANK_ACCOUNT = :failed_closed_bank_account
176
192
  REVERSED_CLOSED_BANK_ACCOUNT = :reversed_closed_bank_account
193
+ FAILED_NOT_AUTHORIZED = :failed_not_authorized
194
+ REVERSED_NOT_AUTHORIZED = :reversed_not_authorized
177
195
 
178
196
  # @!method self.values
179
197
  # @return [Array<Symbol>]