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,52 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class PriceService < StripeService
|
6
|
+
# Creates a new price for an existing product. The price can be recurring or one-time.
|
7
|
+
def create(params = {}, opts = {})
|
8
|
+
request(method: :post, path: "/v1/prices", params: params, opts: opts, base_address: :api)
|
9
|
+
end
|
10
|
+
|
11
|
+
# Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false.
|
12
|
+
def list(params = {}, opts = {})
|
13
|
+
request(method: :get, path: "/v1/prices", params: params, opts: opts, base_address: :api)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Retrieves the price with the given ID.
|
17
|
+
def retrieve(price, params = {}, opts = {})
|
18
|
+
request(
|
19
|
+
method: :get,
|
20
|
+
path: format("/v1/prices/%<price>s", { price: CGI.escape(price) }),
|
21
|
+
params: params,
|
22
|
+
opts: opts,
|
23
|
+
base_address: :api
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
|
28
|
+
# Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
|
29
|
+
# conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
|
30
|
+
# to an hour behind during outages. Search functionality is not available to merchants in India.
|
31
|
+
def search(params = {}, opts = {})
|
32
|
+
request(
|
33
|
+
method: :get,
|
34
|
+
path: "/v1/prices/search",
|
35
|
+
params: params,
|
36
|
+
opts: opts,
|
37
|
+
base_address: :api
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.
|
42
|
+
def update(price, params = {}, opts = {})
|
43
|
+
request(
|
44
|
+
method: :post,
|
45
|
+
path: format("/v1/prices/%<price>s", { price: CGI.escape(price) }),
|
46
|
+
params: params,
|
47
|
+
opts: opts,
|
48
|
+
base_address: :api
|
49
|
+
)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class ProductFeatureService < StripeService
|
6
|
+
# Creates a product_feature, which represents a feature attachment to a product
|
7
|
+
def create(product, params = {}, opts = {})
|
8
|
+
request(
|
9
|
+
method: :post,
|
10
|
+
path: format("/v1/products/%<product>s/features", { product: CGI.escape(product) }),
|
11
|
+
params: params,
|
12
|
+
opts: opts,
|
13
|
+
base_address: :api
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Deletes the feature attachment to a product
|
18
|
+
def delete(product, id, params = {}, opts = {})
|
19
|
+
request(
|
20
|
+
method: :delete,
|
21
|
+
path: format("/v1/products/%<product>s/features/%<id>s", { product: CGI.escape(product), id: CGI.escape(id) }),
|
22
|
+
params: params,
|
23
|
+
opts: opts,
|
24
|
+
base_address: :api
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Retrieve a list of features for a product
|
29
|
+
def list(product, params = {}, opts = {})
|
30
|
+
request(
|
31
|
+
method: :get,
|
32
|
+
path: format("/v1/products/%<product>s/features", { product: CGI.escape(product) }),
|
33
|
+
params: params,
|
34
|
+
opts: opts,
|
35
|
+
base_address: :api
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Retrieves a product_feature, which represents a feature attachment to a product
|
40
|
+
def retrieve(product, id, params = {}, opts = {})
|
41
|
+
request(
|
42
|
+
method: :get,
|
43
|
+
path: format("/v1/products/%<product>s/features/%<id>s", { product: CGI.escape(product), id: CGI.escape(id) }),
|
44
|
+
params: params,
|
45
|
+
opts: opts,
|
46
|
+
base_address: :api
|
47
|
+
)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class ProductService < StripeService
|
6
|
+
attr_reader :features
|
7
|
+
|
8
|
+
def initialize(requestor)
|
9
|
+
super(requestor)
|
10
|
+
@features = Stripe::ProductFeatureService.new(@requestor)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Creates a new product object.
|
14
|
+
def create(params = {}, opts = {})
|
15
|
+
request(method: :post, path: "/v1/products", params: params, opts: opts, base_address: :api)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it.
|
19
|
+
def delete(id, params = {}, opts = {})
|
20
|
+
request(
|
21
|
+
method: :delete,
|
22
|
+
path: format("/v1/products/%<id>s", { id: CGI.escape(id) }),
|
23
|
+
params: params,
|
24
|
+
opts: opts,
|
25
|
+
base_address: :api
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
|
30
|
+
def list(params = {}, opts = {})
|
31
|
+
request(method: :get, path: "/v1/products", params: params, opts: opts, base_address: :api)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.
|
35
|
+
def retrieve(id, params = {}, opts = {})
|
36
|
+
request(
|
37
|
+
method: :get,
|
38
|
+
path: format("/v1/products/%<id>s", { id: CGI.escape(id) }),
|
39
|
+
params: params,
|
40
|
+
opts: opts,
|
41
|
+
base_address: :api
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
|
46
|
+
# Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
|
47
|
+
# conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
|
48
|
+
# to an hour behind during outages. Search functionality is not available to merchants in India.
|
49
|
+
def search(params = {}, opts = {})
|
50
|
+
request(
|
51
|
+
method: :get,
|
52
|
+
path: "/v1/products/search",
|
53
|
+
params: params,
|
54
|
+
opts: opts,
|
55
|
+
base_address: :api
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
60
|
+
def update(id, params = {}, opts = {})
|
61
|
+
request(
|
62
|
+
method: :post,
|
63
|
+
path: format("/v1/products/%<id>s", { id: CGI.escape(id) }),
|
64
|
+
params: params,
|
65
|
+
opts: opts,
|
66
|
+
base_address: :api
|
67
|
+
)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class PromotionCodeService < StripeService
|
6
|
+
# A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
|
7
|
+
def create(params = {}, opts = {})
|
8
|
+
request(
|
9
|
+
method: :post,
|
10
|
+
path: "/v1/promotion_codes",
|
11
|
+
params: params,
|
12
|
+
opts: opts,
|
13
|
+
base_address: :api
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Returns a list of your promotion codes.
|
18
|
+
def list(params = {}, opts = {})
|
19
|
+
request(
|
20
|
+
method: :get,
|
21
|
+
path: "/v1/promotion_codes",
|
22
|
+
params: params,
|
23
|
+
opts: opts,
|
24
|
+
base_address: :api
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code.
|
29
|
+
def retrieve(promotion_code, params = {}, opts = {})
|
30
|
+
request(
|
31
|
+
method: :get,
|
32
|
+
path: format("/v1/promotion_codes/%<promotion_code>s", { promotion_code: CGI.escape(promotion_code) }),
|
33
|
+
params: params,
|
34
|
+
opts: opts,
|
35
|
+
base_address: :api
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.
|
40
|
+
def update(promotion_code, params = {}, opts = {})
|
41
|
+
request(
|
42
|
+
method: :post,
|
43
|
+
path: format("/v1/promotion_codes/%<promotion_code>s", { promotion_code: CGI.escape(promotion_code) }),
|
44
|
+
params: params,
|
45
|
+
opts: opts,
|
46
|
+
base_address: :api
|
47
|
+
)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class QuoteComputedUpfrontLineItemsService < StripeService
|
6
|
+
# 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.
|
7
|
+
def list(quote, params = {}, opts = {})
|
8
|
+
request(
|
9
|
+
method: :get,
|
10
|
+
path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(quote) }),
|
11
|
+
params: params,
|
12
|
+
opts: opts,
|
13
|
+
base_address: :api
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class QuoteLineItemService < StripeService
|
6
|
+
# 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.
|
7
|
+
def list(quote, params = {}, opts = {})
|
8
|
+
request(
|
9
|
+
method: :get,
|
10
|
+
path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(quote) }),
|
11
|
+
params: params,
|
12
|
+
opts: opts,
|
13
|
+
base_address: :api
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class QuoteService < StripeService
|
6
|
+
attr_reader :line_items, :computed_upfront_line_items
|
7
|
+
|
8
|
+
def initialize(requestor)
|
9
|
+
super(requestor)
|
10
|
+
@line_items = Stripe::QuoteLineItemService.new(@requestor)
|
11
|
+
@computed_upfront_line_items = Stripe::QuoteComputedUpfrontLineItemsService.new(@requestor)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Accepts the specified quote.
|
15
|
+
def accept(quote, params = {}, opts = {})
|
16
|
+
request(
|
17
|
+
method: :post,
|
18
|
+
path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(quote) }),
|
19
|
+
params: params,
|
20
|
+
opts: opts,
|
21
|
+
base_address: :api
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Cancels the quote.
|
26
|
+
def cancel(quote, params = {}, opts = {})
|
27
|
+
request(
|
28
|
+
method: :post,
|
29
|
+
path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(quote) }),
|
30
|
+
params: params,
|
31
|
+
opts: opts,
|
32
|
+
base_address: :api
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
# 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).
|
37
|
+
def create(params = {}, opts = {})
|
38
|
+
request(method: :post, path: "/v1/quotes", params: params, opts: opts, base_address: :api)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Finalizes the quote.
|
42
|
+
def finalize_quote(quote, params = {}, opts = {})
|
43
|
+
request(
|
44
|
+
method: :post,
|
45
|
+
path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(quote) }),
|
46
|
+
params: params,
|
47
|
+
opts: opts,
|
48
|
+
base_address: :api
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns a list of your quotes.
|
53
|
+
def list(params = {}, opts = {})
|
54
|
+
request(method: :get, path: "/v1/quotes", params: params, opts: opts, base_address: :api)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
|
58
|
+
def pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
59
|
+
opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
|
60
|
+
request_stream(
|
61
|
+
method: :get,
|
62
|
+
path: format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(quote) }),
|
63
|
+
params: params,
|
64
|
+
opts: opts,
|
65
|
+
base_address: :files,
|
66
|
+
&read_body_chunk_block
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Retrieves the quote with the given ID.
|
71
|
+
def retrieve(quote, params = {}, opts = {})
|
72
|
+
request(
|
73
|
+
method: :get,
|
74
|
+
path: format("/v1/quotes/%<quote>s", { quote: CGI.escape(quote) }),
|
75
|
+
params: params,
|
76
|
+
opts: opts,
|
77
|
+
base_address: :api
|
78
|
+
)
|
79
|
+
end
|
80
|
+
|
81
|
+
# A quote models prices and services for a customer.
|
82
|
+
def update(quote, params = {}, opts = {})
|
83
|
+
request(
|
84
|
+
method: :post,
|
85
|
+
path: format("/v1/quotes/%<quote>s", { quote: CGI.escape(quote) }),
|
86
|
+
params: params,
|
87
|
+
opts: opts,
|
88
|
+
base_address: :api
|
89
|
+
)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Radar
|
6
|
+
class EarlyFraudWarningService < StripeService
|
7
|
+
# Returns a list of early fraud warnings.
|
8
|
+
def list(params = {}, opts = {})
|
9
|
+
request(
|
10
|
+
method: :get,
|
11
|
+
path: "/v1/radar/early_fraud_warnings",
|
12
|
+
params: params,
|
13
|
+
opts: opts,
|
14
|
+
base_address: :api
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Retrieves the details of an early fraud warning that has previously been created.
|
19
|
+
#
|
20
|
+
# Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details.
|
21
|
+
def retrieve(early_fraud_warning, params = {}, opts = {})
|
22
|
+
request(
|
23
|
+
method: :get,
|
24
|
+
path: format("/v1/radar/early_fraud_warnings/%<early_fraud_warning>s", { early_fraud_warning: CGI.escape(early_fraud_warning) }),
|
25
|
+
params: params,
|
26
|
+
opts: opts,
|
27
|
+
base_address: :api
|
28
|
+
)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Radar
|
6
|
+
class ValueListItemService < StripeService
|
7
|
+
# Creates a new ValueListItem object, which is added to the specified parent value list.
|
8
|
+
def create(params = {}, opts = {})
|
9
|
+
request(
|
10
|
+
method: :post,
|
11
|
+
path: "/v1/radar/value_list_items",
|
12
|
+
params: params,
|
13
|
+
opts: opts,
|
14
|
+
base_address: :api
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Deletes a ValueListItem object, removing it from its parent value list.
|
19
|
+
def delete(item, params = {}, opts = {})
|
20
|
+
request(
|
21
|
+
method: :delete,
|
22
|
+
path: format("/v1/radar/value_list_items/%<item>s", { item: CGI.escape(item) }),
|
23
|
+
params: params,
|
24
|
+
opts: opts,
|
25
|
+
base_address: :api
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
30
|
+
def list(params = {}, opts = {})
|
31
|
+
request(
|
32
|
+
method: :get,
|
33
|
+
path: "/v1/radar/value_list_items",
|
34
|
+
params: params,
|
35
|
+
opts: opts,
|
36
|
+
base_address: :api
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Retrieves a ValueListItem object.
|
41
|
+
def retrieve(item, params = {}, opts = {})
|
42
|
+
request(
|
43
|
+
method: :get,
|
44
|
+
path: format("/v1/radar/value_list_items/%<item>s", { item: CGI.escape(item) }),
|
45
|
+
params: params,
|
46
|
+
opts: opts,
|
47
|
+
base_address: :api
|
48
|
+
)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Radar
|
6
|
+
class ValueListService < StripeService
|
7
|
+
# Creates a new ValueList object, which can then be referenced in rules.
|
8
|
+
def create(params = {}, opts = {})
|
9
|
+
request(
|
10
|
+
method: :post,
|
11
|
+
path: "/v1/radar/value_lists",
|
12
|
+
params: params,
|
13
|
+
opts: opts,
|
14
|
+
base_address: :api
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# 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.
|
19
|
+
def delete(value_list, params = {}, opts = {})
|
20
|
+
request(
|
21
|
+
method: :delete,
|
22
|
+
path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(value_list) }),
|
23
|
+
params: params,
|
24
|
+
opts: opts,
|
25
|
+
base_address: :api
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
30
|
+
def list(params = {}, opts = {})
|
31
|
+
request(
|
32
|
+
method: :get,
|
33
|
+
path: "/v1/radar/value_lists",
|
34
|
+
params: params,
|
35
|
+
opts: opts,
|
36
|
+
base_address: :api
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Retrieves a ValueList object.
|
41
|
+
def retrieve(value_list, params = {}, opts = {})
|
42
|
+
request(
|
43
|
+
method: :get,
|
44
|
+
path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(value_list) }),
|
45
|
+
params: params,
|
46
|
+
opts: opts,
|
47
|
+
base_address: :api
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
# 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.
|
52
|
+
def update(value_list, params = {}, opts = {})
|
53
|
+
request(
|
54
|
+
method: :post,
|
55
|
+
path: format("/v1/radar/value_lists/%<value_list>s", { value_list: CGI.escape(value_list) }),
|
56
|
+
params: params,
|
57
|
+
opts: opts,
|
58
|
+
base_address: :api
|
59
|
+
)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class RadarService < StripeService
|
6
|
+
attr_reader :early_fraud_warnings, :value_lists, :value_list_items
|
7
|
+
|
8
|
+
def initialize(requestor)
|
9
|
+
super(requestor)
|
10
|
+
@early_fraud_warnings = Stripe::Radar::EarlyFraudWarningService.new(@requestor)
|
11
|
+
@value_lists = Stripe::Radar::ValueListService.new(@requestor)
|
12
|
+
@value_list_items = Stripe::Radar::ValueListItemService.new(@requestor)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class RefundService < StripeService
|
6
|
+
# Cancels a refund with a status of requires_action.
|
7
|
+
#
|
8
|
+
# You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state.
|
9
|
+
def cancel(refund, params = {}, opts = {})
|
10
|
+
request(
|
11
|
+
method: :post,
|
12
|
+
path: format("/v1/refunds/%<refund>s/cancel", { refund: CGI.escape(refund) }),
|
13
|
+
params: params,
|
14
|
+
opts: opts,
|
15
|
+
base_address: :api
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
# When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.
|
20
|
+
#
|
21
|
+
# Creating a new refund will refund a charge that has previously been created but not yet refunded.
|
22
|
+
# Funds will be refunded to the credit or debit card that was originally charged.
|
23
|
+
#
|
24
|
+
# You can optionally refund only part of a charge.
|
25
|
+
# You can do so multiple times, until the entire charge has been refunded.
|
26
|
+
#
|
27
|
+
# Once entirely refunded, a charge can't be refunded again.
|
28
|
+
# This method will raise an error when called on an already-refunded charge,
|
29
|
+
# or when trying to refund more money than is left on a charge.
|
30
|
+
def create(params = {}, opts = {})
|
31
|
+
request(method: :post, path: "/v1/refunds", params: params, opts: opts, base_address: :api)
|
32
|
+
end
|
33
|
+
|
34
|
+
# 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.
|
35
|
+
def list(params = {}, opts = {})
|
36
|
+
request(method: :get, path: "/v1/refunds", params: params, opts: opts, base_address: :api)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Retrieves the details of an existing refund.
|
40
|
+
def retrieve(refund, params = {}, opts = {})
|
41
|
+
request(
|
42
|
+
method: :get,
|
43
|
+
path: format("/v1/refunds/%<refund>s", { refund: CGI.escape(refund) }),
|
44
|
+
params: params,
|
45
|
+
opts: opts,
|
46
|
+
base_address: :api
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged.
|
51
|
+
#
|
52
|
+
# This request only accepts metadata as an argument.
|
53
|
+
def update(refund, params = {}, opts = {})
|
54
|
+
request(
|
55
|
+
method: :post,
|
56
|
+
path: format("/v1/refunds/%<refund>s", { refund: CGI.escape(refund) }),
|
57
|
+
params: params,
|
58
|
+
opts: opts,
|
59
|
+
base_address: :api
|
60
|
+
)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Reporting
|
6
|
+
class ReportRunService < StripeService
|
7
|
+
# 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).)
|
8
|
+
def create(params = {}, opts = {})
|
9
|
+
request(
|
10
|
+
method: :post,
|
11
|
+
path: "/v1/reporting/report_runs",
|
12
|
+
params: params,
|
13
|
+
opts: opts,
|
14
|
+
base_address: :api
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Returns a list of Report Runs, with the most recent appearing first.
|
19
|
+
def list(params = {}, opts = {})
|
20
|
+
request(
|
21
|
+
method: :get,
|
22
|
+
path: "/v1/reporting/report_runs",
|
23
|
+
params: params,
|
24
|
+
opts: opts,
|
25
|
+
base_address: :api
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Retrieves the details of an existing Report Run.
|
30
|
+
def retrieve(report_run, params = {}, opts = {})
|
31
|
+
request(
|
32
|
+
method: :get,
|
33
|
+
path: format("/v1/reporting/report_runs/%<report_run>s", { report_run: CGI.escape(report_run) }),
|
34
|
+
params: params,
|
35
|
+
opts: opts,
|
36
|
+
base_address: :api
|
37
|
+
)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Reporting
|
6
|
+
class ReportTypeService < StripeService
|
7
|
+
# Returns a full list of Report Types.
|
8
|
+
def list(params = {}, opts = {})
|
9
|
+
request(
|
10
|
+
method: :get,
|
11
|
+
path: "/v1/reporting/report_types",
|
12
|
+
params: params,
|
13
|
+
opts: opts,
|
14
|
+
base_address: :api
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).)
|
19
|
+
def retrieve(report_type, params = {}, opts = {})
|
20
|
+
request(
|
21
|
+
method: :get,
|
22
|
+
path: format("/v1/reporting/report_types/%<report_type>s", { report_type: CGI.escape(report_type) }),
|
23
|
+
params: params,
|
24
|
+
opts: opts,
|
25
|
+
base_address: :api
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
class ReportingService < StripeService
|
6
|
+
attr_reader :report_runs, :report_types
|
7
|
+
|
8
|
+
def initialize(requestor)
|
9
|
+
super(requestor)
|
10
|
+
@report_runs = Stripe::Reporting::ReportRunService.new(@requestor)
|
11
|
+
@report_types = Stripe::Reporting::ReportTypeService.new(@requestor)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|