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
@@ -2,104 +2,162 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A Quote is a way to model prices that you'd like to provide to a customer.
|
6
|
+
# Once accepted, it will automatically create an invoice, subscription or subscription schedule.
|
5
7
|
class Quote < APIResource
|
6
8
|
extend Stripe::APIOperations::Create
|
7
9
|
extend Stripe::APIOperations::List
|
8
10
|
include Stripe::APIOperations::Save
|
9
11
|
|
10
12
|
OBJECT_NAME = "quote"
|
13
|
+
def self.object_name
|
14
|
+
"quote"
|
15
|
+
end
|
11
16
|
|
12
|
-
|
13
|
-
custom_method :cancel, http_verb: :post
|
14
|
-
custom_method :finalize_quote, http_verb: :post, http_path: "finalize"
|
15
|
-
custom_method :list_computed_upfront_line_items, http_verb: :get, http_path: "computed_upfront_line_items"
|
16
|
-
custom_method :list_line_items, http_verb: :get, http_path: "line_items"
|
17
|
-
|
17
|
+
# Accepts the specified quote.
|
18
18
|
def accept(params = {}, opts = {})
|
19
19
|
request_stripe_object(
|
20
20
|
method: :post,
|
21
|
-
path:
|
21
|
+
path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(self["id"]) }),
|
22
|
+
params: params,
|
23
|
+
opts: opts
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Accepts the specified quote.
|
28
|
+
def self.accept(quote, params = {}, opts = {})
|
29
|
+
request_stripe_object(
|
30
|
+
method: :post,
|
31
|
+
path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(quote) }),
|
22
32
|
params: params,
|
23
33
|
opts: opts
|
24
34
|
)
|
25
35
|
end
|
26
36
|
|
37
|
+
# Cancels the quote.
|
27
38
|
def cancel(params = {}, opts = {})
|
28
39
|
request_stripe_object(
|
29
40
|
method: :post,
|
30
|
-
path:
|
41
|
+
path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(self["id"]) }),
|
31
42
|
params: params,
|
32
43
|
opts: opts
|
33
44
|
)
|
34
45
|
end
|
35
46
|
|
47
|
+
# Cancels the quote.
|
48
|
+
def self.cancel(quote, params = {}, opts = {})
|
49
|
+
request_stripe_object(
|
50
|
+
method: :post,
|
51
|
+
path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(quote) }),
|
52
|
+
params: params,
|
53
|
+
opts: opts
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
# A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote).
|
58
|
+
def self.create(params = {}, opts = {})
|
59
|
+
request_stripe_object(method: :post, path: "/v1/quotes", params: params, opts: opts)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Finalizes the quote.
|
36
63
|
def finalize_quote(params = {}, opts = {})
|
37
64
|
request_stripe_object(
|
38
65
|
method: :post,
|
39
|
-
path:
|
66
|
+
path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(self["id"]) }),
|
40
67
|
params: params,
|
41
68
|
opts: opts
|
42
69
|
)
|
43
70
|
end
|
44
71
|
|
72
|
+
# Finalizes the quote.
|
73
|
+
def self.finalize_quote(quote, params = {}, opts = {})
|
74
|
+
request_stripe_object(
|
75
|
+
method: :post,
|
76
|
+
path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(quote) }),
|
77
|
+
params: params,
|
78
|
+
opts: opts
|
79
|
+
)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Returns a list of your quotes.
|
83
|
+
def self.list(params = {}, opts = {})
|
84
|
+
request_stripe_object(method: :get, path: "/v1/quotes", params: params, opts: opts)
|
85
|
+
end
|
86
|
+
|
87
|
+
# When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
|
45
88
|
def list_computed_upfront_line_items(params = {}, opts = {})
|
46
89
|
request_stripe_object(
|
47
90
|
method: :get,
|
48
|
-
path:
|
91
|
+
path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(self["id"]) }),
|
49
92
|
params: params,
|
50
93
|
opts: opts
|
51
94
|
)
|
52
95
|
end
|
53
96
|
|
54
|
-
|
97
|
+
# When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
|
98
|
+
def self.list_computed_upfront_line_items(quote, params = {}, opts = {})
|
55
99
|
request_stripe_object(
|
56
100
|
method: :get,
|
57
|
-
path:
|
101
|
+
path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(quote) }),
|
58
102
|
params: params,
|
59
103
|
opts: opts
|
60
104
|
)
|
61
105
|
end
|
62
106
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
107
|
+
# When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
|
108
|
+
def list_line_items(params = {}, opts = {})
|
109
|
+
request_stripe_object(
|
110
|
+
method: :get,
|
111
|
+
path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(self["id"]) }),
|
112
|
+
params: params,
|
113
|
+
opts: opts
|
114
|
+
)
|
115
|
+
end
|
67
116
|
|
68
|
-
|
117
|
+
# When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
|
118
|
+
def self.list_line_items(quote, params = {}, opts = {})
|
119
|
+
request_stripe_object(
|
120
|
+
method: :get,
|
121
|
+
path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(quote) }),
|
122
|
+
params: params,
|
123
|
+
opts: opts
|
124
|
+
)
|
125
|
+
end
|
69
126
|
|
127
|
+
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
|
128
|
+
def pdf(params = {}, opts = {}, &read_body_chunk_block)
|
129
|
+
opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
|
70
130
|
request_stream(
|
71
131
|
method: :get,
|
72
|
-
path:
|
132
|
+
path: format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(self["id"]) }),
|
73
133
|
params: params,
|
74
|
-
opts:
|
75
|
-
|
76
|
-
}.merge(opts),
|
134
|
+
opts: opts,
|
135
|
+
base_address: :files,
|
77
136
|
&read_body_chunk_block
|
78
137
|
)
|
79
138
|
end
|
80
139
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
end
|
86
|
-
|
87
|
-
unless block_given?
|
88
|
-
raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
|
89
|
-
end
|
90
|
-
|
91
|
-
config = opts[:client]&.config || Stripe.config
|
92
|
-
|
93
|
-
resp = execute_resource_request_stream(
|
140
|
+
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
|
141
|
+
def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
142
|
+
opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
|
143
|
+
execute_resource_request_stream(
|
94
144
|
:get,
|
95
|
-
"
|
145
|
+
format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(quote) }),
|
146
|
+
:files,
|
96
147
|
params,
|
97
|
-
|
98
|
-
api_base: config.uploads_base,
|
99
|
-
}.merge(opts),
|
148
|
+
opts,
|
100
149
|
&read_body_chunk_block
|
101
150
|
)
|
102
|
-
|
151
|
+
end
|
152
|
+
|
153
|
+
# A quote models prices and services for a customer.
|
154
|
+
def self.update(quote, params = {}, opts = {})
|
155
|
+
request_stripe_object(
|
156
|
+
method: :post,
|
157
|
+
path: format("/v1/quotes/%<quote>s", { quote: CGI.escape(quote) }),
|
158
|
+
params: params,
|
159
|
+
opts: opts
|
160
|
+
)
|
103
161
|
end
|
104
162
|
end
|
105
163
|
end
|
@@ -3,10 +3,27 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Radar
|
6
|
+
# An early fraud warning indicates that the card issuer has notified us that a
|
7
|
+
# charge may be fraudulent.
|
8
|
+
#
|
9
|
+
# Related guide: [Early fraud warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings)
|
6
10
|
class EarlyFraudWarning < APIResource
|
7
11
|
extend Stripe::APIOperations::List
|
8
12
|
|
9
13
|
OBJECT_NAME = "radar.early_fraud_warning"
|
14
|
+
def self.object_name
|
15
|
+
"radar.early_fraud_warning"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Returns a list of early fraud warnings.
|
19
|
+
def self.list(params = {}, opts = {})
|
20
|
+
request_stripe_object(
|
21
|
+
method: :get,
|
22
|
+
path: "/v1/radar/early_fraud_warnings",
|
23
|
+
params: params,
|
24
|
+
opts: opts
|
25
|
+
)
|
26
|
+
end
|
10
27
|
end
|
11
28
|
end
|
12
29
|
end
|
@@ -3,6 +3,9 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Radar
|
6
|
+
# Value lists allow you to group values together which can then be referenced in rules.
|
7
|
+
#
|
8
|
+
# Related guide: [Default Stripe lists](https://stripe.com/docs/radar/lists#managing-list-items)
|
6
9
|
class ValueList < APIResource
|
7
10
|
extend Stripe::APIOperations::Create
|
8
11
|
include Stripe::APIOperations::Delete
|
@@ -10,6 +13,59 @@ module Stripe
|
|
10
13
|
include Stripe::APIOperations::Save
|
11
14
|
|
12
15
|
OBJECT_NAME = "radar.value_list"
|
16
|
+
def self.object_name
|
17
|
+
"radar.value_list"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Creates a new ValueList object, which can then be referenced in rules.
|
21
|
+
def self.create(params = {}, opts = {})
|
22
|
+
request_stripe_object(
|
23
|
+
method: :post,
|
24
|
+
path: "/v1/radar/value_lists",
|
25
|
+
params: params,
|
26
|
+
opts: opts
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules.
|
31
|
+
def self.delete(value_list, params = {}, opts = {})
|
32
|
+
request_stripe_object(
|
33
|
+
method: :delete,
|
34
|
+
path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(value_list) }),
|
35
|
+
params: params,
|
36
|
+
opts: opts
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules.
|
41
|
+
def delete(params = {}, opts = {})
|
42
|
+
request_stripe_object(
|
43
|
+
method: :delete,
|
44
|
+
path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(self["id"]) }),
|
45
|
+
params: params,
|
46
|
+
opts: opts
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
51
|
+
def self.list(params = {}, opts = {})
|
52
|
+
request_stripe_object(
|
53
|
+
method: :get,
|
54
|
+
path: "/v1/radar/value_lists",
|
55
|
+
params: params,
|
56
|
+
opts: opts
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable.
|
61
|
+
def self.update(value_list, params = {}, opts = {})
|
62
|
+
request_stripe_object(
|
63
|
+
method: :post,
|
64
|
+
path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(value_list) }),
|
65
|
+
params: params,
|
66
|
+
opts: opts
|
67
|
+
)
|
68
|
+
end
|
13
69
|
end
|
14
70
|
end
|
15
71
|
end
|
@@ -3,12 +3,58 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Radar
|
6
|
+
# Value list items allow you to add specific values to a given Radar value list, which can then be used in rules.
|
7
|
+
#
|
8
|
+
# Related guide: [Managing list items](https://stripe.com/docs/radar/lists#managing-list-items)
|
6
9
|
class ValueListItem < 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 = "radar.value_list_item"
|
15
|
+
def self.object_name
|
16
|
+
"radar.value_list_item"
|
17
|
+
end
|
18
|
+
|
19
|
+
# Creates a new ValueListItem object, which is added to the specified parent value list.
|
20
|
+
def self.create(params = {}, opts = {})
|
21
|
+
request_stripe_object(
|
22
|
+
method: :post,
|
23
|
+
path: "/v1/radar/value_list_items",
|
24
|
+
params: params,
|
25
|
+
opts: opts
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Deletes a ValueListItem object, removing it from its parent value list.
|
30
|
+
def self.delete(item, params = {}, opts = {})
|
31
|
+
request_stripe_object(
|
32
|
+
method: :delete,
|
33
|
+
path: format("/v1/radar/value_list_items/%<item>s", { item: CGI.escape(item) }),
|
34
|
+
params: params,
|
35
|
+
opts: opts
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Deletes a ValueListItem object, removing it from its parent value list.
|
40
|
+
def delete(params = {}, opts = {})
|
41
|
+
request_stripe_object(
|
42
|
+
method: :delete,
|
43
|
+
path: format("/v1/radar/value_list_items/%<item>s", { item: CGI.escape(self["id"]) }),
|
44
|
+
params: params,
|
45
|
+
opts: opts
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
50
|
+
def self.list(params = {}, opts = {})
|
51
|
+
request_stripe_object(
|
52
|
+
method: :get,
|
53
|
+
path: "/v1/radar/value_list_items",
|
54
|
+
params: params,
|
55
|
+
opts: opts
|
56
|
+
)
|
57
|
+
end
|
12
58
|
end
|
13
59
|
end
|
14
60
|
end
|
@@ -2,19 +2,72 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Refund objects allow you to refund a previously created charge that isn't
|
6
|
+
# refunded yet. Funds are refunded to the credit or debit card that's
|
7
|
+
# initially charged.
|
8
|
+
#
|
9
|
+
# Related guide: [Refunds](https://stripe.com/docs/refunds)
|
5
10
|
class Refund < 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 = "refund"
|
16
|
+
def self.object_name
|
17
|
+
"refund"
|
18
|
+
end
|
11
19
|
|
12
|
-
|
13
|
-
|
20
|
+
# Cancels a refund with a status of requires_action.
|
21
|
+
#
|
22
|
+
# You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state.
|
14
23
|
def cancel(params = {}, opts = {})
|
15
24
|
request_stripe_object(
|
16
25
|
method: :post,
|
17
|
-
path:
|
26
|
+
path: format("/v1/refunds/%<refund>s/cancel", { refund: CGI.escape(self["id"]) }),
|
27
|
+
params: params,
|
28
|
+
opts: opts
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Cancels a refund with a status of requires_action.
|
33
|
+
#
|
34
|
+
# You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state.
|
35
|
+
def self.cancel(refund, params = {}, opts = {})
|
36
|
+
request_stripe_object(
|
37
|
+
method: :post,
|
38
|
+
path: format("/v1/refunds/%<refund>s/cancel", { refund: CGI.escape(refund) }),
|
39
|
+
params: params,
|
40
|
+
opts: opts
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
# When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.
|
45
|
+
#
|
46
|
+
# Creating a new refund will refund a charge that has previously been created but not yet refunded.
|
47
|
+
# Funds will be refunded to the credit or debit card that was originally charged.
|
48
|
+
#
|
49
|
+
# You can optionally refund only part of a charge.
|
50
|
+
# You can do so multiple times, until the entire charge has been refunded.
|
51
|
+
#
|
52
|
+
# Once entirely refunded, a charge can't be refunded again.
|
53
|
+
# This method will raise an error when called on an already-refunded charge,
|
54
|
+
# or when trying to refund more money than is left on a charge.
|
55
|
+
def self.create(params = {}, opts = {})
|
56
|
+
request_stripe_object(method: :post, path: "/v1/refunds", params: params, opts: opts)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object.
|
60
|
+
def self.list(params = {}, opts = {})
|
61
|
+
request_stripe_object(method: :get, path: "/v1/refunds", params: params, opts: opts)
|
62
|
+
end
|
63
|
+
|
64
|
+
# Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged.
|
65
|
+
#
|
66
|
+
# This request only accepts metadata as an argument.
|
67
|
+
def self.update(refund, params = {}, opts = {})
|
68
|
+
request_stripe_object(
|
69
|
+
method: :post,
|
70
|
+
path: format("/v1/refunds/%<refund>s", { refund: CGI.escape(refund) }),
|
18
71
|
params: params,
|
19
72
|
opts: opts
|
20
73
|
)
|
@@ -26,13 +79,25 @@ module Stripe
|
|
26
79
|
|
27
80
|
class TestHelpers < APIResourceTestHelpers
|
28
81
|
RESOURCE_CLASS = Refund
|
82
|
+
def self.resource_class
|
83
|
+
"Refund"
|
84
|
+
end
|
29
85
|
|
30
|
-
|
86
|
+
# Expire a refund with a status of requires_action.
|
87
|
+
def self.expire(refund, params = {}, opts = {})
|
88
|
+
request_stripe_object(
|
89
|
+
method: :post,
|
90
|
+
path: format("/v1/test_helpers/refunds/%<refund>s/expire", { refund: CGI.escape(refund) }),
|
91
|
+
params: params,
|
92
|
+
opts: opts
|
93
|
+
)
|
94
|
+
end
|
31
95
|
|
96
|
+
# Expire a refund with a status of requires_action.
|
32
97
|
def expire(params = {}, opts = {})
|
33
98
|
@resource.request_stripe_object(
|
34
99
|
method: :post,
|
35
|
-
path:
|
100
|
+
path: format("/v1/test_helpers/refunds/%<refund>s/expire", { refund: CGI.escape(@resource["id"]) }),
|
36
101
|
params: params,
|
37
102
|
opts: opts
|
38
103
|
)
|
@@ -3,11 +3,42 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Reporting
|
6
|
+
# The Report Run object represents an instance of a report type generated with
|
7
|
+
# specific run parameters. Once the object is created, Stripe begins processing the report.
|
8
|
+
# When the report has finished running, it will give you a reference to a file
|
9
|
+
# where you can retrieve your results. For an overview, see
|
10
|
+
# [API Access to Reports](https://stripe.com/docs/reporting/statements/api).
|
11
|
+
#
|
12
|
+
# Note that certain report types can only be run based on your live-mode data (not test-mode
|
13
|
+
# data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).
|
6
14
|
class ReportRun < APIResource
|
7
15
|
extend Stripe::APIOperations::Create
|
8
16
|
extend Stripe::APIOperations::List
|
9
17
|
|
10
18
|
OBJECT_NAME = "reporting.report_run"
|
19
|
+
def self.object_name
|
20
|
+
"reporting.report_run"
|
21
|
+
end
|
22
|
+
|
23
|
+
# Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).)
|
24
|
+
def self.create(params = {}, opts = {})
|
25
|
+
request_stripe_object(
|
26
|
+
method: :post,
|
27
|
+
path: "/v1/reporting/report_runs",
|
28
|
+
params: params,
|
29
|
+
opts: opts
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Returns a list of Report Runs, with the most recent appearing first.
|
34
|
+
def self.list(params = {}, opts = {})
|
35
|
+
request_stripe_object(
|
36
|
+
method: :get,
|
37
|
+
path: "/v1/reporting/report_runs",
|
38
|
+
params: params,
|
39
|
+
opts: opts
|
40
|
+
)
|
41
|
+
end
|
11
42
|
end
|
12
43
|
end
|
13
44
|
end
|
@@ -3,11 +3,31 @@
|
|
3
3
|
|
4
4
|
module Stripe
|
5
5
|
module Reporting
|
6
|
+
# The Report Type resource corresponds to a particular type of report, such as
|
7
|
+
# the "Activity summary" or "Itemized payouts" reports. These objects are
|
8
|
+
# identified by an ID belonging to a set of enumerated values. See
|
9
|
+
# [API Access to Reports documentation](https://stripe.com/docs/reporting/statements/api)
|
10
|
+
# for those Report Type IDs, along with required and optional parameters.
|
11
|
+
#
|
12
|
+
# Note that certain report types can only be run based on your live-mode data (not test-mode
|
13
|
+
# data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).
|
6
14
|
class ReportType < APIResource
|
7
|
-
extend Stripe::APIOperations::Create
|
8
15
|
extend Stripe::APIOperations::List
|
9
16
|
|
10
17
|
OBJECT_NAME = "reporting.report_type"
|
18
|
+
def self.object_name
|
19
|
+
"reporting.report_type"
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns a full list of Report Types.
|
23
|
+
def self.list(params = {}, opts = {})
|
24
|
+
request_stripe_object(
|
25
|
+
method: :get,
|
26
|
+
path: "/v1/reporting/report_types",
|
27
|
+
params: params,
|
28
|
+
opts: opts
|
29
|
+
)
|
30
|
+
end
|
11
31
|
end
|
12
32
|
end
|
13
33
|
end
|
@@ -2,15 +2,30 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# [Stripe Connect](https://stripe.com/docs/connect) platforms can reverse transfers made to a
|
6
|
+
# connected account, either entirely or partially, and can also specify whether
|
7
|
+
# to refund any related application fees. Transfer reversals add to the
|
8
|
+
# platform's balance and subtract from the destination account's balance.
|
9
|
+
#
|
10
|
+
# Reversing a transfer that was made for a [destination
|
11
|
+
# charge](https://stripe.com/docs/connect/destination-charges) is allowed only up to the amount of
|
12
|
+
# the charge. It is possible to reverse a
|
13
|
+
# [transfer_group](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options)
|
14
|
+
# transfer only if the destination account has enough balance to cover the
|
15
|
+
# reversal.
|
16
|
+
#
|
17
|
+
# Related guide: [Reverse transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reverse-transfers)
|
5
18
|
class Reversal < APIResource
|
6
|
-
extend Stripe::APIOperations::List
|
7
19
|
include Stripe::APIOperations::Save
|
8
20
|
|
9
21
|
OBJECT_NAME = "transfer_reversal"
|
22
|
+
def self.object_name
|
23
|
+
"transfer_reversal"
|
24
|
+
end
|
10
25
|
|
11
26
|
def resource_url
|
12
27
|
"#{Transfer.resource_url}/#{CGI.escape(transfer)}/reversals" \
|
13
|
-
|
28
|
+
"/#{CGI.escape(id)}"
|
14
29
|
end
|
15
30
|
|
16
31
|
def self.update(_id, _params = nil, _opts = nil)
|
@@ -2,20 +2,41 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Reviews can be used to supplement automated fraud detection with human expertise.
|
6
|
+
#
|
7
|
+
# Learn more about [Radar](https://stripe.com/radar) and reviewing payments
|
8
|
+
# [here](https://stripe.com/docs/radar/reviews).
|
5
9
|
class Review < APIResource
|
6
10
|
extend Stripe::APIOperations::List
|
7
11
|
|
8
12
|
OBJECT_NAME = "review"
|
13
|
+
def self.object_name
|
14
|
+
"review"
|
15
|
+
end
|
9
16
|
|
10
|
-
|
11
|
-
|
17
|
+
# Approves a Review object, closing it and removing it from the list of reviews.
|
12
18
|
def approve(params = {}, opts = {})
|
13
19
|
request_stripe_object(
|
14
20
|
method: :post,
|
15
|
-
path:
|
21
|
+
path: format("/v1/reviews/%<review>s/approve", { review: CGI.escape(self["id"]) }),
|
16
22
|
params: params,
|
17
23
|
opts: opts
|
18
24
|
)
|
19
25
|
end
|
26
|
+
|
27
|
+
# Approves a Review object, closing it and removing it from the list of reviews.
|
28
|
+
def self.approve(review, params = {}, opts = {})
|
29
|
+
request_stripe_object(
|
30
|
+
method: :post,
|
31
|
+
path: format("/v1/reviews/%<review>s/approve", { review: CGI.escape(review) }),
|
32
|
+
params: params,
|
33
|
+
opts: opts
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
38
|
+
def self.list(params = {}, opts = {})
|
39
|
+
request_stripe_object(method: :get, path: "/v1/reviews", params: params, opts: opts)
|
40
|
+
end
|
20
41
|
end
|
21
42
|
end
|
@@ -2,9 +2,21 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A SetupAttempt describes one attempted confirmation of a SetupIntent,
|
6
|
+
# whether that confirmation is successful or unsuccessful. You can use
|
7
|
+
# SetupAttempts to inspect details of a specific attempt at setting up a
|
8
|
+
# payment method using a SetupIntent.
|
5
9
|
class SetupAttempt < APIResource
|
6
10
|
extend Stripe::APIOperations::List
|
7
11
|
|
8
12
|
OBJECT_NAME = "setup_attempt"
|
13
|
+
def self.object_name
|
14
|
+
"setup_attempt"
|
15
|
+
end
|
16
|
+
|
17
|
+
# Returns a list of SetupAttempts that associate with a provided SetupIntent.
|
18
|
+
def self.list(params = {}, opts = {})
|
19
|
+
request_stripe_object(method: :get, path: "/v1/setup_attempts", params: params, opts: opts)
|
20
|
+
end
|
9
21
|
end
|
10
22
|
end
|