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
@@ -0,0 +1,48 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Tax
|
6
|
+
# A Tax Calculation allows you to calculate the tax to collect from your customer.
|
7
|
+
#
|
8
|
+
# Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom)
|
9
|
+
class Calculation < APIResource
|
10
|
+
extend Stripe::APIOperations::Create
|
11
|
+
|
12
|
+
OBJECT_NAME = "tax.calculation"
|
13
|
+
def self.object_name
|
14
|
+
"tax.calculation"
|
15
|
+
end
|
16
|
+
|
17
|
+
# Calculates tax based on the input and returns a Tax Calculation object.
|
18
|
+
def self.create(params = {}, opts = {})
|
19
|
+
request_stripe_object(
|
20
|
+
method: :post,
|
21
|
+
path: "/v1/tax/calculations",
|
22
|
+
params: params,
|
23
|
+
opts: opts
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired.
|
28
|
+
def list_line_items(params = {}, opts = {})
|
29
|
+
request_stripe_object(
|
30
|
+
method: :get,
|
31
|
+
path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(self["id"]) }),
|
32
|
+
params: params,
|
33
|
+
opts: opts
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired.
|
38
|
+
def self.list_line_items(calculation, params = {}, opts = {})
|
39
|
+
request_stripe_object(
|
40
|
+
method: :get,
|
41
|
+
path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(calculation) }),
|
42
|
+
params: params,
|
43
|
+
opts: opts
|
44
|
+
)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Tax
|
6
|
+
class CalculationLineItem < APIResource
|
7
|
+
OBJECT_NAME = "tax.calculation_line_item"
|
8
|
+
def self.object_name
|
9
|
+
"tax.calculation_line_item"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Tax
|
6
|
+
# A Tax `Registration` lets us know that your business is registered to collect tax on payments within a region, enabling you to [automatically collect tax](https://stripe.com/docs/tax).
|
7
|
+
#
|
8
|
+
# Stripe doesn't register on your behalf with the relevant authorities when you create a Tax `Registration` object. For more information on how to register to collect tax, see [our guide](https://stripe.com/docs/tax/registering).
|
9
|
+
#
|
10
|
+
# Related guide: [Using the Registrations API](https://stripe.com/docs/tax/registrations-api)
|
11
|
+
class Registration < APIResource
|
12
|
+
extend Stripe::APIOperations::Create
|
13
|
+
extend Stripe::APIOperations::List
|
14
|
+
include Stripe::APIOperations::Save
|
15
|
+
|
16
|
+
OBJECT_NAME = "tax.registration"
|
17
|
+
def self.object_name
|
18
|
+
"tax.registration"
|
19
|
+
end
|
20
|
+
|
21
|
+
# Creates a new Tax Registration object.
|
22
|
+
def self.create(params = {}, opts = {})
|
23
|
+
request_stripe_object(
|
24
|
+
method: :post,
|
25
|
+
path: "/v1/tax/registrations",
|
26
|
+
params: params,
|
27
|
+
opts: opts
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns a list of Tax Registration objects.
|
32
|
+
def self.list(params = {}, opts = {})
|
33
|
+
request_stripe_object(
|
34
|
+
method: :get,
|
35
|
+
path: "/v1/tax/registrations",
|
36
|
+
params: params,
|
37
|
+
opts: opts
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Updates an existing Tax Registration object.
|
42
|
+
#
|
43
|
+
# A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at.
|
44
|
+
def self.update(id, params = {}, opts = {})
|
45
|
+
request_stripe_object(
|
46
|
+
method: :post,
|
47
|
+
path: format("/v1/tax/registrations/%<id>s", { id: CGI.escape(id) }),
|
48
|
+
params: params,
|
49
|
+
opts: opts
|
50
|
+
)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Tax
|
6
|
+
# You can use Tax `Settings` to manage configurations used by Stripe Tax calculations.
|
7
|
+
#
|
8
|
+
# Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api)
|
9
|
+
class Settings < SingletonAPIResource
|
10
|
+
include Stripe::APIOperations::SingletonSave
|
11
|
+
OBJECT_NAME = "tax.settings"
|
12
|
+
def self.object_name
|
13
|
+
"tax.settings"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Tax
|
6
|
+
# A Tax Transaction records the tax collected from or refunded to your customer.
|
7
|
+
#
|
8
|
+
# Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom#tax-transaction)
|
9
|
+
class Transaction < APIResource
|
10
|
+
OBJECT_NAME = "tax.transaction"
|
11
|
+
def self.object_name
|
12
|
+
"tax.transaction"
|
13
|
+
end
|
14
|
+
|
15
|
+
# Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days.
|
16
|
+
def self.create_from_calculation(params = {}, opts = {})
|
17
|
+
request_stripe_object(
|
18
|
+
method: :post,
|
19
|
+
path: "/v1/tax/transactions/create_from_calculation",
|
20
|
+
params: params,
|
21
|
+
opts: opts
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Partially or fully reverses a previously created Transaction.
|
26
|
+
def self.create_reversal(params = {}, opts = {})
|
27
|
+
request_stripe_object(
|
28
|
+
method: :post,
|
29
|
+
path: "/v1/tax/transactions/create_reversal",
|
30
|
+
params: params,
|
31
|
+
opts: opts
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Retrieves the line items of a committed standalone transaction as a collection.
|
36
|
+
def list_line_items(params = {}, opts = {})
|
37
|
+
request_stripe_object(
|
38
|
+
method: :get,
|
39
|
+
path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(self["id"]) }),
|
40
|
+
params: params,
|
41
|
+
opts: opts
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Retrieves the line items of a committed standalone transaction as a collection.
|
46
|
+
def self.list_line_items(transaction, params = {}, opts = {})
|
47
|
+
request_stripe_object(
|
48
|
+
method: :get,
|
49
|
+
path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(transaction) }),
|
50
|
+
params: params,
|
51
|
+
opts: opts
|
52
|
+
)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Tax
|
6
|
+
class TransactionLineItem < APIResource
|
7
|
+
OBJECT_NAME = "tax.transaction_line_item"
|
8
|
+
def self.object_name
|
9
|
+
"tax.transaction_line_item"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -2,9 +2,18 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# [Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes.
|
5
6
|
class TaxCode < APIResource
|
6
7
|
extend Stripe::APIOperations::List
|
7
8
|
|
8
9
|
OBJECT_NAME = "tax_code"
|
10
|
+
def self.object_name
|
11
|
+
"tax_code"
|
12
|
+
end
|
13
|
+
|
14
|
+
# A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations.
|
15
|
+
def self.list(params = {}, opts = {})
|
16
|
+
request_stripe_object(method: :get, path: "/v1/tax_codes", params: params, opts: opts)
|
17
|
+
end
|
9
18
|
end
|
10
19
|
end
|
@@ -2,26 +2,48 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account.
|
6
|
+
# Customer and account tax IDs get displayed on related invoices and credit notes.
|
7
|
+
#
|
8
|
+
# Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids)
|
5
9
|
class TaxId < APIResource
|
10
|
+
extend Stripe::APIOperations::Create
|
6
11
|
include Stripe::APIOperations::Delete
|
7
12
|
extend Stripe::APIOperations::List
|
8
13
|
|
9
14
|
OBJECT_NAME = "tax_id"
|
15
|
+
def self.object_name
|
16
|
+
"tax_id"
|
17
|
+
end
|
18
|
+
|
19
|
+
# Creates a new account or customer tax_id object.
|
20
|
+
def self.create(params = {}, opts = {})
|
21
|
+
request_stripe_object(method: :post, path: "/v1/tax_ids", params: params, opts: opts)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Deletes an existing account or customer tax_id object.
|
25
|
+
def self.delete(id, params = {}, opts = {})
|
26
|
+
request_stripe_object(
|
27
|
+
method: :delete,
|
28
|
+
path: format("/v1/tax_ids/%<id>s", { id: CGI.escape(id) }),
|
29
|
+
params: params,
|
30
|
+
opts: opts
|
31
|
+
)
|
32
|
+
end
|
10
33
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
34
|
+
# Deletes an existing account or customer tax_id object.
|
35
|
+
def delete(params = {}, opts = {})
|
36
|
+
request_stripe_object(
|
37
|
+
method: :delete,
|
38
|
+
path: format("/v1/tax_ids/%<id>s", { id: CGI.escape(self["id"]) }),
|
39
|
+
params: params,
|
40
|
+
opts: opts
|
41
|
+
)
|
18
42
|
end
|
19
43
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"tax ID using `Customer.retrieve_tax_id('customer_id', " \
|
24
|
-
"'tax_id_id')`"
|
44
|
+
# Returns a list of tax IDs.
|
45
|
+
def self.list(params = {}, opts = {})
|
46
|
+
request_stripe_object(method: :get, path: "/v1/tax_ids", params: params, opts: opts)
|
25
47
|
end
|
26
48
|
end
|
27
49
|
end
|
@@ -2,11 +2,37 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Tax rates can be applied to [invoices](https://stripe.com/invoicing/taxes/tax-rates), [subscriptions](https://stripe.com/billing/taxes/tax-rates) and [Checkout Sessions](https://stripe.com/payments/checkout/use-manual-tax-rates) to collect tax.
|
6
|
+
#
|
7
|
+
# Related guide: [Tax rates](https://stripe.com/billing/taxes/tax-rates)
|
5
8
|
class TaxRate < APIResource
|
6
9
|
extend Stripe::APIOperations::Create
|
7
10
|
extend Stripe::APIOperations::List
|
8
11
|
include Stripe::APIOperations::Save
|
9
12
|
|
10
13
|
OBJECT_NAME = "tax_rate"
|
14
|
+
def self.object_name
|
15
|
+
"tax_rate"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Creates a new tax rate.
|
19
|
+
def self.create(params = {}, opts = {})
|
20
|
+
request_stripe_object(method: :post, path: "/v1/tax_rates", params: params, opts: opts)
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.
|
24
|
+
def self.list(params = {}, opts = {})
|
25
|
+
request_stripe_object(method: :get, path: "/v1/tax_rates", params: params, opts: opts)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Updates an existing tax rate.
|
29
|
+
def self.update(tax_rate, params = {}, opts = {})
|
30
|
+
request_stripe_object(
|
31
|
+
method: :post,
|
32
|
+
path: format("/v1/tax_rates/%<tax_rate>s", { tax_rate: CGI.escape(tax_rate) }),
|
33
|
+
params: params,
|
34
|
+
opts: opts
|
35
|
+
)
|
36
|
+
end
|
11
37
|
end
|
12
38
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Terminal
|
6
|
+
# A Configurations object represents how features should be configured for terminal readers.
|
6
7
|
class Configuration < APIResource
|
7
8
|
extend Stripe::APIOperations::Create
|
8
9
|
include Stripe::APIOperations::Delete
|
@@ -10,6 +11,59 @@ module Stripe
|
|
10
11
|
include Stripe::APIOperations::Save
|
11
12
|
|
12
13
|
OBJECT_NAME = "terminal.configuration"
|
14
|
+
def self.object_name
|
15
|
+
"terminal.configuration"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Creates a new Configuration object.
|
19
|
+
def self.create(params = {}, opts = {})
|
20
|
+
request_stripe_object(
|
21
|
+
method: :post,
|
22
|
+
path: "/v1/terminal/configurations",
|
23
|
+
params: params,
|
24
|
+
opts: opts
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Deletes a Configuration object.
|
29
|
+
def self.delete(configuration, params = {}, opts = {})
|
30
|
+
request_stripe_object(
|
31
|
+
method: :delete,
|
32
|
+
path: format("/v1/terminal/configurations/%<configuration>s", { configuration: CGI.escape(configuration) }),
|
33
|
+
params: params,
|
34
|
+
opts: opts
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Deletes a Configuration object.
|
39
|
+
def delete(params = {}, opts = {})
|
40
|
+
request_stripe_object(
|
41
|
+
method: :delete,
|
42
|
+
path: format("/v1/terminal/configurations/%<configuration>s", { configuration: CGI.escape(self["id"]) }),
|
43
|
+
params: params,
|
44
|
+
opts: opts
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns a list of Configuration objects.
|
49
|
+
def self.list(params = {}, opts = {})
|
50
|
+
request_stripe_object(
|
51
|
+
method: :get,
|
52
|
+
path: "/v1/terminal/configurations",
|
53
|
+
params: params,
|
54
|
+
opts: opts
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Updates a new Configuration object.
|
59
|
+
def self.update(configuration, params = {}, opts = {})
|
60
|
+
request_stripe_object(
|
61
|
+
method: :post,
|
62
|
+
path: format("/v1/terminal/configurations/%<configuration>s", { configuration: CGI.escape(configuration) }),
|
63
|
+
params: params,
|
64
|
+
opts: opts
|
65
|
+
)
|
66
|
+
end
|
13
67
|
end
|
14
68
|
end
|
15
69
|
end
|
@@ -3,10 +3,26 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Terminal
|
6
|
+
# A Connection Token is used by the Stripe Terminal SDK to connect to a reader.
|
7
|
+
#
|
8
|
+
# Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations)
|
6
9
|
class ConnectionToken < APIResource
|
7
10
|
extend Stripe::APIOperations::Create
|
8
11
|
|
9
12
|
OBJECT_NAME = "terminal.connection_token"
|
13
|
+
def self.object_name
|
14
|
+
"terminal.connection_token"
|
15
|
+
end
|
16
|
+
|
17
|
+
# To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token.
|
18
|
+
def self.create(params = {}, opts = {})
|
19
|
+
request_stripe_object(
|
20
|
+
method: :post,
|
21
|
+
path: "/v1/terminal/connection_tokens",
|
22
|
+
params: params,
|
23
|
+
opts: opts
|
24
|
+
)
|
25
|
+
end
|
10
26
|
end
|
11
27
|
end
|
12
28
|
end
|
@@ -3,6 +3,9 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Terminal
|
6
|
+
# A Location represents a grouping of readers.
|
7
|
+
#
|
8
|
+
# Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations)
|
6
9
|
class Location < APIResource
|
7
10
|
extend Stripe::APIOperations::Create
|
8
11
|
include Stripe::APIOperations::Delete
|
@@ -10,6 +13,60 @@ module Stripe
|
|
10
13
|
include Stripe::APIOperations::Save
|
11
14
|
|
12
15
|
OBJECT_NAME = "terminal.location"
|
16
|
+
def self.object_name
|
17
|
+
"terminal.location"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Creates a new Location object.
|
21
|
+
# For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide.
|
22
|
+
def self.create(params = {}, opts = {})
|
23
|
+
request_stripe_object(
|
24
|
+
method: :post,
|
25
|
+
path: "/v1/terminal/locations",
|
26
|
+
params: params,
|
27
|
+
opts: opts
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Deletes a Location object.
|
32
|
+
def self.delete(location, params = {}, opts = {})
|
33
|
+
request_stripe_object(
|
34
|
+
method: :delete,
|
35
|
+
path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(location) }),
|
36
|
+
params: params,
|
37
|
+
opts: opts
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Deletes a Location object.
|
42
|
+
def delete(params = {}, opts = {})
|
43
|
+
request_stripe_object(
|
44
|
+
method: :delete,
|
45
|
+
path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(self["id"]) }),
|
46
|
+
params: params,
|
47
|
+
opts: opts
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Returns a list of Location objects.
|
52
|
+
def self.list(params = {}, opts = {})
|
53
|
+
request_stripe_object(
|
54
|
+
method: :get,
|
55
|
+
path: "/v1/terminal/locations",
|
56
|
+
params: params,
|
57
|
+
opts: opts
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
62
|
+
def self.update(location, params = {}, opts = {})
|
63
|
+
request_stripe_object(
|
64
|
+
method: :post,
|
65
|
+
path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(location) }),
|
66
|
+
params: params,
|
67
|
+
opts: opts
|
68
|
+
)
|
69
|
+
end
|
13
70
|
end
|
14
71
|
end
|
15
72
|
end
|