stripe 5.55.0 → 13.5.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +567 -4
- data/Gemfile +12 -4
- data/Makefile +18 -3
- data/OPENAPI_VERSION +1 -0
- data/README.md +93 -21
- data/Rakefile +3 -6
- data/VERSION +1 -1
- data/examples/README.md +16 -0
- data/examples/example_template.rb +36 -0
- data/examples/meter_event_stream.rb +57 -0
- data/examples/thinevent_webhook_handler.rb +39 -0
- data/{bin → exe}/stripe-console +1 -1
- data/justfile +43 -0
- data/lib/data/ca-certificates.crt +1241 -1937
- data/lib/stripe/api_operations/create.rb +6 -2
- data/lib/stripe/api_operations/delete.rb +12 -7
- data/lib/stripe/api_operations/list.rb +6 -9
- data/lib/stripe/api_operations/nested_resource.rb +63 -35
- data/lib/stripe/api_operations/request.rb +29 -65
- data/lib/stripe/api_operations/save.rb +20 -10
- data/lib/stripe/api_operations/search.rb +11 -9
- data/lib/stripe/api_operations/singleton_save.rb +90 -0
- data/lib/stripe/api_requestor.rb +1131 -0
- data/lib/stripe/api_resource.rb +48 -18
- data/lib/stripe/api_resource_test_helpers.rb +9 -3
- data/lib/stripe/api_version.rb +8 -0
- data/lib/stripe/connection_manager.rb +5 -7
- data/lib/stripe/errors.rb +11 -13
- data/lib/stripe/event_types.rb +14 -0
- data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +23 -0
- data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +13 -0
- data/lib/stripe/instrumentation.rb +37 -15
- data/lib/stripe/list_object.rb +5 -3
- data/lib/stripe/multipart_encoder.rb +7 -7
- data/lib/stripe/oauth.rb +14 -21
- data/lib/stripe/object_types.rb +151 -103
- data/lib/stripe/request_options.rb +129 -0
- data/lib/stripe/resources/account.rb +129 -25
- data/lib/stripe/resources/account_link.rb +12 -0
- data/lib/stripe/resources/account_session.rb +25 -0
- data/lib/stripe/resources/alipay_account.rb +1 -1
- data/lib/stripe/resources/apple_pay_domain.rb +38 -0
- data/lib/stripe/resources/application_fee.rb +9 -2
- data/lib/stripe/resources/application_fee_refund.rb +9 -2
- data/lib/stripe/resources/apps/secret.rb +55 -0
- data/lib/stripe/resources/balance.rb +14 -0
- data/lib/stripe/resources/balance_transaction.rb +19 -0
- data/lib/stripe/resources/bank_account.rb +53 -4
- data/lib/stripe/resources/billing/alert.rb +87 -0
- data/lib/stripe/resources/billing/credit_balance_summary.rb +14 -0
- data/lib/stripe/resources/billing/credit_balance_transaction.rb +26 -0
- data/lib/stripe/resources/billing/credit_grant.rb +90 -0
- data/lib/stripe/resources/billing/meter.rb +85 -0
- data/lib/stripe/resources/billing/meter_event.rb +26 -0
- data/lib/stripe/resources/billing/meter_event_adjustment.rb +26 -0
- data/lib/stripe/resources/billing/meter_event_summary.rb +17 -0
- data/lib/stripe/resources/billing_portal/configuration.rb +34 -0
- data/lib/stripe/resources/billing_portal/session.rb +27 -0
- data/lib/stripe/resources/capability.rb +7 -2
- data/lib/stripe/resources/card.rb +34 -3
- data/lib/stripe/resources/cash_balance.rb +4 -0
- data/lib/stripe/resources/charge.rb +52 -3
- data/lib/stripe/resources/checkout/session.rb +83 -5
- data/lib/stripe/resources/climate/order.rb +67 -0
- data/lib/stripe/resources/climate/product.rb +27 -0
- data/lib/stripe/resources/climate/supplier.rb +26 -0
- data/lib/stripe/resources/confirmation_token.rb +39 -0
- data/lib/stripe/resources/country_spec.rb +14 -0
- data/lib/stripe/resources/coupon.rb +48 -0
- data/lib/stripe/resources/credit_note.rb +67 -9
- data/lib/stripe/resources/credit_note_line_item.rb +4 -0
- data/lib/stripe/resources/customer.rb +172 -28
- data/lib/stripe/resources/customer_balance_transaction.rb +9 -1
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +15 -0
- data/lib/stripe/resources/customer_session.rb +29 -0
- data/lib/stripe/resources/discount.rb +7 -0
- data/lib/stripe/resources/dispute.rb +41 -3
- data/lib/stripe/resources/entitlements/active_entitlement.rb +26 -0
- data/lib/stripe/resources/entitlements/feature.rb +49 -0
- data/lib/stripe/resources/ephemeral_key.rb +23 -0
- data/lib/stripe/resources/event.rb +38 -0
- data/lib/stripe/resources/exchange_rate.rb +34 -0
- data/lib/stripe/resources/file.rb +37 -15
- data/lib/stripe/resources/file_link.rb +26 -0
- data/lib/stripe/resources/financial_connections/account.rb +101 -6
- data/lib/stripe/resources/financial_connections/account_owner.rb +4 -0
- data/lib/stripe/resources/financial_connections/account_ownership.rb +4 -0
- data/lib/stripe/resources/financial_connections/session.rb +14 -0
- data/lib/stripe/resources/financial_connections/transaction.rb +26 -0
- data/lib/stripe/resources/forwarding/request.rb +52 -0
- data/lib/stripe/resources/funding_instructions.rb +8 -0
- data/lib/stripe/resources/identity/verification_report.rb +24 -0
- data/lib/stripe/resources/identity/verification_session.rb +117 -5
- data/lib/stripe/resources/invoice.rb +247 -20
- data/lib/stripe/resources/invoice_item.rb +54 -0
- data/lib/stripe/resources/invoice_line_item.rb +22 -1
- data/lib/stripe/resources/invoice_rendering_template.rb +65 -0
- data/lib/stripe/resources/issuing/authorization.rb +210 -5
- data/lib/stripe/resources/issuing/card.rb +128 -4
- data/lib/stripe/resources/issuing/cardholder.rb +36 -0
- data/lib/stripe/resources/issuing/dispute.rb +47 -2
- data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
- data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
- data/lib/stripe/resources/issuing/token.rb +32 -0
- data/lib/stripe/resources/issuing/transaction.rb +79 -0
- data/lib/stripe/resources/line_item.rb +4 -0
- data/lib/stripe/resources/login_link.rb +4 -0
- data/lib/stripe/resources/mandate.rb +4 -0
- data/lib/stripe/resources/payment_intent.rb +238 -15
- data/lib/stripe/resources/payment_link.rb +39 -2
- data/lib/stripe/resources/payment_method.rb +78 -5
- data/lib/stripe/resources/payment_method_configuration.rb +59 -0
- data/lib/stripe/resources/payment_method_domain.rb +79 -0
- data/lib/stripe/resources/payout.rb +63 -5
- data/lib/stripe/resources/person.rb +8 -1
- data/lib/stripe/resources/plan.rb +51 -0
- data/lib/stripe/resources/price.rb +30 -1
- data/lib/stripe/resources/product.rb +55 -1
- data/lib/stripe/resources/product_feature.rb +13 -0
- data/lib/stripe/resources/promotion_code.rb +25 -0
- data/lib/stripe/resources/quote.rb +97 -39
- data/lib/stripe/resources/radar/early_fraud_warning.rb +17 -0
- data/lib/stripe/resources/radar/value_list.rb +56 -0
- data/lib/stripe/resources/radar/value_list_item.rb +46 -0
- data/lib/stripe/resources/refund.rb +70 -5
- data/lib/stripe/resources/reporting/report_run.rb +31 -0
- data/lib/stripe/resources/reporting/report_type.rb +21 -1
- data/lib/stripe/resources/reversal.rb +17 -2
- data/lib/stripe/resources/review.rb +24 -3
- data/lib/stripe/resources/setup_attempt.rb +12 -0
- data/lib/stripe/resources/setup_intent.rb +113 -7
- data/lib/stripe/resources/shipping_rate.rb +25 -0
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +17 -0
- data/lib/stripe/resources/source.rb +52 -10
- data/lib/stripe/resources/source_transaction.rb +7 -0
- data/lib/stripe/resources/subscription.rb +118 -5
- data/lib/stripe/resources/subscription_item.rb +54 -6
- data/lib/stripe/resources/subscription_schedule.rb +60 -5
- data/lib/stripe/resources/tax/calculation.rb +48 -0
- data/lib/stripe/resources/tax/calculation_line_item.rb +13 -0
- data/lib/stripe/resources/tax/registration.rb +54 -0
- data/lib/stripe/resources/tax/settings.rb +17 -0
- data/lib/stripe/resources/tax/transaction.rb +56 -0
- data/lib/stripe/resources/tax/transaction_line_item.rb +13 -0
- data/lib/stripe/resources/tax_code.rb +9 -0
- data/lib/stripe/resources/tax_id.rb +34 -12
- data/lib/stripe/resources/tax_rate.rb +26 -0
- data/lib/stripe/resources/terminal/configuration.rb +54 -0
- data/lib/stripe/resources/terminal/connection_token.rb +16 -0
- data/lib/stripe/resources/terminal/location.rb +57 -0
- data/lib/stripe/resources/terminal/reader.rb +138 -11
- data/lib/stripe/resources/test_helpers/test_clock.rb +58 -3
- data/lib/stripe/resources/token.rb +29 -0
- data/lib/stripe/resources/topup.rb +40 -3
- data/lib/stripe/resources/transfer.rb +29 -6
- data/lib/stripe/resources/treasury/credit_reversal.rb +37 -0
- data/lib/stripe/resources/treasury/debit_reversal.rb +37 -0
- data/lib/stripe/resources/treasury/financial_account.rb +109 -0
- data/lib/stripe/resources/treasury/financial_account_features.rb +15 -0
- data/lib/stripe/resources/treasury/inbound_transfer.rb +130 -0
- data/lib/stripe/resources/treasury/outbound_payment.rb +152 -0
- data/lib/stripe/resources/treasury/outbound_transfer.rb +152 -0
- data/lib/stripe/resources/treasury/received_credit.rb +47 -0
- data/lib/stripe/resources/treasury/received_debit.rb +47 -0
- data/lib/stripe/resources/treasury/transaction.rb +26 -0
- data/lib/stripe/resources/treasury/transaction_entry.rb +30 -0
- data/lib/stripe/resources/usage_record.rb +9 -0
- data/lib/stripe/resources/usage_record_summary.rb +4 -0
- data/lib/stripe/resources/v2/billing/meter_event.rb +16 -0
- data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +15 -0
- data/lib/stripe/resources/v2/billing/meter_event_session.rb +15 -0
- data/lib/stripe/resources/v2/event.rb +13 -0
- data/lib/stripe/resources/v2/event_destination.rb +13 -0
- data/lib/stripe/resources/webhook_endpoint.rb +55 -0
- data/lib/stripe/resources.rb +51 -10
- data/lib/stripe/search_result_object.rb +5 -2
- data/lib/stripe/services/account_capability_service.rb +39 -0
- data/lib/stripe/services/account_external_account_service.rb +68 -0
- data/lib/stripe/services/account_link_service.rb +17 -0
- data/lib/stripe/services/account_login_link_service.rb +19 -0
- data/lib/stripe/services/account_person_service.rb +61 -0
- data/lib/stripe/services/account_service.rb +100 -0
- data/lib/stripe/services/account_session_service.rb +17 -0
- data/lib/stripe/services/apple_pay_domain_service.rb +50 -0
- data/lib/stripe/services/application_fee_refund_service.rb +60 -0
- data/lib/stripe/services/application_fee_service.rb +35 -0
- data/lib/stripe/services/apps/secret_service.rb +52 -0
- data/lib/stripe/services/apps_service.rb +13 -0
- data/lib/stripe/services/balance_service.rb +12 -0
- data/lib/stripe/services/balance_transaction_service.rb +32 -0
- data/lib/stripe/services/billing/alert_service.rb +74 -0
- data/lib/stripe/services/billing/credit_balance_summary_service.rb +19 -0
- data/lib/stripe/services/billing/credit_balance_transaction_service.rb +30 -0
- data/lib/stripe/services/billing/credit_grant_service.rb +74 -0
- data/lib/stripe/services/billing/meter_event_adjustment_service.rb +19 -0
- data/lib/stripe/services/billing/meter_event_service.rb +19 -0
- data/lib/stripe/services/billing/meter_event_summary_service.rb +19 -0
- data/lib/stripe/services/billing/meter_service.rb +81 -0
- data/lib/stripe/services/billing_portal/configuration_service.rb +52 -0
- data/lib/stripe/services/billing_portal/session_service.rb +19 -0
- data/lib/stripe/services/billing_portal_service.rb +14 -0
- data/lib/stripe/services/billing_service.rb +20 -0
- data/lib/stripe/services/charge_service.rb +69 -0
- data/lib/stripe/services/checkout/session_line_item_service.rb +19 -0
- data/lib/stripe/services/checkout/session_service.rb +72 -0
- data/lib/stripe/services/checkout_service.rb +13 -0
- data/lib/stripe/services/climate/order_service.rb +68 -0
- data/lib/stripe/services/climate/product_service.rb +30 -0
- data/lib/stripe/services/climate/supplier_service.rb +30 -0
- data/lib/stripe/services/climate_service.rb +15 -0
- data/lib/stripe/services/confirmation_token_service.rb +17 -0
- data/lib/stripe/services/country_spec_service.rb +28 -0
- data/lib/stripe/services/coupon_service.rb +51 -0
- data/lib/stripe/services/credit_note_line_item_service.rb +17 -0
- data/lib/stripe/services/credit_note_preview_lines_service.rb +17 -0
- data/lib/stripe/services/credit_note_service.rb +93 -0
- data/lib/stripe/services/customer_balance_transaction_service.rb +50 -0
- data/lib/stripe/services/customer_cash_balance_service.rb +28 -0
- data/lib/stripe/services/customer_cash_balance_transaction_service.rb +28 -0
- data/lib/stripe/services/customer_funding_instructions_service.rb +19 -0
- data/lib/stripe/services/customer_payment_method_service.rb +28 -0
- data/lib/stripe/services/customer_payment_source_service.rb +76 -0
- data/lib/stripe/services/customer_service.rb +89 -0
- data/lib/stripe/services/customer_session_service.rb +17 -0
- data/lib/stripe/services/customer_tax_id_service.rb +50 -0
- data/lib/stripe/services/dispute_service.rb +48 -0
- data/lib/stripe/services/entitlements/active_entitlement_service.rb +30 -0
- data/lib/stripe/services/entitlements/feature_service.rb +52 -0
- data/lib/stripe/services/entitlements_service.rb +14 -0
- data/lib/stripe/services/ephemeral_key_service.rb +28 -0
- data/lib/stripe/services/event_service.rb +22 -0
- data/lib/stripe/services/exchange_rate_service.rb +28 -0
- data/lib/stripe/services/file_link_service.rb +38 -0
- data/lib/stripe/services/file_service.rb +35 -0
- data/lib/stripe/services/financial_connections/account_owner_service.rb +19 -0
- data/lib/stripe/services/financial_connections/account_service.rb +81 -0
- data/lib/stripe/services/financial_connections/session_service.rb +30 -0
- data/lib/stripe/services/financial_connections/transaction_service.rb +30 -0
- data/lib/stripe/services/financial_connections_service.rb +15 -0
- data/lib/stripe/services/forwarding/request_service.rb +41 -0
- data/lib/stripe/services/forwarding_service.rb +13 -0
- data/lib/stripe/services/identity/verification_report_service.rb +30 -0
- data/lib/stripe/services/identity/verification_session_service.rb +106 -0
- data/lib/stripe/services/identity_service.rb +14 -0
- data/lib/stripe/services/invoice_item_service.rb +61 -0
- data/lib/stripe/services/invoice_line_item_service.rb +31 -0
- data/lib/stripe/services/invoice_rendering_template_service.rb +50 -0
- data/lib/stripe/services/invoice_service.rb +202 -0
- data/lib/stripe/services/invoice_upcoming_lines_service.rb +17 -0
- data/lib/stripe/services/issuing/authorization_service.rb +65 -0
- data/lib/stripe/services/issuing/card_service.rb +52 -0
- data/lib/stripe/services/issuing/cardholder_service.rb +52 -0
- data/lib/stripe/services/issuing/dispute_service.rb +63 -0
- data/lib/stripe/services/issuing/personalization_design_service.rb +52 -0
- data/lib/stripe/services/issuing/physical_bundle_service.rb +30 -0
- data/lib/stripe/services/issuing/token_service.rb +41 -0
- data/lib/stripe/services/issuing/transaction_service.rb +41 -0
- data/lib/stripe/services/issuing_service.rb +20 -0
- data/lib/stripe/services/mandate_service.rb +17 -0
- data/lib/stripe/services/oauth_service.rb +63 -0
- data/lib/stripe/services/payment_intent_service.rb +204 -0
- data/lib/stripe/services/payment_link_line_item_service.rb +17 -0
- data/lib/stripe/services/payment_link_service.rb +57 -0
- data/lib/stripe/services/payment_method_configuration_service.rb +50 -0
- data/lib/stripe/services/payment_method_domain_service.rb +66 -0
- data/lib/stripe/services/payment_method_service.rb +86 -0
- data/lib/stripe/services/payout_service.rb +66 -0
- data/lib/stripe/services/plan_service.rb +49 -0
- data/lib/stripe/services/price_service.rb +52 -0
- data/lib/stripe/services/product_feature_service.rb +50 -0
- data/lib/stripe/services/product_service.rb +70 -0
- data/lib/stripe/services/promotion_code_service.rb +50 -0
- data/lib/stripe/services/quote_computed_upfront_line_items_service.rb +17 -0
- data/lib/stripe/services/quote_line_item_service.rb +17 -0
- data/lib/stripe/services/quote_service.rb +92 -0
- data/lib/stripe/services/radar/early_fraud_warning_service.rb +32 -0
- data/lib/stripe/services/radar/value_list_item_service.rb +52 -0
- data/lib/stripe/services/radar/value_list_service.rb +63 -0
- data/lib/stripe/services/radar_service.rb +15 -0
- data/lib/stripe/services/refund_service.rb +63 -0
- data/lib/stripe/services/reporting/report_run_service.rb +41 -0
- data/lib/stripe/services/reporting/report_type_service.rb +30 -0
- data/lib/stripe/services/reporting_service.rb +14 -0
- data/lib/stripe/services/review_service.rb +33 -0
- data/lib/stripe/services/setup_attempt_service.rb +17 -0
- data/lib/stripe/services/setup_intent_service.rb +105 -0
- data/lib/stripe/services/shipping_rate_service.rb +50 -0
- data/lib/stripe/services/sigma/scheduled_query_run_service.rb +30 -0
- data/lib/stripe/services/sigma_service.rb +13 -0
- data/lib/stripe/services/source_service.rb +64 -0
- data/lib/stripe/services/source_transaction_service.rb +17 -0
- data/lib/stripe/services/subscription_item_service.rb +69 -0
- data/lib/stripe/services/subscription_item_usage_record_service.rb +23 -0
- data/lib/stripe/services/subscription_item_usage_record_summary_service.rb +19 -0
- data/lib/stripe/services/subscription_schedule_service.rb +72 -0
- data/lib/stripe/services/subscription_service.rb +127 -0
- data/lib/stripe/services/tax/calculation_line_item_service.rb +19 -0
- data/lib/stripe/services/tax/calculation_service.rb +37 -0
- data/lib/stripe/services/tax/registration_service.rb +54 -0
- data/lib/stripe/services/tax/settings_service.rb +30 -0
- data/lib/stripe/services/tax/transaction_line_item_service.rb +19 -0
- data/lib/stripe/services/tax/transaction_service.rb +48 -0
- data/lib/stripe/services/tax_code_service.rb +22 -0
- data/lib/stripe/services/tax_id_service.rb +38 -0
- data/lib/stripe/services/tax_rate_service.rb +38 -0
- data/lib/stripe/services/tax_service.rb +16 -0
- data/lib/stripe/services/terminal/configuration_service.rb +63 -0
- data/lib/stripe/services/terminal/connection_token_service.rb +19 -0
- data/lib/stripe/services/terminal/location_service.rb +64 -0
- data/lib/stripe/services/terminal/reader_service.rb +118 -0
- data/lib/stripe/services/terminal_service.rb +16 -0
- data/lib/stripe/services/test_helpers/confirmation_token_service.rb +19 -0
- data/lib/stripe/services/test_helpers/customer_service.rb +19 -0
- data/lib/stripe/services/test_helpers/issuing/authorization_service.rb +87 -0
- data/lib/stripe/services/test_helpers/issuing/card_service.rb +65 -0
- data/lib/stripe/services/test_helpers/issuing/personalization_design_service.rb +43 -0
- data/lib/stripe/services/test_helpers/issuing/transaction_service.rb +43 -0
- data/lib/stripe/services/test_helpers/issuing_service.rb +19 -0
- data/lib/stripe/services/test_helpers/refund_service.rb +19 -0
- data/lib/stripe/services/test_helpers/terminal/reader_service.rb +21 -0
- data/lib/stripe/services/test_helpers/terminal_service.rb +15 -0
- data/lib/stripe/services/test_helpers/test_clock_service.rb +63 -0
- data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +43 -0
- data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +54 -0
- data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +54 -0
- data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +21 -0
- data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +21 -0
- data/lib/stripe/services/test_helpers/treasury_service.rb +19 -0
- data/lib/stripe/services/test_helpers_service.rb +19 -0
- data/lib/stripe/services/token_service.rb +23 -0
- data/lib/stripe/services/topup_service.rb +49 -0
- data/lib/stripe/services/transfer_reversal_service.rb +56 -0
- data/lib/stripe/services/transfer_service.rb +47 -0
- data/lib/stripe/services/treasury/credit_reversal_service.rb +41 -0
- data/lib/stripe/services/treasury/debit_reversal_service.rb +41 -0
- data/lib/stripe/services/treasury/financial_account_features_service.rb +30 -0
- data/lib/stripe/services/treasury/financial_account_service.rb +70 -0
- data/lib/stripe/services/treasury/inbound_transfer_service.rb +52 -0
- data/lib/stripe/services/treasury/outbound_payment_service.rb +52 -0
- data/lib/stripe/services/treasury/outbound_transfer_service.rb +52 -0
- data/lib/stripe/services/treasury/received_credit_service.rb +30 -0
- data/lib/stripe/services/treasury/received_debit_service.rb +30 -0
- data/lib/stripe/services/treasury/transaction_entry_service.rb +30 -0
- data/lib/stripe/services/treasury/transaction_service.rb +30 -0
- data/lib/stripe/services/treasury_service.rb +22 -0
- data/lib/stripe/services/v1_services.rb +89 -0
- data/lib/stripe/services/v2/billing/meter_event_adjustment_service.rb +21 -0
- data/lib/stripe/services/v2/billing/meter_event_service.rb +21 -0
- data/lib/stripe/services/v2/billing/meter_event_session_service.rb +21 -0
- data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +23 -0
- data/lib/stripe/services/v2/billing_service.rb +18 -0
- data/lib/stripe/services/v2/core/event_destination_service.rb +98 -0
- data/lib/stripe/services/v2/core/event_service.rb +32 -0
- data/lib/stripe/services/v2/core_service.rb +16 -0
- data/lib/stripe/services/v2_services.rb +14 -0
- data/lib/stripe/services/webhook_endpoint_service.rb +61 -0
- data/lib/stripe/services.rb +182 -0
- data/lib/stripe/singleton_api_resource.rb +3 -3
- data/lib/stripe/stripe_client.rb +55 -1028
- data/lib/stripe/stripe_configuration.rb +63 -42
- data/lib/stripe/stripe_object.rb +60 -38
- data/lib/stripe/stripe_response.rb +1 -3
- data/lib/stripe/stripe_service.rb +32 -0
- data/lib/stripe/thin_event.rb +37 -0
- data/lib/stripe/util.rb +109 -45
- data/lib/stripe/v2_list_object.rb +84 -0
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe/webhook.rb +3 -2
- data/lib/stripe.rb +39 -0
- data/stripe.gemspec +7 -4
- metadata +252 -13
- data/lib/stripe/resources/bitcoin_receiver.rb +0 -24
- data/lib/stripe/resources/bitcoin_transaction.rb +0 -16
- data/lib/stripe/resources/issuing/card_details.rb +0 -10
- data/lib/stripe/resources/order.rb +0 -33
- data/lib/stripe/resources/order_return.rb +0 -10
- data/lib/stripe/resources/recipient.rb +0 -14
- data/lib/stripe/resources/sku.rb +0 -13
- data/lib/stripe/resources/three_d_secure.rb +0 -14
data/lib/stripe/object_types.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# File generated from our OpenAPI spec
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
# rubocop:disable Metrics/MethodLength
|
@@ -8,112 +7,161 @@ module Stripe
|
|
8
7
|
def self.object_names_to_classes
|
9
8
|
{
|
10
9
|
# data structures
|
11
|
-
ListObject
|
12
|
-
SearchResultObject
|
10
|
+
ListObject.object_name => ListObject,
|
11
|
+
SearchResultObject.object_name => SearchResultObject,
|
12
|
+
File.object_name_alt => File,
|
13
13
|
|
14
|
-
#
|
15
|
-
Account
|
16
|
-
AccountLink
|
17
|
-
|
18
|
-
ApplePayDomain
|
19
|
-
ApplicationFee
|
20
|
-
ApplicationFeeRefund
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
14
|
+
# object classes: The beginning of the section generated from our OpenAPI spec
|
15
|
+
Account.object_name => Account,
|
16
|
+
AccountLink.object_name => AccountLink,
|
17
|
+
AccountSession.object_name => AccountSession,
|
18
|
+
ApplePayDomain.object_name => ApplePayDomain,
|
19
|
+
ApplicationFee.object_name => ApplicationFee,
|
20
|
+
ApplicationFeeRefund.object_name => ApplicationFeeRefund,
|
21
|
+
Apps::Secret.object_name => Apps::Secret,
|
22
|
+
Balance.object_name => Balance,
|
23
|
+
BalanceTransaction.object_name => BalanceTransaction,
|
24
|
+
BankAccount.object_name => BankAccount,
|
25
|
+
Billing::Alert.object_name => Billing::Alert,
|
26
|
+
Billing::CreditBalanceSummary.object_name => Billing::CreditBalanceSummary,
|
27
|
+
Billing::CreditBalanceTransaction.object_name => Billing::CreditBalanceTransaction,
|
28
|
+
Billing::CreditGrant.object_name => Billing::CreditGrant,
|
29
|
+
Billing::Meter.object_name => Billing::Meter,
|
30
|
+
Billing::MeterEvent.object_name => Billing::MeterEvent,
|
31
|
+
Billing::MeterEventAdjustment.object_name => Billing::MeterEventAdjustment,
|
32
|
+
Billing::MeterEventSummary.object_name => Billing::MeterEventSummary,
|
33
|
+
BillingPortal::Configuration.object_name => BillingPortal::Configuration,
|
34
|
+
BillingPortal::Session.object_name => BillingPortal::Session,
|
35
|
+
Capability.object_name => Capability,
|
36
|
+
Card.object_name => Card,
|
37
|
+
CashBalance.object_name => CashBalance,
|
38
|
+
Charge.object_name => Charge,
|
39
|
+
Checkout::Session.object_name => Checkout::Session,
|
40
|
+
Climate::Order.object_name => Climate::Order,
|
41
|
+
Climate::Product.object_name => Climate::Product,
|
42
|
+
Climate::Supplier.object_name => Climate::Supplier,
|
43
|
+
ConfirmationToken.object_name => ConfirmationToken,
|
44
|
+
CountrySpec.object_name => CountrySpec,
|
45
|
+
Coupon.object_name => Coupon,
|
46
|
+
CreditNote.object_name => CreditNote,
|
47
|
+
CreditNoteLineItem.object_name => CreditNoteLineItem,
|
48
|
+
Customer.object_name => Customer,
|
49
|
+
CustomerBalanceTransaction.object_name => CustomerBalanceTransaction,
|
50
|
+
CustomerCashBalanceTransaction.object_name => CustomerCashBalanceTransaction,
|
51
|
+
CustomerSession.object_name => CustomerSession,
|
52
|
+
Discount.object_name => Discount,
|
53
|
+
Dispute.object_name => Dispute,
|
54
|
+
Entitlements::ActiveEntitlement.object_name => Entitlements::ActiveEntitlement,
|
55
|
+
Entitlements::Feature.object_name => Entitlements::Feature,
|
56
|
+
EphemeralKey.object_name => EphemeralKey,
|
57
|
+
Event.object_name => Event,
|
58
|
+
ExchangeRate.object_name => ExchangeRate,
|
59
|
+
File.object_name => File,
|
60
|
+
FileLink.object_name => FileLink,
|
61
|
+
FinancialConnections::Account.object_name => FinancialConnections::Account,
|
62
|
+
FinancialConnections::AccountOwner.object_name => FinancialConnections::AccountOwner,
|
63
|
+
FinancialConnections::AccountOwnership.object_name => FinancialConnections::AccountOwnership,
|
64
|
+
FinancialConnections::Session.object_name => FinancialConnections::Session,
|
65
|
+
FinancialConnections::Transaction.object_name => FinancialConnections::Transaction,
|
66
|
+
Forwarding::Request.object_name => Forwarding::Request,
|
67
|
+
FundingInstructions.object_name => FundingInstructions,
|
68
|
+
Identity::VerificationReport.object_name => Identity::VerificationReport,
|
69
|
+
Identity::VerificationSession.object_name => Identity::VerificationSession,
|
70
|
+
Invoice.object_name => Invoice,
|
71
|
+
InvoiceItem.object_name => InvoiceItem,
|
72
|
+
InvoiceLineItem.object_name => InvoiceLineItem,
|
73
|
+
InvoiceRenderingTemplate.object_name => InvoiceRenderingTemplate,
|
74
|
+
Issuing::Authorization.object_name => Issuing::Authorization,
|
75
|
+
Issuing::Card.object_name => Issuing::Card,
|
76
|
+
Issuing::Cardholder.object_name => Issuing::Cardholder,
|
77
|
+
Issuing::Dispute.object_name => Issuing::Dispute,
|
78
|
+
Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
|
79
|
+
Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
|
80
|
+
Issuing::Token.object_name => Issuing::Token,
|
81
|
+
Issuing::Transaction.object_name => Issuing::Transaction,
|
82
|
+
LineItem.object_name => LineItem,
|
83
|
+
LoginLink.object_name => LoginLink,
|
84
|
+
Mandate.object_name => Mandate,
|
85
|
+
PaymentIntent.object_name => PaymentIntent,
|
86
|
+
PaymentLink.object_name => PaymentLink,
|
87
|
+
PaymentMethod.object_name => PaymentMethod,
|
88
|
+
PaymentMethodConfiguration.object_name => PaymentMethodConfiguration,
|
89
|
+
PaymentMethodDomain.object_name => PaymentMethodDomain,
|
90
|
+
Payout.object_name => Payout,
|
91
|
+
Person.object_name => Person,
|
92
|
+
Plan.object_name => Plan,
|
93
|
+
Price.object_name => Price,
|
94
|
+
Product.object_name => Product,
|
95
|
+
ProductFeature.object_name => ProductFeature,
|
96
|
+
PromotionCode.object_name => PromotionCode,
|
97
|
+
Quote.object_name => Quote,
|
98
|
+
Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning,
|
99
|
+
Radar::ValueList.object_name => Radar::ValueList,
|
100
|
+
Radar::ValueListItem.object_name => Radar::ValueListItem,
|
101
|
+
Refund.object_name => Refund,
|
102
|
+
Reporting::ReportRun.object_name => Reporting::ReportRun,
|
103
|
+
Reporting::ReportType.object_name => Reporting::ReportType,
|
104
|
+
Reversal.object_name => Reversal,
|
105
|
+
Review.object_name => Review,
|
106
|
+
SetupAttempt.object_name => SetupAttempt,
|
107
|
+
SetupIntent.object_name => SetupIntent,
|
108
|
+
ShippingRate.object_name => ShippingRate,
|
109
|
+
Sigma::ScheduledQueryRun.object_name => Sigma::ScheduledQueryRun,
|
110
|
+
Source.object_name => Source,
|
111
|
+
SourceTransaction.object_name => SourceTransaction,
|
112
|
+
Subscription.object_name => Subscription,
|
113
|
+
SubscriptionItem.object_name => SubscriptionItem,
|
114
|
+
SubscriptionSchedule.object_name => SubscriptionSchedule,
|
115
|
+
Tax::Calculation.object_name => Tax::Calculation,
|
116
|
+
Tax::CalculationLineItem.object_name => Tax::CalculationLineItem,
|
117
|
+
Tax::Registration.object_name => Tax::Registration,
|
118
|
+
Tax::Settings.object_name => Tax::Settings,
|
119
|
+
Tax::Transaction.object_name => Tax::Transaction,
|
120
|
+
Tax::TransactionLineItem.object_name => Tax::TransactionLineItem,
|
121
|
+
TaxCode.object_name => TaxCode,
|
122
|
+
TaxId.object_name => TaxId,
|
123
|
+
TaxRate.object_name => TaxRate,
|
124
|
+
Terminal::Configuration.object_name => Terminal::Configuration,
|
125
|
+
Terminal::ConnectionToken.object_name => Terminal::ConnectionToken,
|
126
|
+
Terminal::Location.object_name => Terminal::Location,
|
127
|
+
Terminal::Reader.object_name => Terminal::Reader,
|
128
|
+
TestHelpers::TestClock.object_name => TestHelpers::TestClock,
|
129
|
+
Token.object_name => Token,
|
130
|
+
Topup.object_name => Topup,
|
131
|
+
Transfer.object_name => Transfer,
|
132
|
+
Treasury::CreditReversal.object_name => Treasury::CreditReversal,
|
133
|
+
Treasury::DebitReversal.object_name => Treasury::DebitReversal,
|
134
|
+
Treasury::FinancialAccount.object_name => Treasury::FinancialAccount,
|
135
|
+
Treasury::FinancialAccountFeatures.object_name => Treasury::FinancialAccountFeatures,
|
136
|
+
Treasury::InboundTransfer.object_name => Treasury::InboundTransfer,
|
137
|
+
Treasury::OutboundPayment.object_name => Treasury::OutboundPayment,
|
138
|
+
Treasury::OutboundTransfer.object_name => Treasury::OutboundTransfer,
|
139
|
+
Treasury::ReceivedCredit.object_name => Treasury::ReceivedCredit,
|
140
|
+
Treasury::ReceivedDebit.object_name => Treasury::ReceivedDebit,
|
141
|
+
Treasury::Transaction.object_name => Treasury::Transaction,
|
142
|
+
Treasury::TransactionEntry.object_name => Treasury::TransactionEntry,
|
143
|
+
UsageRecord.object_name => UsageRecord,
|
144
|
+
UsageRecordSummary.object_name => UsageRecordSummary,
|
145
|
+
WebhookEndpoint.object_name => WebhookEndpoint,
|
146
|
+
# object classes: The end of the section generated from our OpenAPI spec
|
147
|
+
}
|
148
|
+
end
|
149
|
+
|
150
|
+
def self.v2_object_names_to_classes
|
151
|
+
{
|
152
|
+
V2::ListObject.object_name => V2::ListObject,
|
153
|
+
|
154
|
+
# v2 object classes: The beginning of the section generated from our OpenAPI spec
|
155
|
+
V2::Billing::MeterEvent.object_name => V2::Billing::MeterEvent,
|
156
|
+
V2::Billing::MeterEventAdjustment.object_name => V2::Billing::MeterEventAdjustment,
|
157
|
+
V2::Billing::MeterEventSession.object_name => V2::Billing::MeterEventSession,
|
158
|
+
V2::Event.object_name => V2::Event,
|
159
|
+
V2::EventDestination.object_name => V2::EventDestination,
|
160
|
+
# v2 object classes: The end of the section generated from our OpenAPI spec
|
114
161
|
}
|
115
162
|
end
|
116
163
|
end
|
117
164
|
end
|
118
165
|
|
166
|
+
# rubocop:enable Metrics/AbcSize
|
119
167
|
# rubocop:enable Metrics/MethodLength
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# typed: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# RequestOptions is a class that encapsulates configurable options
|
6
|
+
# for requests made to the Stripe API. It is used by the APIRequestor
|
7
|
+
# to set per-request options.
|
8
|
+
#
|
9
|
+
# For internal use only. Does not provide a stable API and may be broken
|
10
|
+
# with future non-major changes.
|
11
|
+
module RequestOptions
|
12
|
+
# Options that a user is allowed to specify.
|
13
|
+
OPTS_USER_SPECIFIED = Set[
|
14
|
+
:api_key,
|
15
|
+
:idempotency_key,
|
16
|
+
:stripe_account,
|
17
|
+
:stripe_context,
|
18
|
+
:stripe_version
|
19
|
+
].freeze
|
20
|
+
|
21
|
+
# Options that should be copyable from one StripeObject to another
|
22
|
+
# including options that may be internal.
|
23
|
+
OPTS_COPYABLE = (
|
24
|
+
OPTS_USER_SPECIFIED + Set[:api_base]
|
25
|
+
).freeze
|
26
|
+
|
27
|
+
# Options that should be persisted between API requests.
|
28
|
+
OPTS_PERSISTABLE = (
|
29
|
+
OPTS_USER_SPECIFIED - Set[:idempotency_key, :stripe_context]
|
30
|
+
).freeze
|
31
|
+
|
32
|
+
# Merges requestor options on a StripeConfiguration object
|
33
|
+
# with a per-request options hash, giving precedence
|
34
|
+
# to the per-request options. Expects StripeConfiguration and hash.
|
35
|
+
def self.merge_config_and_opts(config, req_opts)
|
36
|
+
# Raise an error if config is not a StripeConfiguration object
|
37
|
+
unless config.is_a?(StripeConfiguration)
|
38
|
+
raise ArgumentError, "config must be a Stripe::StripeConfiguration object"
|
39
|
+
end
|
40
|
+
|
41
|
+
merged_opts = {
|
42
|
+
api_key: req_opts[:api_key] || config.api_key,
|
43
|
+
idempotency_key: req_opts[:idempotency_key],
|
44
|
+
stripe_account: req_opts[:stripe_account] || config.stripe_account,
|
45
|
+
stripe_context: req_opts[:stripe_context] || config.stripe_context,
|
46
|
+
stripe_version: req_opts[:stripe_version] || config.api_version,
|
47
|
+
headers: req_opts[:headers] || {},
|
48
|
+
}
|
49
|
+
|
50
|
+
# Remove nil values from headers
|
51
|
+
merged_opts.delete_if { |_, v| v.nil? }
|
52
|
+
|
53
|
+
merged_opts
|
54
|
+
end
|
55
|
+
|
56
|
+
# Merges requestor options hash on a StripeObject
|
57
|
+
# with a per-request options hash, giving precedence
|
58
|
+
# to the per-request options. Returns the merged request options.
|
59
|
+
# Expects two hashes, expects extract_opts_from_hash to be called first!!!
|
60
|
+
def self.combine_opts(object_opts, req_opts)
|
61
|
+
merged_opts = {
|
62
|
+
api_key: req_opts[:api_key] || object_opts[:api_key],
|
63
|
+
idempotency_key: req_opts[:idempotency_key],
|
64
|
+
stripe_account: req_opts[:stripe_account] || object_opts[:stripe_account],
|
65
|
+
stripe_context: req_opts[:stripe_context] || object_opts[:stripe_context],
|
66
|
+
stripe_version: req_opts[:stripe_version] || object_opts[:stripe_version],
|
67
|
+
headers: req_opts[:headers] || {},
|
68
|
+
}
|
69
|
+
|
70
|
+
# Remove nil values from headers
|
71
|
+
merged_opts.delete_if { |_, v| v.nil? }
|
72
|
+
|
73
|
+
merged_opts
|
74
|
+
end
|
75
|
+
|
76
|
+
# Extracts options from a user-provided hash, returning a new request options hash
|
77
|
+
# containing the recognized request options and a `headers` entry for the remaining options.
|
78
|
+
def self.extract_opts_from_hash(opts)
|
79
|
+
req_opts = {}
|
80
|
+
normalized_opts = Util.normalize_opts(opts.clone)
|
81
|
+
|
82
|
+
RequestOptions.error_on_non_string_user_opts(normalized_opts)
|
83
|
+
|
84
|
+
OPTS_USER_SPECIFIED.each do |opt|
|
85
|
+
req_opts[opt] = normalized_opts[opt] if normalized_opts.key?(opt)
|
86
|
+
normalized_opts.delete(opt)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Remaining user-provided opts should be treated as headers
|
90
|
+
req_opts[:headers] = Util.normalize_headers(normalized_opts) if normalized_opts.any?
|
91
|
+
|
92
|
+
req_opts
|
93
|
+
end
|
94
|
+
|
95
|
+
# Validates a normalized opts hash.
|
96
|
+
def self.error_on_non_string_user_opts(normalized_opts)
|
97
|
+
OPTS_USER_SPECIFIED.each do |opt|
|
98
|
+
next unless normalized_opts.key?(opt)
|
99
|
+
|
100
|
+
val = normalized_opts[opt]
|
101
|
+
next if val.nil?
|
102
|
+
next if val.is_a?(String)
|
103
|
+
|
104
|
+
raise ArgumentError,
|
105
|
+
"request option '#{opt}' should be a string value " \
|
106
|
+
"(was a #{val.class})"
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# Get options that persist between requests
|
111
|
+
def self.persistable(req_opts)
|
112
|
+
opts_to_persist = {}
|
113
|
+
|
114
|
+
# Hash#select returns an array before 1.9
|
115
|
+
req_opts.each do |k, v|
|
116
|
+
opts_to_persist[k] = v if RequestOptions::OPTS_PERSISTABLE.include?(k)
|
117
|
+
end
|
118
|
+
|
119
|
+
opts_to_persist
|
120
|
+
end
|
121
|
+
|
122
|
+
# Get options that are copyable from StripeObject to StripeObject
|
123
|
+
def self.copyable(req_opts)
|
124
|
+
req_opts.select do |k, _v|
|
125
|
+
RequestOptions::OPTS_COPYABLE.include?(k)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -2,39 +2,152 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# This is an object representing a Stripe account. You can retrieve it to see
|
6
|
+
# properties on the account like its current requirements or if the account is
|
7
|
+
# enabled to make live charges or receive payouts.
|
8
|
+
#
|
9
|
+
# For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
|
10
|
+
# is `application`, which includes Custom accounts, the properties below are always
|
11
|
+
# returned.
|
12
|
+
#
|
13
|
+
# For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
|
14
|
+
# is `stripe`, which includes Standard and Express accounts, some properties are only returned
|
15
|
+
# until you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions)
|
16
|
+
# to start Connect Onboarding. Learn about the [differences between accounts](https://stripe.com/connect/accounts).
|
5
17
|
class Account < APIResource
|
6
|
-
extend Gem::Deprecate
|
7
18
|
extend Stripe::APIOperations::Create
|
8
19
|
include Stripe::APIOperations::Delete
|
9
20
|
extend Stripe::APIOperations::List
|
10
|
-
include Stripe::APIOperations::Save
|
11
21
|
extend Stripe::APIOperations::NestedResource
|
22
|
+
include Stripe::APIOperations::Save
|
12
23
|
|
13
24
|
OBJECT_NAME = "account"
|
14
|
-
|
15
|
-
|
25
|
+
def self.object_name
|
26
|
+
"account"
|
27
|
+
end
|
16
28
|
|
17
29
|
nested_resource_class_methods :capability,
|
18
30
|
operations: %i[retrieve update list],
|
19
31
|
resource_plural: "capabilities"
|
20
|
-
nested_resource_class_methods :
|
32
|
+
nested_resource_class_methods :external_account,
|
21
33
|
operations: %i[create retrieve update delete list]
|
34
|
+
nested_resource_class_methods :login_link, operations: %i[create]
|
35
|
+
nested_resource_class_methods :person, operations: %i[create retrieve update delete list]
|
36
|
+
|
37
|
+
# With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
|
38
|
+
# To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
|
39
|
+
#
|
40
|
+
# If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
|
41
|
+
# creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
|
42
|
+
# You can prefill any information on the account.
|
43
|
+
def self.create(params = {}, opts = {})
|
44
|
+
request_stripe_object(method: :post, path: "/v1/accounts", params: params, opts: opts)
|
45
|
+
end
|
46
|
+
|
47
|
+
# With [Connect](https://stripe.com/connect), you can delete accounts you manage.
|
48
|
+
#
|
49
|
+
# Test-mode accounts can be deleted at any time.
|
50
|
+
#
|
51
|
+
# Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero.
|
52
|
+
#
|
53
|
+
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
54
|
+
def self.delete(account, params = {}, opts = {})
|
55
|
+
request_stripe_object(
|
56
|
+
method: :delete,
|
57
|
+
path: format("/v1/accounts/%<account>s", { account: CGI.escape(account) }),
|
58
|
+
params: params,
|
59
|
+
opts: opts
|
60
|
+
)
|
61
|
+
end
|
22
62
|
|
63
|
+
# With [Connect](https://stripe.com/connect), you can delete accounts you manage.
|
64
|
+
#
|
65
|
+
# Test-mode accounts can be deleted at any time.
|
66
|
+
#
|
67
|
+
# Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balance_object) are zero.
|
68
|
+
#
|
69
|
+
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
70
|
+
def delete(params = {}, opts = {})
|
71
|
+
request_stripe_object(
|
72
|
+
method: :delete,
|
73
|
+
path: format("/v1/accounts/%<account>s", { account: CGI.escape(self["id"]) }),
|
74
|
+
params: params,
|
75
|
+
opts: opts
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
# Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
|
80
|
+
def self.list(params = {}, opts = {})
|
81
|
+
request_stripe_object(method: :get, path: "/v1/accounts", params: params, opts: opts)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
|
85
|
+
def persons(params = {}, opts = {})
|
86
|
+
request_stripe_object(
|
87
|
+
method: :get,
|
88
|
+
path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(self["id"]) }),
|
89
|
+
params: params,
|
90
|
+
opts: opts
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
|
95
|
+
def self.persons(account, params = {}, opts = {})
|
96
|
+
request_stripe_object(
|
97
|
+
method: :get,
|
98
|
+
path: format("/v1/accounts/%<account>s/persons", { account: CGI.escape(account) }),
|
99
|
+
params: params,
|
100
|
+
opts: opts
|
101
|
+
)
|
102
|
+
end
|
103
|
+
|
104
|
+
# With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious.
|
105
|
+
#
|
106
|
+
# Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
|
23
107
|
def reject(params = {}, opts = {})
|
24
108
|
request_stripe_object(
|
25
109
|
method: :post,
|
26
|
-
path:
|
110
|
+
path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(self["id"]) }),
|
27
111
|
params: params,
|
28
112
|
opts: opts
|
29
113
|
)
|
30
114
|
end
|
31
115
|
|
32
|
-
|
116
|
+
# With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious.
|
117
|
+
#
|
118
|
+
# Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
|
119
|
+
def self.reject(account, params = {}, opts = {})
|
120
|
+
request_stripe_object(
|
121
|
+
method: :post,
|
122
|
+
path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(account) }),
|
123
|
+
params: params,
|
124
|
+
opts: opts
|
125
|
+
)
|
126
|
+
end
|
33
127
|
|
34
|
-
|
35
|
-
|
128
|
+
# Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
|
129
|
+
# left unchanged.
|
130
|
+
#
|
131
|
+
# For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
|
132
|
+
# is application, which includes Custom accounts, you can update any information on the account.
|
133
|
+
#
|
134
|
+
# For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
|
135
|
+
# is stripe, which includes Standard and Express accounts, you can update all information until you create
|
136
|
+
# an [Account Link or <a href="/api/account_sessions">Account Session](https://stripe.com/api/account_links) to start Connect onboarding,
|
137
|
+
# after which some properties can no longer be updated.
|
138
|
+
#
|
139
|
+
# To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
|
140
|
+
# [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
|
141
|
+
def self.update(account, params = {}, opts = {})
|
142
|
+
request_stripe_object(
|
143
|
+
method: :post,
|
144
|
+
path: format("/v1/accounts/%<account>s", { account: CGI.escape(account) }),
|
145
|
+
params: params,
|
146
|
+
opts: opts
|
147
|
+
)
|
148
|
+
end
|
36
149
|
|
37
|
-
|
150
|
+
save_nested_resource :external_account
|
38
151
|
|
39
152
|
def resource_url
|
40
153
|
if self["id"]
|
@@ -60,11 +173,6 @@ module Stripe
|
|
60
173
|
super(id, opts)
|
61
174
|
end
|
62
175
|
|
63
|
-
def persons(params = {}, opts = {})
|
64
|
-
resp, opts = execute_resource_request(:get, resource_url + "/persons", params, opts)
|
65
|
-
Util.convert_to_stripe_object(resp.data, opts)
|
66
|
-
end
|
67
|
-
|
68
176
|
# We are not adding a helper for capabilities here as the Account object
|
69
177
|
# already has a capabilities property which is a hash and not the sub-list
|
70
178
|
# of capabilities.
|
@@ -97,17 +205,13 @@ module Stripe
|
|
97
205
|
end
|
98
206
|
|
99
207
|
def serialize_params_account(_obj, update_hash, options = {})
|
100
|
-
if (entity = @values[:legal_entity])
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
serialize_additional_owners(entity, owners)
|
105
|
-
end
|
208
|
+
if (entity = @values[:legal_entity]) && (owners = entity[:additional_owners])
|
209
|
+
entity_update = update_hash[:legal_entity] ||= {}
|
210
|
+
entity_update[:additional_owners] =
|
211
|
+
serialize_additional_owners(entity, owners)
|
106
212
|
end
|
107
|
-
if (individual = @values[:individual])
|
108
|
-
|
109
|
-
update_hash[:individual] = individual.serialize_params(options)
|
110
|
-
end
|
213
|
+
if (individual = @values[:individual]) && (individual.is_a?(Person) && !update_hash.key?(:individual))
|
214
|
+
update_hash[:individual] = individual.serialize_params(options)
|
111
215
|
end
|
112
216
|
update_hash
|
113
217
|
end
|
@@ -2,9 +2,21 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Account Links are the means by which a Connect platform grants a connected account permission to access
|
6
|
+
# Stripe-hosted applications, such as Connect Onboarding.
|
7
|
+
#
|
8
|
+
# Related guide: [Connect Onboarding](https://stripe.com/docs/connect/custom/hosted-onboarding)
|
5
9
|
class AccountLink < APIResource
|
6
10
|
extend Stripe::APIOperations::Create
|
7
11
|
|
8
12
|
OBJECT_NAME = "account_link"
|
13
|
+
def self.object_name
|
14
|
+
"account_link"
|
15
|
+
end
|
16
|
+
|
17
|
+
# Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
|
18
|
+
def self.create(params = {}, opts = {})
|
19
|
+
request_stripe_object(method: :post, path: "/v1/account_links", params: params, opts: opts)
|
20
|
+
end
|
9
21
|
end
|
10
22
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components.
|
6
|
+
#
|
7
|
+
# We recommend that you create an AccountSession each time you need to display an embedded component
|
8
|
+
# to your user. Do not save AccountSessions to your database as they expire relatively
|
9
|
+
# quickly, and cannot be used more than once.
|
10
|
+
#
|
11
|
+
# Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components)
|
12
|
+
class AccountSession < APIResource
|
13
|
+
extend Stripe::APIOperations::Create
|
14
|
+
|
15
|
+
OBJECT_NAME = "account_session"
|
16
|
+
def self.object_name
|
17
|
+
"account_session"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
|
21
|
+
def self.create(params = {}, opts = {})
|
22
|
+
request_stripe_object(method: :post, path: "/v1/account_sessions", params: params, opts: opts)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|