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,32 +2,90 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Issue a credit note to adjust an invoice's amount after the invoice is finalized.
|
6
|
+
#
|
7
|
+
# Related guide: [Credit notes](https://stripe.com/docs/billing/invoices/credit-notes)
|
5
8
|
class CreditNote < APIResource
|
6
9
|
extend Stripe::APIOperations::Create
|
7
10
|
extend Stripe::APIOperations::List
|
8
11
|
include Stripe::APIOperations::Save
|
9
12
|
|
10
13
|
OBJECT_NAME = "credit_note"
|
14
|
+
def self.object_name
|
15
|
+
"credit_note"
|
16
|
+
end
|
11
17
|
|
12
|
-
|
18
|
+
# Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces
|
19
|
+
# its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result
|
20
|
+
# in any combination of the following:
|
21
|
+
#
|
22
|
+
#
|
23
|
+
# Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
|
24
|
+
# Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
|
25
|
+
# Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
|
26
|
+
#
|
27
|
+
#
|
28
|
+
# For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
|
29
|
+
#
|
30
|
+
# You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
|
31
|
+
# or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
|
32
|
+
def self.create(params = {}, opts = {})
|
33
|
+
request_stripe_object(method: :post, path: "/v1/credit_notes", params: params, opts: opts)
|
34
|
+
end
|
13
35
|
|
14
|
-
|
36
|
+
# Returns a list of credit notes.
|
37
|
+
def self.list(params = {}, opts = {})
|
38
|
+
request_stripe_object(method: :get, path: "/v1/credit_notes", params: params, opts: opts)
|
39
|
+
end
|
40
|
+
|
41
|
+
# When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
|
42
|
+
def self.list_preview_line_items(params = {}, opts = {})
|
43
|
+
request_stripe_object(
|
44
|
+
method: :get,
|
45
|
+
path: "/v1/credit_notes/preview/lines",
|
46
|
+
params: params,
|
47
|
+
opts: opts
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Get a preview of a credit note without creating it.
|
52
|
+
def self.preview(params = {}, opts = {})
|
53
|
+
request_stripe_object(
|
54
|
+
method: :get,
|
55
|
+
path: "/v1/credit_notes/preview",
|
56
|
+
params: params,
|
57
|
+
opts: opts
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Updates an existing credit note.
|
62
|
+
def self.update(id, params = {}, opts = {})
|
15
63
|
request_stripe_object(
|
16
64
|
method: :post,
|
17
|
-
path:
|
65
|
+
path: format("/v1/credit_notes/%<id>s", { id: CGI.escape(id) }),
|
18
66
|
params: params,
|
19
67
|
opts: opts
|
20
68
|
)
|
21
69
|
end
|
22
70
|
|
23
|
-
|
24
|
-
|
25
|
-
|
71
|
+
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
72
|
+
def void_credit_note(params = {}, opts = {})
|
73
|
+
request_stripe_object(
|
74
|
+
method: :post,
|
75
|
+
path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(self["id"]) }),
|
76
|
+
params: params,
|
77
|
+
opts: opts
|
78
|
+
)
|
26
79
|
end
|
27
80
|
|
28
|
-
|
29
|
-
|
30
|
-
|
81
|
+
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
82
|
+
def self.void_credit_note(id, params = {}, opts = {})
|
83
|
+
request_stripe_object(
|
84
|
+
method: :post,
|
85
|
+
path: format("/v1/credit_notes/%<id>s/void", { id: CGI.escape(id) }),
|
86
|
+
params: params,
|
87
|
+
opts: opts
|
88
|
+
)
|
31
89
|
end
|
32
90
|
end
|
33
91
|
end
|
@@ -2,50 +2,181 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# This object represents a customer of your business. Use it to [create recurring charges](https://stripe.com/docs/invoicing/customer), [save payment](https://stripe.com/docs/payments/save-during-payment) and contact information,
|
6
|
+
# and track payments that belong to the same customer.
|
5
7
|
class Customer < APIResource
|
6
8
|
extend Stripe::APIOperations::Create
|
7
9
|
include Stripe::APIOperations::Delete
|
8
10
|
extend Stripe::APIOperations::List
|
11
|
+
extend Stripe::APIOperations::NestedResource
|
9
12
|
extend Stripe::APIOperations::Search
|
10
13
|
include Stripe::APIOperations::Save
|
11
|
-
extend Stripe::APIOperations::NestedResource
|
12
14
|
|
13
15
|
OBJECT_NAME = "customer"
|
16
|
+
def self.object_name
|
17
|
+
"customer"
|
18
|
+
end
|
14
19
|
|
15
|
-
|
16
|
-
|
20
|
+
nested_resource_class_methods :balance_transaction, operations: %i[create retrieve update list]
|
21
|
+
nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list]
|
22
|
+
nested_resource_class_methods :source, operations: %i[create retrieve update delete list]
|
23
|
+
nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list]
|
17
24
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
operations: %i[create retrieve update list]
|
23
|
-
nested_resource_class_methods :tax_id,
|
24
|
-
operations: %i[create retrieve delete list]
|
25
|
+
# Creates a new customer object.
|
26
|
+
def self.create(params = {}, opts = {})
|
27
|
+
request_stripe_object(method: :post, path: "/v1/customers", params: params, opts: opts)
|
28
|
+
end
|
25
29
|
|
30
|
+
# Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
|
31
|
+
# funding instructions will be created. If funding instructions have already been created for a given customer, the same
|
32
|
+
# funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
|
26
33
|
def create_funding_instructions(params = {}, opts = {})
|
27
34
|
request_stripe_object(
|
28
35
|
method: :post,
|
29
|
-
path:
|
36
|
+
path: format("/v1/customers/%<customer>s/funding_instructions", { customer: CGI.escape(self["id"]) }),
|
37
|
+
params: params,
|
38
|
+
opts: opts
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
|
43
|
+
# funding instructions will be created. If funding instructions have already been created for a given customer, the same
|
44
|
+
# funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
|
45
|
+
def self.create_funding_instructions(customer, params = {}, opts = {})
|
46
|
+
request_stripe_object(
|
47
|
+
method: :post,
|
48
|
+
path: format("/v1/customers/%<customer>s/funding_instructions", { customer: CGI.escape(customer) }),
|
49
|
+
params: params,
|
50
|
+
opts: opts
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
|
55
|
+
def self.delete(customer, params = {}, opts = {})
|
56
|
+
request_stripe_object(
|
57
|
+
method: :delete,
|
58
|
+
path: format("/v1/customers/%<customer>s", { customer: CGI.escape(customer) }),
|
59
|
+
params: params,
|
60
|
+
opts: opts
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
# Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
|
65
|
+
def delete(params = {}, opts = {})
|
66
|
+
request_stripe_object(
|
67
|
+
method: :delete,
|
68
|
+
path: format("/v1/customers/%<customer>s", { customer: CGI.escape(self["id"]) }),
|
30
69
|
params: params,
|
31
70
|
opts: opts
|
32
71
|
)
|
33
72
|
end
|
34
73
|
|
74
|
+
# Removes the currently applied discount on a customer.
|
75
|
+
def delete_discount(params = {}, opts = {})
|
76
|
+
request_stripe_object(
|
77
|
+
method: :delete,
|
78
|
+
path: format("/v1/customers/%<customer>s/discount", { customer: CGI.escape(self["id"]) }),
|
79
|
+
params: params,
|
80
|
+
opts: opts
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Removes the currently applied discount on a customer.
|
85
|
+
def self.delete_discount(customer, params = {}, opts = {})
|
86
|
+
request_stripe_object(
|
87
|
+
method: :delete,
|
88
|
+
path: format("/v1/customers/%<customer>s/discount", { customer: CGI.escape(customer) }),
|
89
|
+
params: params,
|
90
|
+
opts: opts
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
|
95
|
+
def self.list(params = {}, opts = {})
|
96
|
+
request_stripe_object(method: :get, path: "/v1/customers", params: params, opts: opts)
|
97
|
+
end
|
98
|
+
|
99
|
+
# Returns a list of PaymentMethods for a given Customer
|
35
100
|
def list_payment_methods(params = {}, opts = {})
|
36
101
|
request_stripe_object(
|
37
102
|
method: :get,
|
38
|
-
path:
|
103
|
+
path: format("/v1/customers/%<customer>s/payment_methods", { customer: CGI.escape(self["id"]) }),
|
104
|
+
params: params,
|
105
|
+
opts: opts
|
106
|
+
)
|
107
|
+
end
|
108
|
+
|
109
|
+
# Returns a list of PaymentMethods for a given Customer
|
110
|
+
def self.list_payment_methods(customer, params = {}, opts = {})
|
111
|
+
request_stripe_object(
|
112
|
+
method: :get,
|
113
|
+
path: format("/v1/customers/%<customer>s/payment_methods", { customer: CGI.escape(customer) }),
|
114
|
+
params: params,
|
115
|
+
opts: opts
|
116
|
+
)
|
117
|
+
end
|
118
|
+
|
119
|
+
# Retrieves a customer's cash balance.
|
120
|
+
def self.retrieve_cash_balance(customer, params = {}, opts = {})
|
121
|
+
request_stripe_object(
|
122
|
+
method: :get,
|
123
|
+
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
124
|
+
params: params,
|
125
|
+
opts: opts
|
126
|
+
)
|
127
|
+
end
|
128
|
+
|
129
|
+
# Retrieves a PaymentMethod object for a given Customer.
|
130
|
+
def retrieve_payment_method(payment_method, params = {}, opts = {})
|
131
|
+
request_stripe_object(
|
132
|
+
method: :get,
|
133
|
+
path: format("/v1/customers/%<customer>s/payment_methods/%<payment_method>s", { customer: CGI.escape(self["id"]), payment_method: CGI.escape(payment_method) }),
|
134
|
+
params: params,
|
135
|
+
opts: opts
|
136
|
+
)
|
137
|
+
end
|
138
|
+
|
139
|
+
# Retrieves a PaymentMethod object for a given Customer.
|
140
|
+
def self.retrieve_payment_method(customer, payment_method, params = {}, opts = {})
|
141
|
+
request_stripe_object(
|
142
|
+
method: :get,
|
143
|
+
path: format("/v1/customers/%<customer>s/payment_methods/%<payment_method>s", { customer: CGI.escape(customer), payment_method: CGI.escape(payment_method) }),
|
144
|
+
params: params,
|
145
|
+
opts: opts
|
146
|
+
)
|
147
|
+
end
|
148
|
+
|
149
|
+
def self.search(params = {}, opts = {})
|
150
|
+
request_stripe_object(method: :get, path: "/v1/customers/search", params: params, opts: opts)
|
151
|
+
end
|
152
|
+
|
153
|
+
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
154
|
+
search(params, opts).auto_paging_each(&blk)
|
155
|
+
end
|
156
|
+
|
157
|
+
# Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.
|
158
|
+
#
|
159
|
+
# This request accepts mostly the same arguments as the customer creation call.
|
160
|
+
def self.update(customer, params = {}, opts = {})
|
161
|
+
request_stripe_object(
|
162
|
+
method: :post,
|
163
|
+
path: format("/v1/customers/%<customer>s", { customer: CGI.escape(customer) }),
|
39
164
|
params: params,
|
40
165
|
opts: opts
|
41
166
|
)
|
42
167
|
end
|
43
168
|
|
44
|
-
|
169
|
+
# Changes the settings on a customer's cash balance.
|
170
|
+
def self.update_cash_balance(customer, params = {}, opts = {})
|
171
|
+
request_stripe_object(
|
172
|
+
method: :post,
|
173
|
+
path: format("/v1/customers/%<customer>s/cash_balance", { customer: CGI.escape(customer) }),
|
174
|
+
params: params,
|
175
|
+
opts: opts
|
176
|
+
)
|
177
|
+
end
|
45
178
|
|
46
179
|
save_nested_resource :source
|
47
|
-
nested_resource_class_methods :source,
|
48
|
-
operations: %i[create retrieve update delete list]
|
49
180
|
|
50
181
|
# The API request for deleting a card or bank account and for detaching a
|
51
182
|
# source object are the same.
|
@@ -53,22 +184,35 @@ module Stripe
|
|
53
184
|
alias detach_source delete_source
|
54
185
|
end
|
55
186
|
|
56
|
-
|
57
|
-
|
58
|
-
# Returns the deleted discount. The customer object is not updated,
|
59
|
-
# so you must call `refresh` on it to get a new version with the
|
60
|
-
# discount removed.
|
61
|
-
def delete_discount
|
62
|
-
resp, opts = execute_resource_request(:delete, resource_url + "/discount")
|
63
|
-
Util.convert_to_stripe_object(resp.data, opts)
|
187
|
+
def test_helpers
|
188
|
+
TestHelpers.new(self)
|
64
189
|
end
|
65
190
|
|
66
|
-
|
67
|
-
|
68
|
-
|
191
|
+
class TestHelpers < APIResourceTestHelpers
|
192
|
+
RESOURCE_CLASS = Customer
|
193
|
+
def self.resource_class
|
194
|
+
"Customer"
|
195
|
+
end
|
69
196
|
|
70
|
-
|
71
|
-
|
197
|
+
# Create an incoming testmode bank transfer
|
198
|
+
def self.fund_cash_balance(customer, params = {}, opts = {})
|
199
|
+
request_stripe_object(
|
200
|
+
method: :post,
|
201
|
+
path: format("/v1/test_helpers/customers/%<customer>s/fund_cash_balance", { customer: CGI.escape(customer) }),
|
202
|
+
params: params,
|
203
|
+
opts: opts
|
204
|
+
)
|
205
|
+
end
|
206
|
+
|
207
|
+
# Create an incoming testmode bank transfer
|
208
|
+
def fund_cash_balance(params = {}, opts = {})
|
209
|
+
@resource.request_stripe_object(
|
210
|
+
method: :post,
|
211
|
+
path: format("/v1/test_helpers/customers/%<customer>s/fund_cash_balance", { customer: CGI.escape(@resource["id"]) }),
|
212
|
+
params: params,
|
213
|
+
opts: opts
|
214
|
+
)
|
215
|
+
end
|
72
216
|
end
|
73
217
|
end
|
74
218
|
end
|
@@ -2,11 +2,19 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Each customer has a [Balance](https://stripe.com/docs/api/customers/object#customer_object-balance) value,
|
6
|
+
# which denotes a debit or credit that's automatically applied to their next invoice upon finalization.
|
7
|
+
# You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update),
|
8
|
+
# or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`.
|
9
|
+
#
|
10
|
+
# Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance)
|
5
11
|
class CustomerBalanceTransaction < APIResource
|
6
|
-
extend Stripe::APIOperations::List
|
7
12
|
include Stripe::APIOperations::Save
|
8
13
|
|
9
14
|
OBJECT_NAME = "customer_balance_transaction"
|
15
|
+
def self.object_name
|
16
|
+
"customer_balance_transaction"
|
17
|
+
end
|
10
18
|
|
11
19
|
def resource_url
|
12
20
|
if !respond_to?(:customer) || customer.nil?
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# Customers with certain payments enabled have a cash balance, representing funds that were paid
|
6
|
+
# by the customer to a merchant, but have not yet been allocated to a payment. Cash Balance Transactions
|
7
|
+
# represent when funds are moved into or out of this balance. This includes funding by the customer, allocation
|
8
|
+
# to payments, and refunds to the customer.
|
9
|
+
class CustomerCashBalanceTransaction < APIResource
|
10
|
+
OBJECT_NAME = "customer_cash_balance_transaction"
|
11
|
+
def self.object_name
|
12
|
+
"customer_cash_balance_transaction"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
|
6
|
+
# control over a Customer.
|
7
|
+
#
|
8
|
+
# Related guides: [Customer Session with the Payment Element](https://stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#save-payment-methods),
|
9
|
+
# [Customer Session with the Pricing Table](https://stripe.com/payments/checkout/pricing-table#customer-session),
|
10
|
+
# [Customer Session with the Buy Button](https://stripe.com/payment-links/buy-button#pass-an-existing-customer).
|
11
|
+
class CustomerSession < APIResource
|
12
|
+
extend Stripe::APIOperations::Create
|
13
|
+
|
14
|
+
OBJECT_NAME = "customer_session"
|
15
|
+
def self.object_name
|
16
|
+
"customer_session"
|
17
|
+
end
|
18
|
+
|
19
|
+
# Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
|
20
|
+
def self.create(params = {}, opts = {})
|
21
|
+
request_stripe_object(
|
22
|
+
method: :post,
|
23
|
+
path: "/v1/customer_sessions",
|
24
|
+
params: params,
|
25
|
+
opts: opts
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -2,7 +2,14 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes).
|
6
|
+
# It contains information about when the discount began, when it will end, and what it is applied to.
|
7
|
+
#
|
8
|
+
# Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts)
|
5
9
|
class Discount < StripeObject
|
6
10
|
OBJECT_NAME = "discount"
|
11
|
+
def self.object_name
|
12
|
+
"discount"
|
13
|
+
end
|
7
14
|
end
|
8
15
|
end
|
@@ -2,18 +2,56 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A dispute occurs when a customer questions your charge with their card issuer.
|
6
|
+
# When this happens, you have the opportunity to respond to the dispute with
|
7
|
+
# evidence that shows that the charge is legitimate.
|
8
|
+
#
|
9
|
+
# Related guide: [Disputes and fraud](https://stripe.com/docs/disputes)
|
5
10
|
class Dispute < APIResource
|
6
11
|
extend Stripe::APIOperations::List
|
7
12
|
include Stripe::APIOperations::Save
|
8
13
|
|
9
14
|
OBJECT_NAME = "dispute"
|
15
|
+
def self.object_name
|
16
|
+
"dispute"
|
17
|
+
end
|
10
18
|
|
11
|
-
|
12
|
-
|
19
|
+
# Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
|
20
|
+
#
|
21
|
+
# The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible.
|
13
22
|
def close(params = {}, opts = {})
|
14
23
|
request_stripe_object(
|
15
24
|
method: :post,
|
16
|
-
path:
|
25
|
+
path: format("/v1/disputes/%<dispute>s/close", { dispute: CGI.escape(self["id"]) }),
|
26
|
+
params: params,
|
27
|
+
opts: opts
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
|
32
|
+
#
|
33
|
+
# The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible.
|
34
|
+
def self.close(dispute, params = {}, opts = {})
|
35
|
+
request_stripe_object(
|
36
|
+
method: :post,
|
37
|
+
path: format("/v1/disputes/%<dispute>s/close", { dispute: CGI.escape(dispute) }),
|
38
|
+
params: params,
|
39
|
+
opts: opts
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Returns a list of your disputes.
|
44
|
+
def self.list(params = {}, opts = {})
|
45
|
+
request_stripe_object(method: :get, path: "/v1/disputes", params: params, opts: opts)
|
46
|
+
end
|
47
|
+
|
48
|
+
# When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically.
|
49
|
+
#
|
50
|
+
# Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories).
|
51
|
+
def self.update(dispute, params = {}, opts = {})
|
52
|
+
request_stripe_object(
|
53
|
+
method: :post,
|
54
|
+
path: format("/v1/disputes/%<dispute>s", { dispute: CGI.escape(dispute) }),
|
17
55
|
params: params,
|
18
56
|
opts: opts
|
19
57
|
)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Entitlements
|
6
|
+
# An active entitlement describes access to a feature for a customer.
|
7
|
+
class ActiveEntitlement < APIResource
|
8
|
+
extend Stripe::APIOperations::List
|
9
|
+
|
10
|
+
OBJECT_NAME = "entitlements.active_entitlement"
|
11
|
+
def self.object_name
|
12
|
+
"entitlements.active_entitlement"
|
13
|
+
end
|
14
|
+
|
15
|
+
# Retrieve a list of active entitlements for a customer
|
16
|
+
def self.list(params = {}, opts = {})
|
17
|
+
request_stripe_object(
|
18
|
+
method: :get,
|
19
|
+
path: "/v1/entitlements/active_entitlements",
|
20
|
+
params: params,
|
21
|
+
opts: opts
|
22
|
+
)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Entitlements
|
6
|
+
# A feature represents a monetizable ability or functionality in your system.
|
7
|
+
# Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer.
|
8
|
+
class Feature < APIResource
|
9
|
+
extend Stripe::APIOperations::Create
|
10
|
+
extend Stripe::APIOperations::List
|
11
|
+
include Stripe::APIOperations::Save
|
12
|
+
|
13
|
+
OBJECT_NAME = "entitlements.feature"
|
14
|
+
def self.object_name
|
15
|
+
"entitlements.feature"
|
16
|
+
end
|
17
|
+
|
18
|
+
# Creates a feature
|
19
|
+
def self.create(params = {}, opts = {})
|
20
|
+
request_stripe_object(
|
21
|
+
method: :post,
|
22
|
+
path: "/v1/entitlements/features",
|
23
|
+
params: params,
|
24
|
+
opts: opts
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Retrieve a list of features
|
29
|
+
def self.list(params = {}, opts = {})
|
30
|
+
request_stripe_object(
|
31
|
+
method: :get,
|
32
|
+
path: "/v1/entitlements/features",
|
33
|
+
params: params,
|
34
|
+
opts: opts
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Update a feature's metadata or permanently deactivate it.
|
39
|
+
def self.update(id, params = {}, opts = {})
|
40
|
+
request_stripe_object(
|
41
|
+
method: :post,
|
42
|
+
path: format("/v1/entitlements/features/%<id>s", { id: CGI.escape(id) }),
|
43
|
+
params: params,
|
44
|
+
opts: opts
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -7,6 +7,29 @@ module Stripe
|
|
7
7
|
include Stripe::APIOperations::Delete
|
8
8
|
|
9
9
|
OBJECT_NAME = "ephemeral_key"
|
10
|
+
def self.object_name
|
11
|
+
"ephemeral_key"
|
12
|
+
end
|
13
|
+
|
14
|
+
# Invalidates a short-lived API key for a given resource.
|
15
|
+
def self.delete(key, params = {}, opts = {})
|
16
|
+
request_stripe_object(
|
17
|
+
method: :delete,
|
18
|
+
path: format("/v1/ephemeral_keys/%<key>s", { key: CGI.escape(key) }),
|
19
|
+
params: params,
|
20
|
+
opts: opts
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Invalidates a short-lived API key for a given resource.
|
25
|
+
def delete(params = {}, opts = {})
|
26
|
+
request_stripe_object(
|
27
|
+
method: :delete,
|
28
|
+
path: format("/v1/ephemeral_keys/%<key>s", { key: CGI.escape(self["id"]) }),
|
29
|
+
params: params,
|
30
|
+
opts: opts
|
31
|
+
)
|
32
|
+
end
|
10
33
|
|
11
34
|
def self.create(params = {}, opts = {})
|
12
35
|
opts = Util.normalize_opts(opts)
|
@@ -2,9 +2,47 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Events are our way of letting you know when something interesting happens in
|
6
|
+
# your account. When an interesting event occurs, we create a new `Event`
|
7
|
+
# object. For example, when a charge succeeds, we create a `charge.succeeded`
|
8
|
+
# event, and when an invoice payment attempt fails, we create an
|
9
|
+
# `invoice.payment_failed` event. Certain API requests might create multiple
|
10
|
+
# events. For example, if you create a new subscription for a
|
11
|
+
# customer, you receive both a `customer.subscription.created` event and a
|
12
|
+
# `charge.succeeded` event.
|
13
|
+
#
|
14
|
+
# Events occur when the state of another API resource changes. The event's data
|
15
|
+
# field embeds the resource's state at the time of the change. For
|
16
|
+
# example, a `charge.succeeded` event contains a charge, and an
|
17
|
+
# `invoice.payment_failed` event contains an invoice.
|
18
|
+
#
|
19
|
+
# As with other API resources, you can use endpoints to retrieve an
|
20
|
+
# [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events)
|
21
|
+
# from the API. We also have a separate
|
22
|
+
# [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the
|
23
|
+
# `Event` objects directly to an endpoint on your server. You can manage
|
24
|
+
# webhooks in your
|
25
|
+
# [account settings](https://dashboard.stripe.com/account/webhooks). Learn how
|
26
|
+
# to [listen for events](https://docs.stripe.com/webhooks)
|
27
|
+
# so that your integration can automatically trigger reactions.
|
28
|
+
#
|
29
|
+
# When using [Connect](https://docs.stripe.com/connect), you can also receive event notifications
|
30
|
+
# that occur in connected accounts. For these events, there's an
|
31
|
+
# additional `account` attribute in the received `Event` object.
|
32
|
+
#
|
33
|
+
# We only guarantee access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event)
|
34
|
+
# for 30 days.
|
5
35
|
class Event < APIResource
|
6
36
|
extend Stripe::APIOperations::List
|
7
37
|
|
8
38
|
OBJECT_NAME = "event"
|
39
|
+
def self.object_name
|
40
|
+
"event"
|
41
|
+
end
|
42
|
+
|
43
|
+
# List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header).
|
44
|
+
def self.list(params = {}, opts = {})
|
45
|
+
request_stripe_object(method: :get, path: "/v1/events", params: params, opts: opts)
|
46
|
+
end
|
9
47
|
end
|
10
48
|
end
|