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,59 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# PaymentMethodConfigurations control which payment methods are displayed to your customers when you don't explicitly specify payment method types. You can have multiple configurations with different sets of payment methods for different scenarios.
|
6
|
+
#
|
7
|
+
# There are two types of PaymentMethodConfigurations. Which is used depends on the [charge type](https://stripe.com/docs/connect/charges):
|
8
|
+
#
|
9
|
+
# **Direct** configurations apply to payments created on your account, including Connect destination charges, Connect separate charges and transfers, and payments not involving Connect.
|
10
|
+
#
|
11
|
+
# **Child** configurations apply to payments created on your connected accounts using direct charges, and charges with the on_behalf_of parameter.
|
12
|
+
#
|
13
|
+
# Child configurations have a `parent` that sets default values and controls which settings connected accounts may override. You can specify a parent ID at payment time, and Stripe will automatically resolve the connected account's associated child configuration. Parent configurations are [managed in the dashboard](https://dashboard.stripe.com/settings/payment_methods/connected_accounts) and are not available in this API.
|
14
|
+
#
|
15
|
+
# Related guides:
|
16
|
+
# - [Payment Method Configurations API](https://stripe.com/docs/connect/payment-method-configurations)
|
17
|
+
# - [Multiple configurations on dynamic payment methods](https://stripe.com/docs/payments/multiple-payment-method-configs)
|
18
|
+
# - [Multiple configurations for your Connect accounts](https://stripe.com/docs/connect/multiple-payment-method-configurations)
|
19
|
+
class PaymentMethodConfiguration < APIResource
|
20
|
+
extend Stripe::APIOperations::Create
|
21
|
+
extend Stripe::APIOperations::List
|
22
|
+
include Stripe::APIOperations::Save
|
23
|
+
|
24
|
+
OBJECT_NAME = "payment_method_configuration"
|
25
|
+
def self.object_name
|
26
|
+
"payment_method_configuration"
|
27
|
+
end
|
28
|
+
|
29
|
+
# Creates a payment method configuration
|
30
|
+
def self.create(params = {}, opts = {})
|
31
|
+
request_stripe_object(
|
32
|
+
method: :post,
|
33
|
+
path: "/v1/payment_method_configurations",
|
34
|
+
params: params,
|
35
|
+
opts: opts
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
# List payment method configurations
|
40
|
+
def self.list(params = {}, opts = {})
|
41
|
+
request_stripe_object(
|
42
|
+
method: :get,
|
43
|
+
path: "/v1/payment_method_configurations",
|
44
|
+
params: params,
|
45
|
+
opts: opts
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Update payment method configuration
|
50
|
+
def self.update(configuration, params = {}, opts = {})
|
51
|
+
request_stripe_object(
|
52
|
+
method: :post,
|
53
|
+
path: format("/v1/payment_method_configurations/%<configuration>s", { configuration: CGI.escape(configuration) }),
|
54
|
+
params: params,
|
55
|
+
opts: opts
|
56
|
+
)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# A payment method domain represents a web domain that you have registered with Stripe.
|
6
|
+
# Stripe Elements use registered payment method domains to control where certain payment methods are shown.
|
7
|
+
#
|
8
|
+
# Related guide: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
|
9
|
+
class PaymentMethodDomain < APIResource
|
10
|
+
extend Stripe::APIOperations::Create
|
11
|
+
extend Stripe::APIOperations::List
|
12
|
+
include Stripe::APIOperations::Save
|
13
|
+
|
14
|
+
OBJECT_NAME = "payment_method_domain"
|
15
|
+
def self.object_name
|
16
|
+
"payment_method_domain"
|
17
|
+
end
|
18
|
+
|
19
|
+
# Creates a payment method domain.
|
20
|
+
def self.create(params = {}, opts = {})
|
21
|
+
request_stripe_object(
|
22
|
+
method: :post,
|
23
|
+
path: "/v1/payment_method_domains",
|
24
|
+
params: params,
|
25
|
+
opts: opts
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Lists the details of existing payment method domains.
|
30
|
+
def self.list(params = {}, opts = {})
|
31
|
+
request_stripe_object(
|
32
|
+
method: :get,
|
33
|
+
path: "/v1/payment_method_domains",
|
34
|
+
params: params,
|
35
|
+
opts: opts
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Updates an existing payment method domain.
|
40
|
+
def self.update(payment_method_domain, params = {}, opts = {})
|
41
|
+
request_stripe_object(
|
42
|
+
method: :post,
|
43
|
+
path: format("/v1/payment_method_domains/%<payment_method_domain>s", { payment_method_domain: CGI.escape(payment_method_domain) }),
|
44
|
+
params: params,
|
45
|
+
opts: opts
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain.
|
50
|
+
# The payment method doesn't appear in Elements for this domain until it is active.
|
51
|
+
#
|
52
|
+
# To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint.
|
53
|
+
#
|
54
|
+
# Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
|
55
|
+
def validate(params = {}, opts = {})
|
56
|
+
request_stripe_object(
|
57
|
+
method: :post,
|
58
|
+
path: format("/v1/payment_method_domains/%<payment_method_domain>s/validate", { payment_method_domain: CGI.escape(self["id"]) }),
|
59
|
+
params: params,
|
60
|
+
opts: opts
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
# Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain.
|
65
|
+
# The payment method doesn't appear in Elements for this domain until it is active.
|
66
|
+
#
|
67
|
+
# To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint.
|
68
|
+
#
|
69
|
+
# Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
|
70
|
+
def self.validate(payment_method_domain, params = {}, opts = {})
|
71
|
+
request_stripe_object(
|
72
|
+
method: :post,
|
73
|
+
path: format("/v1/payment_method_domains/%<payment_method_domain>s/validate", { payment_method_domain: CGI.escape(payment_method_domain) }),
|
74
|
+
params: params,
|
75
|
+
opts: opts
|
76
|
+
)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -2,29 +2,87 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A `Payout` object is created when you receive funds from Stripe, or when you
|
6
|
+
# initiate a payout to either a bank account or debit card of a [connected
|
7
|
+
# Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts,
|
8
|
+
# and list all payouts. Payouts are made on [varying
|
9
|
+
# schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and
|
10
|
+
# industry.
|
11
|
+
#
|
12
|
+
# Related guide: [Receiving payouts](https://stripe.com/docs/payouts)
|
5
13
|
class Payout < APIResource
|
6
14
|
extend Stripe::APIOperations::Create
|
7
15
|
extend Stripe::APIOperations::List
|
8
16
|
include Stripe::APIOperations::Save
|
9
17
|
|
10
18
|
OBJECT_NAME = "payout"
|
19
|
+
def self.object_name
|
20
|
+
"payout"
|
21
|
+
end
|
11
22
|
|
12
|
-
|
13
|
-
custom_method :reverse, http_verb: :post
|
14
|
-
|
23
|
+
# You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts.
|
15
24
|
def cancel(params = {}, opts = {})
|
16
25
|
request_stripe_object(
|
17
26
|
method: :post,
|
18
|
-
path:
|
27
|
+
path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(self["id"]) }),
|
28
|
+
params: params,
|
29
|
+
opts: opts
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
# You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts.
|
34
|
+
def self.cancel(payout, params = {}, opts = {})
|
35
|
+
request_stripe_object(
|
36
|
+
method: :post,
|
37
|
+
path: format("/v1/payouts/%<payout>s/cancel", { payout: CGI.escape(payout) }),
|
19
38
|
params: params,
|
20
39
|
opts: opts
|
21
40
|
)
|
22
41
|
end
|
23
42
|
|
43
|
+
# To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error.
|
44
|
+
#
|
45
|
+
# If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode.
|
46
|
+
#
|
47
|
+
# If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type.
|
48
|
+
def self.create(params = {}, opts = {})
|
49
|
+
request_stripe_object(method: :post, path: "/v1/payouts", params: params, opts: opts)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first.
|
53
|
+
def self.list(params = {}, opts = {})
|
54
|
+
request_stripe_object(method: :get, path: "/v1/payouts", params: params, opts: opts)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead.
|
58
|
+
#
|
59
|
+
# By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
|
24
60
|
def reverse(params = {}, opts = {})
|
25
61
|
request_stripe_object(
|
26
62
|
method: :post,
|
27
|
-
path:
|
63
|
+
path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(self["id"]) }),
|
64
|
+
params: params,
|
65
|
+
opts: opts
|
66
|
+
)
|
67
|
+
end
|
68
|
+
|
69
|
+
# Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead.
|
70
|
+
#
|
71
|
+
# By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
|
72
|
+
def self.reverse(payout, params = {}, opts = {})
|
73
|
+
request_stripe_object(
|
74
|
+
method: :post,
|
75
|
+
path: format("/v1/payouts/%<payout>s/reverse", { payout: CGI.escape(payout) }),
|
76
|
+
params: params,
|
77
|
+
opts: opts
|
78
|
+
)
|
79
|
+
end
|
80
|
+
|
81
|
+
# Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments.
|
82
|
+
def self.update(payout, params = {}, opts = {})
|
83
|
+
request_stripe_object(
|
84
|
+
method: :post,
|
85
|
+
path: format("/v1/payouts/%<payout>s", { payout: CGI.escape(payout) }),
|
28
86
|
params: params,
|
29
87
|
opts: opts
|
30
88
|
)
|
@@ -2,11 +2,18 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# This is an object representing a person associated with a Stripe account.
|
6
|
+
#
|
7
|
+
# A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding.
|
8
|
+
#
|
9
|
+
# See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information).
|
5
10
|
class Person < APIResource
|
6
|
-
extend Stripe::APIOperations::List
|
7
11
|
include Stripe::APIOperations::Save
|
8
12
|
|
9
13
|
OBJECT_NAME = "person"
|
14
|
+
def self.object_name
|
15
|
+
"person"
|
16
|
+
end
|
10
17
|
|
11
18
|
def resource_url
|
12
19
|
if !respond_to?(:account) || account.nil?
|
@@ -2,6 +2,14 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.
|
6
|
+
#
|
7
|
+
# Plans define the base price, currency, and billing cycle for recurring purchases of products.
|
8
|
+
# [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
|
9
|
+
#
|
10
|
+
# For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.
|
11
|
+
#
|
12
|
+
# Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview).
|
5
13
|
class Plan < APIResource
|
6
14
|
extend Stripe::APIOperations::Create
|
7
15
|
include Stripe::APIOperations::Delete
|
@@ -9,5 +17,48 @@ module Stripe
|
|
9
17
|
include Stripe::APIOperations::Save
|
10
18
|
|
11
19
|
OBJECT_NAME = "plan"
|
20
|
+
def self.object_name
|
21
|
+
"plan"
|
22
|
+
end
|
23
|
+
|
24
|
+
# You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.
|
25
|
+
def self.create(params = {}, opts = {})
|
26
|
+
request_stripe_object(method: :post, path: "/v1/plans", params: params, opts: opts)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Deleting plans means new subscribers can't be added. Existing subscribers aren't affected.
|
30
|
+
def self.delete(plan, params = {}, opts = {})
|
31
|
+
request_stripe_object(
|
32
|
+
method: :delete,
|
33
|
+
path: format("/v1/plans/%<plan>s", { plan: CGI.escape(plan) }),
|
34
|
+
params: params,
|
35
|
+
opts: opts
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Deleting plans means new subscribers can't be added. Existing subscribers aren't affected.
|
40
|
+
def delete(params = {}, opts = {})
|
41
|
+
request_stripe_object(
|
42
|
+
method: :delete,
|
43
|
+
path: format("/v1/plans/%<plan>s", { plan: CGI.escape(self["id"]) }),
|
44
|
+
params: params,
|
45
|
+
opts: opts
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Returns a list of your plans.
|
50
|
+
def self.list(params = {}, opts = {})
|
51
|
+
request_stripe_object(method: :get, path: "/v1/plans", params: params, opts: opts)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle.
|
55
|
+
def self.update(plan, params = {}, opts = {})
|
56
|
+
request_stripe_object(
|
57
|
+
method: :post,
|
58
|
+
path: format("/v1/plans/%<plan>s", { plan: CGI.escape(plan) }),
|
59
|
+
params: params,
|
60
|
+
opts: opts
|
61
|
+
)
|
62
|
+
end
|
12
63
|
end
|
13
64
|
end
|
@@ -2,6 +2,12 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.
|
6
|
+
# [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.
|
7
|
+
#
|
8
|
+
# For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.
|
9
|
+
#
|
10
|
+
# Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview).
|
5
11
|
class Price < APIResource
|
6
12
|
extend Stripe::APIOperations::Create
|
7
13
|
extend Stripe::APIOperations::List
|
@@ -9,13 +15,36 @@ module Stripe
|
|
9
15
|
include Stripe::APIOperations::Save
|
10
16
|
|
11
17
|
OBJECT_NAME = "price"
|
18
|
+
def self.object_name
|
19
|
+
"price"
|
20
|
+
end
|
21
|
+
|
22
|
+
# Creates a new price for an existing product. The price can be recurring or one-time.
|
23
|
+
def self.create(params = {}, opts = {})
|
24
|
+
request_stripe_object(method: :post, path: "/v1/prices", params: params, opts: opts)
|
25
|
+
end
|
26
|
+
|
27
|
+
# 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.
|
28
|
+
def self.list(params = {}, opts = {})
|
29
|
+
request_stripe_object(method: :get, path: "/v1/prices", params: params, opts: opts)
|
30
|
+
end
|
12
31
|
|
13
32
|
def self.search(params = {}, opts = {})
|
14
|
-
|
33
|
+
request_stripe_object(method: :get, path: "/v1/prices/search", params: params, opts: opts)
|
15
34
|
end
|
16
35
|
|
17
36
|
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
18
37
|
search(params, opts).auto_paging_each(&blk)
|
19
38
|
end
|
39
|
+
|
40
|
+
# Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.
|
41
|
+
def self.update(price, params = {}, opts = {})
|
42
|
+
request_stripe_object(
|
43
|
+
method: :post,
|
44
|
+
path: format("/v1/prices/%<price>s", { price: CGI.escape(price) }),
|
45
|
+
params: params,
|
46
|
+
opts: opts
|
47
|
+
)
|
48
|
+
end
|
20
49
|
end
|
21
50
|
end
|
@@ -2,21 +2,75 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# Products describe the specific goods or services you offer to your customers.
|
6
|
+
# For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product.
|
7
|
+
# They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions.
|
8
|
+
#
|
9
|
+
# Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription),
|
10
|
+
# [share a Payment Link](https://stripe.com/docs/payment-links),
|
11
|
+
# [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront),
|
12
|
+
# and more about [Products and Prices](https://stripe.com/docs/products-prices/overview)
|
5
13
|
class Product < APIResource
|
6
14
|
extend Stripe::APIOperations::Create
|
7
15
|
include Stripe::APIOperations::Delete
|
8
16
|
extend Stripe::APIOperations::List
|
17
|
+
extend Stripe::APIOperations::NestedResource
|
9
18
|
extend Stripe::APIOperations::Search
|
10
19
|
include Stripe::APIOperations::Save
|
11
20
|
|
12
21
|
OBJECT_NAME = "product"
|
22
|
+
def self.object_name
|
23
|
+
"product"
|
24
|
+
end
|
25
|
+
|
26
|
+
nested_resource_class_methods :feature, operations: %i[create retrieve delete list]
|
27
|
+
|
28
|
+
# Creates a new product object.
|
29
|
+
def self.create(params = {}, opts = {})
|
30
|
+
request_stripe_object(method: :post, path: "/v1/products", params: params, opts: opts)
|
31
|
+
end
|
32
|
+
|
33
|
+
# 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.
|
34
|
+
def self.delete(id, params = {}, opts = {})
|
35
|
+
request_stripe_object(
|
36
|
+
method: :delete,
|
37
|
+
path: format("/v1/products/%<id>s", { id: CGI.escape(id) }),
|
38
|
+
params: params,
|
39
|
+
opts: opts
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
# 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.
|
44
|
+
def delete(params = {}, opts = {})
|
45
|
+
request_stripe_object(
|
46
|
+
method: :delete,
|
47
|
+
path: format("/v1/products/%<id>s", { id: CGI.escape(self["id"]) }),
|
48
|
+
params: params,
|
49
|
+
opts: opts
|
50
|
+
)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
|
54
|
+
def self.list(params = {}, opts = {})
|
55
|
+
request_stripe_object(method: :get, path: "/v1/products", params: params, opts: opts)
|
56
|
+
end
|
13
57
|
|
14
58
|
def self.search(params = {}, opts = {})
|
15
|
-
|
59
|
+
request_stripe_object(method: :get, path: "/v1/products/search", params: params, opts: opts)
|
16
60
|
end
|
17
61
|
|
18
62
|
def self.search_auto_paging_each(params = {}, opts = {}, &blk)
|
19
63
|
search(params, opts).auto_paging_each(&blk)
|
20
64
|
end
|
65
|
+
|
66
|
+
# Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
67
|
+
def self.update(id, params = {}, opts = {})
|
68
|
+
request_stripe_object(
|
69
|
+
method: :post,
|
70
|
+
path: format("/v1/products/%<id>s", { id: CGI.escape(id) }),
|
71
|
+
params: params,
|
72
|
+
opts: opts
|
73
|
+
)
|
74
|
+
end
|
21
75
|
end
|
22
76
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# A product_feature represents an attachment between a feature and a product.
|
6
|
+
# When a product is purchased that has a feature attached, Stripe will create an entitlement to the feature for the purchasing customer.
|
7
|
+
class ProductFeature < APIResource
|
8
|
+
OBJECT_NAME = "product_feature"
|
9
|
+
def self.object_name
|
10
|
+
"product_feature"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -2,11 +2,36 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
+
# A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). It can be used to
|
6
|
+
# create multiple codes for a single coupon.
|
5
7
|
class PromotionCode < APIResource
|
6
8
|
extend Stripe::APIOperations::Create
|
7
9
|
extend Stripe::APIOperations::List
|
8
10
|
include Stripe::APIOperations::Save
|
9
11
|
|
10
12
|
OBJECT_NAME = "promotion_code"
|
13
|
+
def self.object_name
|
14
|
+
"promotion_code"
|
15
|
+
end
|
16
|
+
|
17
|
+
# A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.
|
18
|
+
def self.create(params = {}, opts = {})
|
19
|
+
request_stripe_object(method: :post, path: "/v1/promotion_codes", params: params, opts: opts)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns a list of your promotion codes.
|
23
|
+
def self.list(params = {}, opts = {})
|
24
|
+
request_stripe_object(method: :get, path: "/v1/promotion_codes", params: params, opts: opts)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.
|
28
|
+
def self.update(promotion_code, params = {}, opts = {})
|
29
|
+
request_stripe_object(
|
30
|
+
method: :post,
|
31
|
+
path: format("/v1/promotion_codes/%<promotion_code>s", { promotion_code: CGI.escape(promotion_code) }),
|
32
|
+
params: params,
|
33
|
+
opts: opts
|
34
|
+
)
|
35
|
+
end
|
11
36
|
end
|
12
37
|
end
|