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
@@ -3,6 +3,9 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Terminal
|
6
|
+
# A Reader represents a physical device for accepting payment details.
|
7
|
+
#
|
8
|
+
# Related guide: [Connecting to a reader](https://stripe.com/docs/terminal/payments/connect-reader)
|
6
9
|
class Reader < APIResource
|
7
10
|
extend Stripe::APIOperations::Create
|
8
11
|
include Stripe::APIOperations::Delete
|
@@ -10,43 +13,155 @@ module Stripe
|
|
10
13
|
include Stripe::APIOperations::Save
|
11
14
|
|
12
15
|
OBJECT_NAME = "terminal.reader"
|
16
|
+
def self.object_name
|
17
|
+
"terminal.reader"
|
18
|
+
end
|
13
19
|
|
14
|
-
|
15
|
-
custom_method :process_payment_intent, http_verb: :post
|
16
|
-
custom_method :process_setup_intent, http_verb: :post
|
17
|
-
custom_method :set_reader_display, http_verb: :post
|
18
|
-
|
20
|
+
# Cancels the current reader action.
|
19
21
|
def cancel_action(params = {}, opts = {})
|
20
22
|
request_stripe_object(
|
21
23
|
method: :post,
|
22
|
-
path:
|
24
|
+
path: format("/v1/terminal/readers/%<reader>s/cancel_action", { reader: CGI.escape(self["id"]) }),
|
23
25
|
params: params,
|
24
26
|
opts: opts
|
25
27
|
)
|
26
28
|
end
|
27
29
|
|
30
|
+
# Cancels the current reader action.
|
31
|
+
def self.cancel_action(reader, params = {}, opts = {})
|
32
|
+
request_stripe_object(
|
33
|
+
method: :post,
|
34
|
+
path: format("/v1/terminal/readers/%<reader>s/cancel_action", { reader: CGI.escape(reader) }),
|
35
|
+
params: params,
|
36
|
+
opts: opts
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Creates a new Reader object.
|
41
|
+
def self.create(params = {}, opts = {})
|
42
|
+
request_stripe_object(
|
43
|
+
method: :post,
|
44
|
+
path: "/v1/terminal/readers",
|
45
|
+
params: params,
|
46
|
+
opts: opts
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Deletes a Reader object.
|
51
|
+
def self.delete(reader, params = {}, opts = {})
|
52
|
+
request_stripe_object(
|
53
|
+
method: :delete,
|
54
|
+
path: format("/v1/terminal/readers/%<reader>s", { reader: CGI.escape(reader) }),
|
55
|
+
params: params,
|
56
|
+
opts: opts
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Deletes a Reader object.
|
61
|
+
def delete(params = {}, opts = {})
|
62
|
+
request_stripe_object(
|
63
|
+
method: :delete,
|
64
|
+
path: format("/v1/terminal/readers/%<reader>s", { reader: CGI.escape(self["id"]) }),
|
65
|
+
params: params,
|
66
|
+
opts: opts
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Returns a list of Reader objects.
|
71
|
+
def self.list(params = {}, opts = {})
|
72
|
+
request_stripe_object(
|
73
|
+
method: :get,
|
74
|
+
path: "/v1/terminal/readers",
|
75
|
+
params: params,
|
76
|
+
opts: opts
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Initiates a payment flow on a Reader.
|
28
81
|
def process_payment_intent(params = {}, opts = {})
|
29
82
|
request_stripe_object(
|
30
83
|
method: :post,
|
31
|
-
path:
|
84
|
+
path: format("/v1/terminal/readers/%<reader>s/process_payment_intent", { reader: CGI.escape(self["id"]) }),
|
85
|
+
params: params,
|
86
|
+
opts: opts
|
87
|
+
)
|
88
|
+
end
|
89
|
+
|
90
|
+
# Initiates a payment flow on a Reader.
|
91
|
+
def self.process_payment_intent(reader, params = {}, opts = {})
|
92
|
+
request_stripe_object(
|
93
|
+
method: :post,
|
94
|
+
path: format("/v1/terminal/readers/%<reader>s/process_payment_intent", { reader: CGI.escape(reader) }),
|
32
95
|
params: params,
|
33
96
|
opts: opts
|
34
97
|
)
|
35
98
|
end
|
36
99
|
|
100
|
+
# Initiates a setup intent flow on a Reader.
|
37
101
|
def process_setup_intent(params = {}, opts = {})
|
38
102
|
request_stripe_object(
|
39
103
|
method: :post,
|
40
|
-
path:
|
104
|
+
path: format("/v1/terminal/readers/%<reader>s/process_setup_intent", { reader: CGI.escape(self["id"]) }),
|
41
105
|
params: params,
|
42
106
|
opts: opts
|
43
107
|
)
|
44
108
|
end
|
45
109
|
|
110
|
+
# Initiates a setup intent flow on a Reader.
|
111
|
+
def self.process_setup_intent(reader, params = {}, opts = {})
|
112
|
+
request_stripe_object(
|
113
|
+
method: :post,
|
114
|
+
path: format("/v1/terminal/readers/%<reader>s/process_setup_intent", { reader: CGI.escape(reader) }),
|
115
|
+
params: params,
|
116
|
+
opts: opts
|
117
|
+
)
|
118
|
+
end
|
119
|
+
|
120
|
+
# Initiates a refund on a Reader
|
121
|
+
def refund_payment(params = {}, opts = {})
|
122
|
+
request_stripe_object(
|
123
|
+
method: :post,
|
124
|
+
path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(self["id"]) }),
|
125
|
+
params: params,
|
126
|
+
opts: opts
|
127
|
+
)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Initiates a refund on a Reader
|
131
|
+
def self.refund_payment(reader, params = {}, opts = {})
|
132
|
+
request_stripe_object(
|
133
|
+
method: :post,
|
134
|
+
path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(reader) }),
|
135
|
+
params: params,
|
136
|
+
opts: opts
|
137
|
+
)
|
138
|
+
end
|
139
|
+
|
140
|
+
# Sets reader display to show cart details.
|
46
141
|
def set_reader_display(params = {}, opts = {})
|
47
142
|
request_stripe_object(
|
48
143
|
method: :post,
|
49
|
-
path:
|
144
|
+
path: format("/v1/terminal/readers/%<reader>s/set_reader_display", { reader: CGI.escape(self["id"]) }),
|
145
|
+
params: params,
|
146
|
+
opts: opts
|
147
|
+
)
|
148
|
+
end
|
149
|
+
|
150
|
+
# Sets reader display to show cart details.
|
151
|
+
def self.set_reader_display(reader, params = {}, opts = {})
|
152
|
+
request_stripe_object(
|
153
|
+
method: :post,
|
154
|
+
path: format("/v1/terminal/readers/%<reader>s/set_reader_display", { reader: CGI.escape(reader) }),
|
155
|
+
params: params,
|
156
|
+
opts: opts
|
157
|
+
)
|
158
|
+
end
|
159
|
+
|
160
|
+
# Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
161
|
+
def self.update(reader, params = {}, opts = {})
|
162
|
+
request_stripe_object(
|
163
|
+
method: :post,
|
164
|
+
path: format("/v1/terminal/readers/%<reader>s", { reader: CGI.escape(reader) }),
|
50
165
|
params: params,
|
51
166
|
opts: opts
|
52
167
|
)
|
@@ -58,13 +173,25 @@ module Stripe
|
|
58
173
|
|
59
174
|
class TestHelpers < APIResourceTestHelpers
|
60
175
|
RESOURCE_CLASS = Reader
|
176
|
+
def self.resource_class
|
177
|
+
"Reader"
|
178
|
+
end
|
61
179
|
|
62
|
-
|
180
|
+
# Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
|
181
|
+
def self.present_payment_method(reader, params = {}, opts = {})
|
182
|
+
request_stripe_object(
|
183
|
+
method: :post,
|
184
|
+
path: format("/v1/test_helpers/terminal/readers/%<reader>s/present_payment_method", { reader: CGI.escape(reader) }),
|
185
|
+
params: params,
|
186
|
+
opts: opts
|
187
|
+
)
|
188
|
+
end
|
63
189
|
|
190
|
+
# Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
|
64
191
|
def present_payment_method(params = {}, opts = {})
|
65
192
|
@resource.request_stripe_object(
|
66
193
|
method: :post,
|
67
|
-
path:
|
194
|
+
path: format("/v1/test_helpers/terminal/readers/%<reader>s/present_payment_method", { reader: CGI.escape(@resource["id"]) }),
|
68
195
|
params: params,
|
69
196
|
opts: opts
|
70
197
|
)
|
@@ -3,19 +3,74 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module TestHelpers
|
6
|
+
# A test clock enables deterministic control over objects in testmode. With a test clock, you can create
|
7
|
+
# objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances,
|
8
|
+
# you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time.
|
6
9
|
class TestClock < APIResource
|
7
10
|
extend Stripe::APIOperations::Create
|
8
11
|
include Stripe::APIOperations::Delete
|
9
12
|
extend Stripe::APIOperations::List
|
10
13
|
|
11
14
|
OBJECT_NAME = "test_helpers.test_clock"
|
15
|
+
def self.object_name
|
16
|
+
"test_helpers.test_clock"
|
17
|
+
end
|
12
18
|
|
13
|
-
|
14
|
-
|
19
|
+
# Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready.
|
15
20
|
def advance(params = {}, opts = {})
|
16
21
|
request_stripe_object(
|
17
22
|
method: :post,
|
18
|
-
path:
|
23
|
+
path: format("/v1/test_helpers/test_clocks/%<test_clock>s/advance", { test_clock: CGI.escape(self["id"]) }),
|
24
|
+
params: params,
|
25
|
+
opts: opts
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready.
|
30
|
+
def self.advance(test_clock, params = {}, opts = {})
|
31
|
+
request_stripe_object(
|
32
|
+
method: :post,
|
33
|
+
path: format("/v1/test_helpers/test_clocks/%<test_clock>s/advance", { test_clock: CGI.escape(test_clock) }),
|
34
|
+
params: params,
|
35
|
+
opts: opts
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Creates a new test clock that can be attached to new customers and quotes.
|
40
|
+
def self.create(params = {}, opts = {})
|
41
|
+
request_stripe_object(
|
42
|
+
method: :post,
|
43
|
+
path: "/v1/test_helpers/test_clocks",
|
44
|
+
params: params,
|
45
|
+
opts: opts
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Deletes a test clock.
|
50
|
+
def self.delete(test_clock, params = {}, opts = {})
|
51
|
+
request_stripe_object(
|
52
|
+
method: :delete,
|
53
|
+
path: format("/v1/test_helpers/test_clocks/%<test_clock>s", { test_clock: CGI.escape(test_clock) }),
|
54
|
+
params: params,
|
55
|
+
opts: opts
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Deletes a test clock.
|
60
|
+
def delete(params = {}, opts = {})
|
61
|
+
request_stripe_object(
|
62
|
+
method: :delete,
|
63
|
+
path: format("/v1/test_helpers/test_clocks/%<test_clock>s", { test_clock: CGI.escape(self["id"]) }),
|
64
|
+
params: params,
|
65
|
+
opts: opts
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Returns a list of your test clocks.
|
70
|
+
def self.list(params = {}, opts = {})
|
71
|
+
request_stripe_object(
|
72
|
+
method: :get,
|
73
|
+
path: "/v1/test_helpers/test_clocks",
|
19
74
|
params: params,
|
20
75
|
opts: opts
|
21
76
|
)
|
@@ -2,9 +2,38 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Tokenization is the process Stripe uses to collect sensitive card or bank
|
6
|
+
# account details, or personally identifiable information (PII), directly from
|
7
|
+
# your customers in a secure manner. A token representing this information is
|
8
|
+
# returned to your server to use. Use our
|
9
|
+
# [recommended payments integrations](https://stripe.com/docs/payments) to perform this process
|
10
|
+
# on the client-side. This guarantees that no sensitive card data touches your server,
|
11
|
+
# and allows your integration to operate in a PCI-compliant way.
|
12
|
+
#
|
13
|
+
# If you can't use client-side tokenization, you can also create tokens using
|
14
|
+
# the API with either your publishable or secret API key. If
|
15
|
+
# your integration uses this method, you're responsible for any PCI compliance
|
16
|
+
# that it might require, and you must keep your secret API key safe. Unlike with
|
17
|
+
# client-side tokenization, your customer's information isn't sent directly to
|
18
|
+
# Stripe, so we can't determine how it's handled or stored.
|
19
|
+
#
|
20
|
+
# You can't store or use tokens more than once. To store card or bank account
|
21
|
+
# information for later use, create [Customer](https://stripe.com/docs/api#customers)
|
22
|
+
# objects or [External accounts](https://stripe.com/api#external_accounts).
|
23
|
+
# [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection,
|
24
|
+
# performs best with integrations that use client-side tokenization.
|
5
25
|
class Token < APIResource
|
6
26
|
extend Stripe::APIOperations::Create
|
7
27
|
|
8
28
|
OBJECT_NAME = "token"
|
29
|
+
def self.object_name
|
30
|
+
"token"
|
31
|
+
end
|
32
|
+
|
33
|
+
# Creates a single-use token that represents a bank account's details.
|
34
|
+
# You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts.
|
35
|
+
def self.create(params = {}, opts = {})
|
36
|
+
request_stripe_object(method: :post, path: "/v1/tokens", params: params, opts: opts)
|
37
|
+
end
|
9
38
|
end
|
10
39
|
end
|
@@ -2,19 +2,56 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# To top up your Stripe balance, you create a top-up object. You can retrieve
|
6
|
+
# individual top-ups, as well as list all top-ups. Top-ups are identified by a
|
7
|
+
# unique, random ID.
|
8
|
+
#
|
9
|
+
# Related guide: [Topping up your platform account](https://stripe.com/docs/connect/top-ups)
|
5
10
|
class Topup < APIResource
|
6
11
|
extend Stripe::APIOperations::Create
|
7
12
|
extend Stripe::APIOperations::List
|
8
13
|
include Stripe::APIOperations::Save
|
9
14
|
|
10
15
|
OBJECT_NAME = "topup"
|
16
|
+
def self.object_name
|
17
|
+
"topup"
|
18
|
+
end
|
11
19
|
|
12
|
-
|
13
|
-
|
20
|
+
# Cancels a top-up. Only pending top-ups can be canceled.
|
14
21
|
def cancel(params = {}, opts = {})
|
15
22
|
request_stripe_object(
|
16
23
|
method: :post,
|
17
|
-
path:
|
24
|
+
path: format("/v1/topups/%<topup>s/cancel", { topup: CGI.escape(self["id"]) }),
|
25
|
+
params: params,
|
26
|
+
opts: opts
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Cancels a top-up. Only pending top-ups can be canceled.
|
31
|
+
def self.cancel(topup, params = {}, opts = {})
|
32
|
+
request_stripe_object(
|
33
|
+
method: :post,
|
34
|
+
path: format("/v1/topups/%<topup>s/cancel", { topup: CGI.escape(topup) }),
|
35
|
+
params: params,
|
36
|
+
opts: opts
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Top up the balance of an account
|
41
|
+
def self.create(params = {}, opts = {})
|
42
|
+
request_stripe_object(method: :post, path: "/v1/topups", params: params, opts: opts)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Returns a list of top-ups.
|
46
|
+
def self.list(params = {}, opts = {})
|
47
|
+
request_stripe_object(method: :get, path: "/v1/topups", params: params, opts: opts)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Updates the metadata of a top-up. Other top-up details are not editable by design.
|
51
|
+
def self.update(topup, params = {}, opts = {})
|
52
|
+
request_stripe_object(
|
53
|
+
method: :post,
|
54
|
+
path: format("/v1/topups/%<topup>s", { topup: CGI.escape(topup) }),
|
18
55
|
params: params,
|
19
56
|
opts: opts
|
20
57
|
)
|
@@ -2,23 +2,46 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A `Transfer` object is created when you move funds between Stripe accounts as
|
6
|
+
# part of Connect.
|
7
|
+
#
|
8
|
+
# Before April 6, 2017, transfers also represented movement of funds from a
|
9
|
+
# Stripe account to a card or bank account. This behavior has since been split
|
10
|
+
# out into a [Payout](https://stripe.com/docs/api#payout_object) object, with corresponding payout endpoints. For more
|
11
|
+
# information, read about the
|
12
|
+
# [transfer/payout split](https://stripe.com/docs/transfer-payout-split).
|
13
|
+
#
|
14
|
+
# Related guide: [Creating separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers)
|
5
15
|
class Transfer < APIResource
|
6
16
|
extend Stripe::APIOperations::Create
|
7
17
|
extend Stripe::APIOperations::List
|
8
|
-
include Stripe::APIOperations::Save
|
9
18
|
extend Stripe::APIOperations::NestedResource
|
19
|
+
include Stripe::APIOperations::Save
|
10
20
|
|
11
21
|
OBJECT_NAME = "transfer"
|
22
|
+
def self.object_name
|
23
|
+
"transfer"
|
24
|
+
end
|
12
25
|
|
13
|
-
|
26
|
+
nested_resource_class_methods :reversal, operations: %i[create retrieve update list]
|
14
27
|
|
15
|
-
|
16
|
-
|
28
|
+
# To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error.
|
29
|
+
def self.create(params = {}, opts = {})
|
30
|
+
request_stripe_object(method: :post, path: "/v1/transfers", params: params, opts: opts)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first.
|
34
|
+
def self.list(params = {}, opts = {})
|
35
|
+
request_stripe_object(method: :get, path: "/v1/transfers", params: params, opts: opts)
|
36
|
+
end
|
17
37
|
|
18
|
-
|
38
|
+
# Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
39
|
+
#
|
40
|
+
# This request accepts only metadata as an argument.
|
41
|
+
def self.update(transfer, params = {}, opts = {})
|
19
42
|
request_stripe_object(
|
20
43
|
method: :post,
|
21
|
-
path:
|
44
|
+
path: format("/v1/transfers/%<transfer>s", { transfer: CGI.escape(transfer) }),
|
22
45
|
params: params,
|
23
46
|
opts: opts
|
24
47
|
)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.
|
7
|
+
class CreditReversal < APIResource
|
8
|
+
extend Stripe::APIOperations::Create
|
9
|
+
extend Stripe::APIOperations::List
|
10
|
+
|
11
|
+
OBJECT_NAME = "treasury.credit_reversal"
|
12
|
+
def self.object_name
|
13
|
+
"treasury.credit_reversal"
|
14
|
+
end
|
15
|
+
|
16
|
+
# Reverses a ReceivedCredit and creates a CreditReversal object.
|
17
|
+
def self.create(params = {}, opts = {})
|
18
|
+
request_stripe_object(
|
19
|
+
method: :post,
|
20
|
+
path: "/v1/treasury/credit_reversals",
|
21
|
+
params: params,
|
22
|
+
opts: opts
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns a list of CreditReversals.
|
27
|
+
def self.list(params = {}, opts = {})
|
28
|
+
request_stripe_object(
|
29
|
+
method: :get,
|
30
|
+
path: "/v1/treasury/credit_reversals",
|
31
|
+
params: params,
|
32
|
+
opts: opts
|
33
|
+
)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal.
|
7
|
+
class DebitReversal < APIResource
|
8
|
+
extend Stripe::APIOperations::Create
|
9
|
+
extend Stripe::APIOperations::List
|
10
|
+
|
11
|
+
OBJECT_NAME = "treasury.debit_reversal"
|
12
|
+
def self.object_name
|
13
|
+
"treasury.debit_reversal"
|
14
|
+
end
|
15
|
+
|
16
|
+
# Reverses a ReceivedDebit and creates a DebitReversal object.
|
17
|
+
def self.create(params = {}, opts = {})
|
18
|
+
request_stripe_object(
|
19
|
+
method: :post,
|
20
|
+
path: "/v1/treasury/debit_reversals",
|
21
|
+
params: params,
|
22
|
+
opts: opts
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns a list of DebitReversals.
|
27
|
+
def self.list(params = {}, opts = {})
|
28
|
+
request_stripe_object(
|
29
|
+
method: :get,
|
30
|
+
path: "/v1/treasury/debit_reversals",
|
31
|
+
params: params,
|
32
|
+
opts: opts
|
33
|
+
)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance.
|
7
|
+
# FinancialAccounts serve as the source and destination of Treasury's money movement APIs.
|
8
|
+
class FinancialAccount < APIResource
|
9
|
+
extend Stripe::APIOperations::Create
|
10
|
+
extend Stripe::APIOperations::List
|
11
|
+
include Stripe::APIOperations::Save
|
12
|
+
|
13
|
+
OBJECT_NAME = "treasury.financial_account"
|
14
|
+
def self.object_name
|
15
|
+
"treasury.financial_account"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards.
|
19
|
+
def close(params = {}, opts = {})
|
20
|
+
request_stripe_object(
|
21
|
+
method: :post,
|
22
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/close", { financial_account: CGI.escape(self["id"]) }),
|
23
|
+
params: params,
|
24
|
+
opts: opts
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards.
|
29
|
+
def self.close(financial_account, params = {}, opts = {})
|
30
|
+
request_stripe_object(
|
31
|
+
method: :post,
|
32
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/close", { financial_account: CGI.escape(financial_account) }),
|
33
|
+
params: params,
|
34
|
+
opts: opts
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount.
|
39
|
+
def self.create(params = {}, opts = {})
|
40
|
+
request_stripe_object(
|
41
|
+
method: :post,
|
42
|
+
path: "/v1/treasury/financial_accounts",
|
43
|
+
params: params,
|
44
|
+
opts: opts
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns a list of FinancialAccounts.
|
49
|
+
def self.list(params = {}, opts = {})
|
50
|
+
request_stripe_object(
|
51
|
+
method: :get,
|
52
|
+
path: "/v1/treasury/financial_accounts",
|
53
|
+
params: params,
|
54
|
+
opts: opts
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Retrieves Features information associated with the FinancialAccount.
|
59
|
+
def retrieve_features(params = {}, opts = {})
|
60
|
+
request_stripe_object(
|
61
|
+
method: :get,
|
62
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(self["id"]) }),
|
63
|
+
params: params,
|
64
|
+
opts: opts
|
65
|
+
)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Retrieves Features information associated with the FinancialAccount.
|
69
|
+
def self.retrieve_features(financial_account, params = {}, opts = {})
|
70
|
+
request_stripe_object(
|
71
|
+
method: :get,
|
72
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(financial_account) }),
|
73
|
+
params: params,
|
74
|
+
opts: opts
|
75
|
+
)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Updates the details of a FinancialAccount.
|
79
|
+
def self.update(financial_account, params = {}, opts = {})
|
80
|
+
request_stripe_object(
|
81
|
+
method: :post,
|
82
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s", { financial_account: CGI.escape(financial_account) }),
|
83
|
+
params: params,
|
84
|
+
opts: opts
|
85
|
+
)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Updates the Features associated with a FinancialAccount.
|
89
|
+
def update_features(params = {}, opts = {})
|
90
|
+
request_stripe_object(
|
91
|
+
method: :post,
|
92
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(self["id"]) }),
|
93
|
+
params: params,
|
94
|
+
opts: opts
|
95
|
+
)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Updates the Features associated with a FinancialAccount.
|
99
|
+
def self.update_features(financial_account, params = {}, opts = {})
|
100
|
+
request_stripe_object(
|
101
|
+
method: :post,
|
102
|
+
path: format("/v1/treasury/financial_accounts/%<financial_account>s/features", { financial_account: CGI.escape(financial_account) }),
|
103
|
+
params: params,
|
104
|
+
opts: opts
|
105
|
+
)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Treasury
|
6
|
+
# Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`.
|
7
|
+
# Stripe or the platform can control Features via the requested field.
|
8
|
+
class FinancialAccountFeatures < APIResource
|
9
|
+
OBJECT_NAME = "treasury.financial_account_features"
|
10
|
+
def self.object_name
|
11
|
+
"treasury.financial_account_features"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|