stripe 15.6.0.pre.alpha.1 → 15.6.0.pre.alpha.3
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/API_VERSION +1 -1
- data/CHANGELOG.md +27 -6
- data/OPENAPI_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/stripe/event_types.rb +5 -1
- data/lib/stripe/events/v2_billing_cadence_billed_event.rb +2 -0
- data/lib/stripe/events/{v2_billing_cadence_errored_event.rb → v2_core_claimable_sandbox_claimed_event.rb} +3 -3
- data/lib/stripe/events/v2_core_claimable_sandbox_expired_event.rb +21 -0
- data/lib/stripe/events/v2_core_claimable_sandbox_expiring_event.rb +21 -0
- data/lib/stripe/events/v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event.rb +21 -0
- data/lib/stripe/resources/account.rb +443 -0
- data/lib/stripe/resources/account_link.rb +8 -0
- data/lib/stripe/resources/account_notice.rb +24 -0
- data/lib/stripe/resources/account_session.rb +435 -10
- data/lib/stripe/resources/apple_pay_domain.rb +8 -0
- data/lib/stripe/resources/application.rb +8 -0
- data/lib/stripe/resources/application_fee.rb +16 -0
- data/lib/stripe/resources/application_fee_refund.rb +8 -0
- data/lib/stripe/resources/apps/secret.rb +16 -0
- data/lib/stripe/resources/balance.rb +159 -0
- data/lib/stripe/resources/balance_settings.rb +40 -0
- data/lib/stripe/resources/balance_transaction.rb +16 -0
- data/lib/stripe/resources/bank_account.rb +40 -0
- data/lib/stripe/resources/billing/alert.rb +75 -0
- data/lib/stripe/resources/billing/alert_triggered.rb +8 -0
- data/lib/stripe/resources/billing/credit_balance_summary.rb +80 -0
- data/lib/stripe/resources/billing/credit_balance_transaction.rb +107 -0
- data/lib/stripe/resources/billing/credit_grant.rb +72 -0
- data/lib/stripe/resources/billing/meter.rb +45 -0
- data/lib/stripe/resources/billing/meter_event.rb +8 -0
- data/lib/stripe/resources/billing/meter_event_adjustment.rb +16 -0
- data/lib/stripe/resources/billing/meter_event_summary.rb +8 -0
- data/lib/stripe/resources/billing/meter_usage.rb +8 -0
- data/lib/stripe/resources/billing/meter_usage_row.rb +8 -0
- data/lib/stripe/resources/billing_portal/configuration.rb +122 -0
- data/lib/stripe/resources/billing_portal/session.rb +101 -0
- data/lib/stripe/resources/capability.rb +56 -0
- data/lib/stripe/resources/capital/financing_offer.rb +24 -0
- data/lib/stripe/resources/capital/financing_summary.rb +24 -0
- data/lib/stripe/resources/capital/financing_transaction.rb +24 -0
- data/lib/stripe/resources/card.rb +16 -0
- data/lib/stripe/resources/cash_balance.rb +16 -0
- data/lib/stripe/resources/charge.rb +1052 -16
- data/lib/stripe/resources/checkout/session.rb +950 -0
- data/lib/stripe/resources/climate/order.rb +32 -0
- data/lib/stripe/resources/climate/product.rb +16 -0
- data/lib/stripe/resources/climate/supplier.rb +16 -0
- data/lib/stripe/resources/confirmation_token.rb +960 -38
- data/lib/stripe/resources/connect_collection_transfer.rb +8 -0
- data/lib/stripe/resources/country_spec.rb +32 -0
- data/lib/stripe/resources/coupon.rb +36 -0
- data/lib/stripe/resources/credit_note.rb +70 -0
- data/lib/stripe/resources/credit_note_line_item.rb +53 -0
- data/lib/stripe/resources/customer.rb +77 -0
- data/lib/stripe/resources/customer_balance_transaction.rb +8 -0
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +108 -0
- data/lib/stripe/resources/customer_session.rb +52 -0
- data/lib/stripe/resources/discount.rb +8 -0
- data/lib/stripe/resources/dispute.rb +166 -0
- data/lib/stripe/resources/entitlements/active_entitlement.rb +8 -0
- data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +8 -0
- data/lib/stripe/resources/entitlements/feature.rb +8 -0
- data/lib/stripe/resources/ephemeral_key.rb +8 -0
- data/lib/stripe/resources/event.rb +56 -0
- data/lib/stripe/resources/exchange_rate.rb +8 -0
- data/lib/stripe/resources/file.rb +8 -0
- data/lib/stripe/resources/file_link.rb +8 -0
- data/lib/stripe/resources/financial_connections/account.rb +79 -0
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +8 -0
- data/lib/stripe/resources/financial_connections/account_owner.rb +8 -0
- data/lib/stripe/resources/financial_connections/account_ownership.rb +8 -0
- data/lib/stripe/resources/financial_connections/institution.rb +53 -0
- data/lib/stripe/resources/financial_connections/session.rb +63 -1
- data/lib/stripe/resources/financial_connections/transaction.rb +16 -0
- data/lib/stripe/resources/forwarding/request.rb +52 -0
- data/lib/stripe/resources/funding_instructions.rb +193 -0
- data/lib/stripe/resources/fx_quote.rb +48 -0
- data/lib/stripe/resources/identity/verification_report.rb +166 -1
- data/lib/stripe/resources/identity/verification_session.rb +126 -1
- data/lib/stripe/resources/invoice.rb +441 -3
- data/lib/stripe/resources/invoice_item.rb +88 -0
- data/lib/stripe/resources/invoice_line_item.rb +186 -0
- data/lib/stripe/resources/invoice_payment.rb +24 -0
- data/lib/stripe/resources/invoice_rendering_template.rb +8 -0
- data/lib/stripe/resources/issuing/authorization.rb +177 -0
- data/lib/stripe/resources/issuing/card.rb +96 -0
- data/lib/stripe/resources/issuing/cardholder.rb +110 -0
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +82 -0
- data/lib/stripe/resources/issuing/dispute.rb +97 -0
- data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +16 -0
- data/lib/stripe/resources/issuing/fraud_liability_debit.rb +8 -0
- data/lib/stripe/resources/issuing/personalization_design.rb +36 -0
- data/lib/stripe/resources/issuing/physical_bundle.rb +16 -0
- data/lib/stripe/resources/issuing/settlement.rb +8 -0
- data/lib/stripe/resources/issuing/token.rb +61 -0
- data/lib/stripe/resources/issuing/transaction.rb +151 -0
- data/lib/stripe/resources/line_item.rb +54 -0
- data/lib/stripe/resources/login_link.rb +8 -0
- data/lib/stripe/resources/mandate.rb +242 -11
- data/lib/stripe/resources/margin.rb +8 -0
- data/lib/stripe/resources/order.rb +348 -0
- data/lib/stripe/resources/payment_attempt_record.rb +890 -11
- data/lib/stripe/resources/payment_intent.rb +1405 -3
- data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +56 -0
- data/lib/stripe/resources/payment_link.rb +337 -0
- data/lib/stripe/resources/payment_method.rb +884 -38
- data/lib/stripe/resources/payment_method_configuration.rb +961 -0
- data/lib/stripe/resources/payment_method_domain.rb +111 -0
- data/lib/stripe/resources/payment_record.rb +890 -11
- data/lib/stripe/resources/payout.rb +16 -0
- data/lib/stripe/resources/person.rb +180 -0
- data/lib/stripe/resources/plan.rb +24 -0
- data/lib/stripe/resources/price.rb +79 -0
- data/lib/stripe/resources/privacy/redaction_job.rb +16 -0
- data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +16 -0
- data/lib/stripe/resources/product.rb +27 -0
- data/lib/stripe/resources/product_feature.rb +8 -0
- data/lib/stripe/resources/promotion_code.rb +24 -0
- data/lib/stripe/resources/quote.rb +432 -0
- data/lib/stripe/resources/quote_line.rb +247 -0
- data/lib/stripe/resources/quote_preview_invoice.rb +450 -3
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +323 -0
- data/lib/stripe/resources/radar/early_fraud_warning.rb +8 -0
- data/lib/stripe/resources/radar/value_list.rb +8 -0
- data/lib/stripe/resources/radar/value_list_item.rb +8 -0
- data/lib/stripe/resources/refund.rb +380 -19
- data/lib/stripe/resources/reporting/report_run.rb +16 -0
- data/lib/stripe/resources/reporting/report_type.rb +8 -0
- data/lib/stripe/resources/reserve_transaction.rb +8 -0
- data/lib/stripe/resources/reversal.rb +8 -0
- data/lib/stripe/resources/review.rb +24 -0
- data/lib/stripe/resources/setup_attempt.rb +331 -20
- data/lib/stripe/resources/setup_intent.rb +293 -2
- data/lib/stripe/resources/shipping_rate.rb +48 -0
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +16 -0
- data/lib/stripe/resources/source.rb +274 -0
- data/lib/stripe/resources/source_mandate_notification.rb +32 -0
- data/lib/stripe/resources/source_transaction.rb +54 -0
- data/lib/stripe/resources/subscription.rb +318 -3
- data/lib/stripe/resources/subscription_item.rb +24 -0
- data/lib/stripe/resources/subscription_schedule.rb +314 -0
- data/lib/stripe/resources/tax/association.rb +32 -0
- data/lib/stripe/resources/tax/calculation.rb +109 -0
- data/lib/stripe/resources/tax/calculation_line_item.rb +32 -0
- data/lib/stripe/resources/tax/form.rb +107 -0
- data/lib/stripe/resources/tax/registration.rb +1232 -0
- data/lib/stripe/resources/tax/settings.rb +61 -1
- data/lib/stripe/resources/tax/transaction.rb +93 -0
- data/lib/stripe/resources/tax/transaction_line_item.rb +16 -0
- data/lib/stripe/resources/tax_code.rb +8 -0
- data/lib/stripe/resources/tax_deducted_at_source.rb +8 -0
- data/lib/stripe/resources/tax_id.rb +24 -0
- data/lib/stripe/resources/tax_rate.rb +16 -0
- data/lib/stripe/resources/terminal/configuration.rb +299 -0
- data/lib/stripe/resources/terminal/connection_token.rb +8 -0
- data/lib/stripe/resources/terminal/location.rb +16 -0
- data/lib/stripe/resources/terminal/onboarding_link.rb +24 -0
- data/lib/stripe/resources/terminal/reader.rb +241 -0
- data/lib/stripe/resources/terminal/reader_collected_data.rb +16 -0
- data/lib/stripe/resources/test_helpers/test_clock.rb +24 -0
- data/lib/stripe/resources/token.rb +8 -0
- data/lib/stripe/resources/topup.rb +8 -0
- data/lib/stripe/resources/transfer.rb +8 -0
- data/lib/stripe/resources/treasury/credit_reversal.rb +16 -0
- data/lib/stripe/resources/treasury/debit_reversal.rb +24 -0
- data/lib/stripe/resources/treasury/financial_account.rb +61 -0
- data/lib/stripe/resources/treasury/financial_account_features.rb +192 -0
- data/lib/stripe/resources/treasury/inbound_transfer.rb +69 -0
- data/lib/stripe/resources/treasury/outbound_payment.rb +106 -0
- data/lib/stripe/resources/treasury/outbound_transfer.rb +114 -0
- data/lib/stripe/resources/treasury/received_credit.rb +97 -0
- data/lib/stripe/resources/treasury/received_debit.rb +89 -0
- data/lib/stripe/resources/treasury/transaction.rb +36 -0
- data/lib/stripe/resources/treasury/transaction_entry.rb +24 -0
- data/lib/stripe/resources/v2/billing/bill_setting.rb +40 -0
- data/lib/stripe/resources/v2/billing/bill_setting_version.rb +40 -0
- data/lib/stripe/resources/v2/billing/cadence.rb +144 -0
- data/lib/stripe/resources/v2/billing/collection_setting.rb +150 -2
- data/lib/stripe/resources/v2/billing/collection_setting_version.rb +150 -2
- data/lib/stripe/resources/v2/billing/custom_pricing_unit.rb +8 -0
- data/lib/stripe/resources/v2/billing/intent.rb +27 -0
- data/lib/stripe/resources/v2/billing/intent_action.rb +195 -0
- data/lib/stripe/resources/v2/billing/license_fee.rb +24 -0
- data/lib/stripe/resources/v2/billing/license_fee_subscription.rb +8 -0
- data/lib/stripe/resources/v2/billing/license_fee_version.rb +24 -0
- data/lib/stripe/resources/v2/billing/licensed_item.rb +16 -0
- data/lib/stripe/resources/v2/billing/meter_event.rb +8 -0
- data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +16 -0
- data/lib/stripe/resources/v2/billing/meter_event_session.rb +8 -0
- data/lib/stripe/resources/v2/billing/metered_item.rb +27 -0
- data/lib/stripe/resources/v2/billing/pricing_plan.rb +8 -0
- data/lib/stripe/resources/v2/billing/pricing_plan_component.rb +36 -0
- data/lib/stripe/resources/v2/billing/pricing_plan_subscription.rb +31 -0
- data/lib/stripe/resources/v2/billing/pricing_plan_version.rb +8 -0
- data/lib/stripe/resources/v2/billing/profile.rb +8 -0
- data/lib/stripe/resources/v2/billing/rate_card.rb +8 -0
- data/lib/stripe/resources/v2/billing/rate_card_rate.rb +36 -0
- data/lib/stripe/resources/v2/billing/rate_card_subscription.rb +31 -0
- data/lib/stripe/resources/v2/billing/rate_card_version.rb +8 -0
- data/lib/stripe/resources/v2/billing/service_action.rb +123 -0
- data/lib/stripe/resources/v2/core/account.rb +1900 -0
- data/lib/stripe/resources/v2/core/account_link.rb +51 -0
- data/lib/stripe/resources/v2/core/claimable_sandbox.rb +60 -12
- data/lib/stripe/resources/v2/core/person.rb +201 -0
- data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +40 -0
- data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +8 -0
- data/lib/stripe/resources/v2/event.rb +24 -0
- data/lib/stripe/resources/v2/event_destination.rb +44 -0
- data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +8 -0
- data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +8 -0
- data/lib/stripe/resources/v2/money_management/adjustment.rb +16 -0
- data/lib/stripe/resources/v2/money_management/financial_account.rb +61 -0
- data/lib/stripe/resources/v2/money_management/financial_address.rb +32 -0
- data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +90 -3
- data/lib/stripe/resources/v2/money_management/outbound_payment.rb +88 -0
- data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +62 -0
- data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +24 -0
- data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +79 -0
- data/lib/stripe/resources/v2/money_management/payout_method.rb +32 -0
- data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +32 -0
- data/lib/stripe/resources/v2/money_management/received_credit.rb +77 -0
- data/lib/stripe/resources/v2/money_management/received_debit.rb +52 -0
- data/lib/stripe/resources/v2/money_management/transaction.rb +36 -0
- data/lib/stripe/resources/v2/money_management/transaction_entry.rb +35 -0
- data/lib/stripe/resources/v2/payments/off_session_payment.rb +24 -0
- data/lib/stripe/resources/v2/reporting/report.rb +52 -0
- data/lib/stripe/resources/v2/reporting/report_run.rb +69 -0
- data/lib/stripe/resources/v2/tax/automatic_rule.rb +8 -0
- data/lib/stripe/resources/webhook_endpoint.rb +8 -0
- data/lib/stripe/resources.rb +4 -1
- data/lib/stripe/services/v2/billing/cadence_service.rb +7 -1
- data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +1 -1
- data/lib/stripe/services/v2/billing/service_action_service.rb +23 -2
- data/lib/stripe/services/v2/core/claimable_sandbox_service.rb +15 -0
- data/lib/stripe/stripe_object.rb +25 -1
- data/lib/stripe/util.rb +9 -5
- data/lib/stripe/version.rb +1 -1
- data/rbi/stripe.rbi +280275 -0
- metadata +7 -3
@@ -16,16 +16,40 @@ module Stripe
|
|
16
16
|
class EnumDetails < Stripe::StripeObject
|
17
17
|
# Allowed values of the enum.
|
18
18
|
attr_reader :allowed_values
|
19
|
+
|
20
|
+
def self.inner_class_types
|
21
|
+
@inner_class_types = {}
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.field_remappings
|
25
|
+
@field_remappings = {}
|
26
|
+
end
|
19
27
|
end
|
20
28
|
# Data type of the elements in the array.
|
21
29
|
attr_reader :element_type
|
22
30
|
# Details about enum elements in the array.
|
23
31
|
attr_reader :enum_details
|
32
|
+
|
33
|
+
def self.inner_class_types
|
34
|
+
@inner_class_types = { enum_details: EnumDetails }
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.field_remappings
|
38
|
+
@field_remappings = {}
|
39
|
+
end
|
24
40
|
end
|
25
41
|
|
26
42
|
class EnumDetails < Stripe::StripeObject
|
27
43
|
# Allowed values of the enum.
|
28
44
|
attr_reader :allowed_values
|
45
|
+
|
46
|
+
def self.inner_class_types
|
47
|
+
@inner_class_types = {}
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.field_remappings
|
51
|
+
@field_remappings = {}
|
52
|
+
end
|
29
53
|
end
|
30
54
|
|
31
55
|
class TimestampDetails < Stripe::StripeObject
|
@@ -33,6 +57,14 @@ module Stripe
|
|
33
57
|
attr_reader :max
|
34
58
|
# Minimum permitted timestamp which can be requested.
|
35
59
|
attr_reader :min
|
60
|
+
|
61
|
+
def self.inner_class_types
|
62
|
+
@inner_class_types = {}
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.field_remappings
|
66
|
+
@field_remappings = {}
|
67
|
+
end
|
36
68
|
end
|
37
69
|
# For array parameters, provides details about the array elements.
|
38
70
|
attr_reader :array_details
|
@@ -46,6 +78,18 @@ module Stripe
|
|
46
78
|
attr_reader :timestamp_details
|
47
79
|
# The data type of the parameter.
|
48
80
|
attr_reader :type
|
81
|
+
|
82
|
+
def self.inner_class_types
|
83
|
+
@inner_class_types = {
|
84
|
+
array_details: ArrayDetails,
|
85
|
+
enum_details: EnumDetails,
|
86
|
+
timestamp_details: TimestampDetails,
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.field_remappings
|
91
|
+
@field_remappings = {}
|
92
|
+
end
|
49
93
|
end
|
50
94
|
# The unique identifier of the `Report` object.
|
51
95
|
attr_reader :id
|
@@ -58,6 +102,14 @@ module Stripe
|
|
58
102
|
attr_reader :parameters
|
59
103
|
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
60
104
|
attr_reader :livemode
|
105
|
+
|
106
|
+
def self.inner_class_types
|
107
|
+
@inner_class_types = { parameters: Parameters }
|
108
|
+
end
|
109
|
+
|
110
|
+
def self.field_remappings
|
111
|
+
@field_remappings = {}
|
112
|
+
end
|
61
113
|
end
|
62
114
|
end
|
63
115
|
end
|
@@ -17,6 +17,14 @@ module Stripe
|
|
17
17
|
class ArrayValue < Stripe::StripeObject
|
18
18
|
# The list of string values in the array.
|
19
19
|
attr_reader :items
|
20
|
+
|
21
|
+
def self.inner_class_types
|
22
|
+
@inner_class_types = {}
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.field_remappings
|
26
|
+
@field_remappings = {}
|
27
|
+
end
|
20
28
|
end
|
21
29
|
# Parameter with an array data type.
|
22
30
|
attr_reader :array_value
|
@@ -24,6 +32,14 @@ module Stripe
|
|
24
32
|
attr_reader :string_value
|
25
33
|
# Parameter with a timestamp data type.
|
26
34
|
attr_reader :timestamp_value
|
35
|
+
|
36
|
+
def self.inner_class_types
|
37
|
+
@inner_class_types = { array_value: ArrayValue }
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.field_remappings
|
41
|
+
@field_remappings = {}
|
42
|
+
end
|
27
43
|
end
|
28
44
|
|
29
45
|
class Result < Stripe::StripeObject
|
@@ -33,6 +49,14 @@ module Stripe
|
|
33
49
|
attr_reader :expires_at
|
34
50
|
# The URL that can be used for accessing the file.
|
35
51
|
attr_reader :url
|
52
|
+
|
53
|
+
def self.inner_class_types
|
54
|
+
@inner_class_types = {}
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.field_remappings
|
58
|
+
@field_remappings = {}
|
59
|
+
end
|
36
60
|
end
|
37
61
|
# The content type of the file.
|
38
62
|
attr_reader :content_type
|
@@ -40,18 +64,42 @@ module Stripe
|
|
40
64
|
attr_reader :download_url
|
41
65
|
# The total size of the file in bytes.
|
42
66
|
attr_reader :size
|
67
|
+
|
68
|
+
def self.inner_class_types
|
69
|
+
@inner_class_types = { download_url: DownloadUrl }
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.field_remappings
|
73
|
+
@field_remappings = {}
|
74
|
+
end
|
43
75
|
end
|
44
76
|
# Contains metadata about the file produced by the `ReportRun`, including
|
45
77
|
# its content type, size, and a URL to download its contents.
|
46
78
|
attr_reader :file
|
47
79
|
# The type of the `ReportRun` result.
|
48
80
|
attr_reader :type
|
81
|
+
|
82
|
+
def self.inner_class_types
|
83
|
+
@inner_class_types = { file: File }
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.field_remappings
|
87
|
+
@field_remappings = {}
|
88
|
+
end
|
49
89
|
end
|
50
90
|
|
51
91
|
class ResultOptions < Stripe::StripeObject
|
52
92
|
# If set, the generated report file will be compressed into a ZIP folder.
|
53
93
|
# This is useful for reducing file size and download time for large reports.
|
54
94
|
attr_reader :compress_file
|
95
|
+
|
96
|
+
def self.inner_class_types
|
97
|
+
@inner_class_types = {}
|
98
|
+
end
|
99
|
+
|
100
|
+
def self.field_remappings
|
101
|
+
@field_remappings = {}
|
102
|
+
end
|
55
103
|
end
|
56
104
|
|
57
105
|
class StatusDetails < Stripe::StripeObject
|
@@ -59,6 +107,14 @@ module Stripe
|
|
59
107
|
attr_reader :error_code
|
60
108
|
# Error message with additional details about the failure.
|
61
109
|
attr_reader :error_message
|
110
|
+
|
111
|
+
def self.inner_class_types
|
112
|
+
@inner_class_types = {}
|
113
|
+
end
|
114
|
+
|
115
|
+
def self.field_remappings
|
116
|
+
@field_remappings = {}
|
117
|
+
end
|
62
118
|
end
|
63
119
|
# Time at which the object was created.
|
64
120
|
attr_reader :created
|
@@ -83,6 +139,19 @@ module Stripe
|
|
83
139
|
attr_reader :status_details
|
84
140
|
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
85
141
|
attr_reader :livemode
|
142
|
+
|
143
|
+
def self.inner_class_types
|
144
|
+
@inner_class_types = {
|
145
|
+
report_parameters: ReportParameters,
|
146
|
+
result: Result,
|
147
|
+
result_options: ResultOptions,
|
148
|
+
status_details: StatusDetails,
|
149
|
+
}
|
150
|
+
end
|
151
|
+
|
152
|
+
def self.field_remappings
|
153
|
+
@field_remappings = {}
|
154
|
+
end
|
86
155
|
end
|
87
156
|
end
|
88
157
|
end
|
@@ -25,6 +25,14 @@ module Stripe
|
|
25
25
|
attr_reader :tax_code
|
26
26
|
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
27
27
|
attr_reader :livemode
|
28
|
+
|
29
|
+
def self.inner_class_types
|
30
|
+
@inner_class_types = {}
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.field_remappings
|
34
|
+
@field_remappings = {}
|
35
|
+
end
|
28
36
|
end
|
29
37
|
end
|
30
38
|
end
|
data/lib/stripe/resources.rb
CHANGED
@@ -225,7 +225,6 @@ require "stripe/events/v1_billing_meter_no_meter_found_event"
|
|
225
225
|
require "stripe/events/v2_billing_cadence_billed_event"
|
226
226
|
require "stripe/events/v2_billing_cadence_canceled_event"
|
227
227
|
require "stripe/events/v2_billing_cadence_created_event"
|
228
|
-
require "stripe/events/v2_billing_cadence_errored_event"
|
229
228
|
require "stripe/events/v2_billing_license_fee_created_event"
|
230
229
|
require "stripe/events/v2_billing_license_fee_updated_event"
|
231
230
|
require "stripe/events/v2_billing_license_fee_version_created_event"
|
@@ -278,6 +277,10 @@ require "stripe/events/v2_core_account_person_created_event"
|
|
278
277
|
require "stripe/events/v2_core_account_person_deleted_event"
|
279
278
|
require "stripe/events/v2_core_account_person_updated_event"
|
280
279
|
require "stripe/events/v2_core_account_updated_event"
|
280
|
+
require "stripe/events/v2_core_claimable_sandbox_claimed_event"
|
281
|
+
require "stripe/events/v2_core_claimable_sandbox_expired_event"
|
282
|
+
require "stripe/events/v2_core_claimable_sandbox_expiring_event"
|
283
|
+
require "stripe/events/v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event"
|
281
284
|
require "stripe/events/v2_core_event_destination_ping_event"
|
282
285
|
require "stripe/events/v2_core_health_api_error_firing_event"
|
283
286
|
require "stripe/events/v2_core_health_api_error_resolved_event"
|
@@ -91,13 +91,19 @@ module Stripe
|
|
91
91
|
# billed, this will anchor to the last day of the month. If not provided,
|
92
92
|
# this will default to the day the cadence was created.
|
93
93
|
attr_accessor :day_of_month
|
94
|
+
# The month to anchor the billing on for a type="month" billing cycle from
|
95
|
+
# 1-12. If not provided, this will default to the month the cadence was created.
|
96
|
+
# This setting can only be used for monthly billing cycles with `interval_count` of 2, 3, 4 or 6.
|
97
|
+
# All occurrences will be calculated from month provided.
|
98
|
+
attr_accessor :month_of_year
|
94
99
|
# The time at which the billing cycle ends.
|
95
100
|
# This field is optional, and if not provided, it will default to
|
96
101
|
# the time at which the cadence was created in UTC timezone.
|
97
102
|
attr_accessor :time
|
98
103
|
|
99
|
-
def initialize(day_of_month: nil, time: nil)
|
104
|
+
def initialize(day_of_month: nil, month_of_year: nil, time: nil)
|
100
105
|
@day_of_month = day_of_month
|
106
|
+
@month_of_year = month_of_year
|
101
107
|
@time = time
|
102
108
|
end
|
103
109
|
end
|
@@ -65,16 +65,29 @@ module Stripe
|
|
65
65
|
attr_accessor :amount
|
66
66
|
# Defines the scope where the credit grant is applicable.
|
67
67
|
attr_accessor :applicability_config
|
68
|
+
# The category of the credit grant.
|
69
|
+
attr_accessor :category
|
68
70
|
# The expiry configuration for the credit grant.
|
69
71
|
attr_accessor :expiry_config
|
70
72
|
# A descriptive name shown in dashboard.
|
71
73
|
attr_accessor :name
|
74
|
+
# The desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100.
|
75
|
+
attr_accessor :priority
|
72
76
|
|
73
|
-
def initialize(
|
77
|
+
def initialize(
|
78
|
+
amount: nil,
|
79
|
+
applicability_config: nil,
|
80
|
+
category: nil,
|
81
|
+
expiry_config: nil,
|
82
|
+
name: nil,
|
83
|
+
priority: nil
|
84
|
+
)
|
74
85
|
@amount = amount
|
75
86
|
@applicability_config = applicability_config
|
87
|
+
@category = category
|
76
88
|
@expiry_config = expiry_config
|
77
89
|
@name = name
|
90
|
+
@priority = priority
|
78
91
|
end
|
79
92
|
end
|
80
93
|
|
@@ -179,25 +192,33 @@ module Stripe
|
|
179
192
|
attr_accessor :amount
|
180
193
|
# Defines the scope where the credit grant is applicable.
|
181
194
|
attr_accessor :applicability_config
|
195
|
+
# The category of the credit grant.
|
196
|
+
attr_accessor :category
|
182
197
|
# The expiry configuration for the credit grant.
|
183
198
|
attr_accessor :expiry_config
|
184
199
|
# The grant condition for the credit grant.
|
185
200
|
attr_accessor :grant_condition
|
186
201
|
# Customer-facing name for the credit grant.
|
187
202
|
attr_accessor :name
|
203
|
+
# The desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100.
|
204
|
+
attr_accessor :priority
|
188
205
|
|
189
206
|
def initialize(
|
190
207
|
amount: nil,
|
191
208
|
applicability_config: nil,
|
209
|
+
category: nil,
|
192
210
|
expiry_config: nil,
|
193
211
|
grant_condition: nil,
|
194
|
-
name: nil
|
212
|
+
name: nil,
|
213
|
+
priority: nil
|
195
214
|
)
|
196
215
|
@amount = amount
|
197
216
|
@applicability_config = applicability_config
|
217
|
+
@category = category
|
198
218
|
@expiry_config = expiry_config
|
199
219
|
@grant_condition = grant_condition
|
200
220
|
@name = name
|
221
|
+
@priority = priority
|
201
222
|
end
|
202
223
|
end
|
203
224
|
# An internal key you can use to search for this service action. Maximum length of 200 characters.
|
@@ -33,6 +33,8 @@ module Stripe
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
class RetrieveParams < Stripe::RequestParams; end
|
37
|
+
|
36
38
|
# Create an anonymous, claimable sandbox. This sandbox can be prefilled with data. The response will include
|
37
39
|
# a claim URL that allow a user to claim the account.
|
38
40
|
def create(params = {}, opts = {})
|
@@ -44,6 +46,19 @@ module Stripe
|
|
44
46
|
base_address: :api
|
45
47
|
)
|
46
48
|
end
|
49
|
+
|
50
|
+
# Retrieves the details of a claimable sandbox that was previously been created.
|
51
|
+
# Supply the unique claimable sandbox ID that was returned from your creation request,
|
52
|
+
# and Stripe will return the corresponding sandbox information.
|
53
|
+
def retrieve(id, params = {}, opts = {})
|
54
|
+
request(
|
55
|
+
method: :get,
|
56
|
+
path: format("/v2/core/claimable_sandboxes/%<id>s", { id: CGI.escape(id) }),
|
57
|
+
params: params,
|
58
|
+
opts: opts,
|
59
|
+
base_address: :api
|
60
|
+
)
|
61
|
+
end
|
47
62
|
end
|
48
63
|
end
|
49
64
|
end
|
data/lib/stripe/stripe_object.rb
CHANGED
@@ -154,12 +154,22 @@ module Stripe
|
|
154
154
|
def update_attributes(values, opts = {}, dirty: true)
|
155
155
|
values.each do |k, v|
|
156
156
|
add_accessors([k], values) unless metaclass.method_defined?(k.to_sym)
|
157
|
-
@values[k] =
|
157
|
+
@values[k] = convert_value_with_inner_types(k, v, opts)
|
158
158
|
dirty_value!(@values[k]) if dirty
|
159
159
|
@unsaved_values.add(k)
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
163
|
+
private def convert_value_with_inner_types(key, value, opts)
|
164
|
+
inner_class = _get_inner_class_type(key)
|
165
|
+
|
166
|
+
if inner_class
|
167
|
+
Util.convert_to_stripe_object(value, opts, api_mode: @api_mode, requestor: @requestor, klass: inner_class)
|
168
|
+
else
|
169
|
+
Util.convert_to_stripe_object(value, opts, api_mode: @api_mode, requestor: @requestor)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
163
173
|
def [](key)
|
164
174
|
@values[key.to_sym]
|
165
175
|
end
|
@@ -620,5 +630,19 @@ module Stripe
|
|
620
630
|
update[k] = ""
|
621
631
|
end
|
622
632
|
end
|
633
|
+
|
634
|
+
# Instance methods to get inner class types
|
635
|
+
def _get_inner_class_type(field_name)
|
636
|
+
self.class.inner_class_types[field_name.to_sym]
|
637
|
+
end
|
638
|
+
|
639
|
+
# Class methods for inner class types, similar to Python's implementation
|
640
|
+
def self.inner_class_types
|
641
|
+
@inner_class_types ||= {}
|
642
|
+
end
|
643
|
+
|
644
|
+
def self.field_remappings
|
645
|
+
@field_remappings ||= {}
|
646
|
+
end
|
623
647
|
end
|
624
648
|
end
|
data/lib/stripe/util.rb
CHANGED
@@ -99,8 +99,8 @@ module Stripe
|
|
99
99
|
# will be reused on subsequent API calls.
|
100
100
|
# * +opts+ - Options for +StripeObject+ like an API key that will be reused
|
101
101
|
# on subsequent API calls.
|
102
|
-
def self.convert_to_stripe_object(data, opts = {}, api_mode: :v1, requestor: nil)
|
103
|
-
convert_to_stripe_object_with_params(data, {}, opts, api_mode: api_mode, requestor: requestor)
|
102
|
+
def self.convert_to_stripe_object(data, opts = {}, api_mode: :v1, requestor: nil, klass: nil)
|
103
|
+
convert_to_stripe_object_with_params(data, {}, opts, api_mode: api_mode, requestor: requestor, klass: klass)
|
104
104
|
end
|
105
105
|
|
106
106
|
# Converts a hash of fields or an array of hashes into a +StripeObject+ or
|
@@ -124,13 +124,14 @@ module Stripe
|
|
124
124
|
opts = {},
|
125
125
|
last_response = nil,
|
126
126
|
api_mode: :v1,
|
127
|
-
requestor: nil
|
127
|
+
requestor: nil,
|
128
|
+
klass: nil
|
128
129
|
)
|
129
130
|
opts = normalize_opts(opts)
|
130
131
|
|
131
132
|
case data
|
132
133
|
when Array
|
133
|
-
data.map { |i| convert_to_stripe_object(i, opts, api_mode: api_mode, requestor: requestor) }
|
134
|
+
data.map { |i| convert_to_stripe_object(i, opts, api_mode: api_mode, requestor: requestor, klass: klass) }
|
134
135
|
when Hash
|
135
136
|
# TODO: This is a terrible hack.
|
136
137
|
# Waiting on https://jira.corp.stripe.com/browse/API_SERVICES-3167 to add
|
@@ -143,7 +144,10 @@ module Stripe
|
|
143
144
|
# to generic StripeObject
|
144
145
|
object_type = data[:type] || data["type"]
|
145
146
|
object_name = data[:object] || data["object"]
|
146
|
-
object_class = if
|
147
|
+
object_class = if klass
|
148
|
+
# Use the provided class for inner types
|
149
|
+
klass
|
150
|
+
elsif api_mode == :v2
|
147
151
|
if object_name == "v2.core.event" && thin_event_classes.key?(object_type)
|
148
152
|
thin_event_classes.fetch(object_type)
|
149
153
|
else
|
data/lib/stripe/version.rb
CHANGED