stripe 12.7.0.pre.beta.1 → 13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +725 -1354
- data/OPENAPI_VERSION +1 -1
- data/README.md +4 -3
- data/VERSION +1 -1
- data/examples/README.md +11 -0
- data/examples/meter_event_stream.rb +47 -0
- data/examples/new_example.rb +24 -0
- data/examples/stripe_webhook_handler.rb +28 -0
- data/lib/stripe/api_operations/nested_resource.rb +1 -21
- data/lib/stripe/api_operations/request.rb +19 -70
- data/lib/stripe/api_operations/save.rb +4 -3
- data/lib/stripe/api_operations/singleton_save.rb +5 -2
- data/lib/stripe/api_requestor.rb +1131 -0
- data/lib/stripe/api_resource.rb +22 -14
- data/lib/stripe/api_version.rb +1 -2
- data/lib/stripe/connection_manager.rb +1 -1
- data/lib/stripe/errors.rb +8 -2
- 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/list_object.rb +2 -3
- data/lib/stripe/oauth.rb +8 -15
- data/lib/stripe/object_types.rb +16 -21
- data/lib/stripe/request_options.rb +128 -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 +88 -0
- data/lib/stripe/resources/customer.rb +2 -3
- data/lib/stripe/resources/file.rb +7 -5
- data/lib/stripe/resources/financial_connections/account.rb +0 -3
- data/lib/stripe/resources/invoice.rb +0 -81
- data/lib/stripe/resources/invoice_rendering_template.rb +2 -0
- data/lib/stripe/resources/payment_intent.rb +0 -50
- data/lib/stripe/resources/quote.rb +4 -108
- data/lib/stripe/resources/source.rb +3 -2
- data/lib/stripe/resources/subscription.rb +6 -6
- data/lib/stripe/resources/subscription_schedule.rb +0 -20
- data/lib/stripe/resources/terminal/reader.rb +0 -60
- 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.rb +9 -19
- data/lib/stripe/search_result_object.rb +1 -1
- 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 +76 -0
- data/lib/stripe/services/test_helpers/issuing/card_service.rb +54 -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 +59 -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_service.rb +32 -0
- data/lib/stripe/services/v2/core_service.rb +15 -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 +181 -0
- data/lib/stripe/singleton_api_resource.rb +1 -18
- data/lib/stripe/stripe_client.rb +51 -1067
- data/lib/stripe/stripe_configuration.rb +32 -20
- data/lib/stripe/stripe_object.rb +37 -18
- data/lib/stripe/stripe_service.rb +32 -0
- data/lib/stripe/thin_event.rb +17 -0
- data/lib/stripe/util.rb +69 -46
- data/lib/stripe/v2_list_object.rb +84 -0
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe/webhook.rb +1 -1
- data/lib/stripe.rb +15 -54
- metadata +203 -24
- data/lib/stripe/request_signing_authenticator.rb +0 -79
- data/lib/stripe/resources/account_notice.rb +0 -32
- data/lib/stripe/resources/capital/financing_offer.rb +0 -49
- data/lib/stripe/resources/capital/financing_summary.rb +0 -15
- data/lib/stripe/resources/capital/financing_transaction.rb +0 -27
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -14
- data/lib/stripe/resources/financial_connections/institution.rb +0 -26
- data/lib/stripe/resources/gift_cards/card.rb +0 -59
- data/lib/stripe/resources/gift_cards/transaction.rb +0 -93
- data/lib/stripe/resources/invoice_payment.rb +0 -12
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -88
- data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -26
- data/lib/stripe/resources/margin.rb +0 -37
- data/lib/stripe/resources/order.rb +0 -120
- data/lib/stripe/resources/quote_phase.rb +0 -32
- data/lib/stripe/resources/quote_preview_invoice.rb +0 -43
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -11
- data/lib/stripe/resources/tax/association.rb +0 -24
- data/lib/stripe/resources/tax/form.rb +0 -49
- data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -14
data/lib/stripe.rb
CHANGED
@@ -13,7 +13,6 @@ require "set"
|
|
13
13
|
require "socket"
|
14
14
|
require "uri"
|
15
15
|
require "forwardable"
|
16
|
-
require "base64"
|
17
16
|
|
18
17
|
# Version
|
19
18
|
require "stripe/api_version"
|
@@ -32,13 +31,18 @@ require "stripe/api_operations/search"
|
|
32
31
|
# API resource support classes
|
33
32
|
require "stripe/errors"
|
34
33
|
require "stripe/object_types"
|
34
|
+
require "stripe/event_types"
|
35
|
+
require "stripe/request_options"
|
35
36
|
require "stripe/util"
|
36
37
|
require "stripe/connection_manager"
|
37
38
|
require "stripe/multipart_encoder"
|
39
|
+
require "stripe/api_requestor"
|
40
|
+
require "stripe/stripe_service"
|
38
41
|
require "stripe/stripe_client"
|
39
42
|
require "stripe/stripe_object"
|
40
43
|
require "stripe/stripe_response"
|
41
44
|
require "stripe/list_object"
|
45
|
+
require "stripe/v2_list_object"
|
42
46
|
require "stripe/search_result_object"
|
43
47
|
require "stripe/error_object"
|
44
48
|
require "stripe/api_resource"
|
@@ -46,13 +50,15 @@ require "stripe/api_resource_test_helpers"
|
|
46
50
|
require "stripe/singleton_api_resource"
|
47
51
|
require "stripe/webhook"
|
48
52
|
require "stripe/stripe_configuration"
|
49
|
-
require "stripe/
|
53
|
+
require "stripe/thin_event"
|
50
54
|
|
51
55
|
# Named API resources
|
52
56
|
require "stripe/resources"
|
57
|
+
require "stripe/services"
|
53
58
|
|
54
59
|
# OAuth
|
55
60
|
require "stripe/oauth"
|
61
|
+
require "stripe/services/oauth_service"
|
56
62
|
|
57
63
|
module Stripe
|
58
64
|
DEFAULT_CA_BUNDLE_PATH = __dir__ + "/data/ca-certificates.crt"
|
@@ -62,6 +68,12 @@ module Stripe
|
|
62
68
|
LEVEL_ERROR = Logger::ERROR
|
63
69
|
LEVEL_INFO = Logger::INFO
|
64
70
|
|
71
|
+
# API base constants
|
72
|
+
DEFAULT_API_BASE = "https://api.stripe.com"
|
73
|
+
DEFAULT_CONNECT_BASE = "https://connect.stripe.com"
|
74
|
+
DEFAULT_UPLOAD_BASE = "https://files.stripe.com"
|
75
|
+
DEFAULT_METER_EVENTS_BASE = "https://meter-events.stripe.com"
|
76
|
+
|
65
77
|
@app_info = nil
|
66
78
|
|
67
79
|
@config = Stripe::StripeConfiguration.setup
|
@@ -73,12 +85,12 @@ module Stripe
|
|
73
85
|
|
74
86
|
# User configurable options
|
75
87
|
def_delegators :@config, :api_key, :api_key=
|
76
|
-
def_delegators :@config, :authenticator, :authenticator=
|
77
88
|
def_delegators :@config, :api_version, :api_version=
|
78
89
|
def_delegators :@config, :stripe_account, :stripe_account=
|
79
90
|
def_delegators :@config, :api_base, :api_base=
|
80
91
|
def_delegators :@config, :uploads_base, :uploads_base=
|
81
92
|
def_delegators :@config, :connect_base, :connect_base=
|
93
|
+
def_delegators :@config, :meter_events_base, :meter_events_base=
|
82
94
|
def_delegators :@config, :open_timeout, :open_timeout=
|
83
95
|
def_delegators :@config, :read_timeout, :read_timeout=
|
84
96
|
def_delegators :@config, :write_timeout, :write_timeout=
|
@@ -120,57 +132,6 @@ module Stripe
|
|
120
132
|
version: version,
|
121
133
|
}
|
122
134
|
end
|
123
|
-
|
124
|
-
def self.add_beta_version(beta_name, version)
|
125
|
-
if api_version.include?("; #{beta_name}=")
|
126
|
-
raise "Stripe version header #{api_version} already contains entry for beta #{beta_name}"
|
127
|
-
end
|
128
|
-
|
129
|
-
self.api_version = "#{api_version}; #{beta_name}=#{version}"
|
130
|
-
end
|
131
|
-
|
132
|
-
class Preview
|
133
|
-
def self._get_default_opts(opts)
|
134
|
-
{ api_mode: :preview }.merge(opts)
|
135
|
-
end
|
136
|
-
|
137
|
-
def self.get(url, opts = {})
|
138
|
-
Stripe.raw_request(:get, url, {}, _get_default_opts(opts))
|
139
|
-
end
|
140
|
-
|
141
|
-
def self.post(url, params = {}, opts = {})
|
142
|
-
Stripe.raw_request(:post, url, params, _get_default_opts(opts))
|
143
|
-
end
|
144
|
-
|
145
|
-
def self.delete(url, opts = {})
|
146
|
-
Stripe.raw_request(:delete, url, {}, _get_default_opts(opts))
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
class RawRequest
|
151
|
-
include Stripe::APIOperations::Request
|
152
|
-
|
153
|
-
def initialize
|
154
|
-
@opts = {}
|
155
|
-
end
|
156
|
-
|
157
|
-
def execute(method, url, params = {}, opts = {}, usage = [])
|
158
|
-
resp, = execute_resource_request(method, url, params, opts, usage)
|
159
|
-
|
160
|
-
resp
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
# Sends a request to Stripe REST API
|
165
|
-
def self.raw_request(method, url, params = {}, opts = {})
|
166
|
-
req = RawRequest.new
|
167
|
-
req.execute(method, url, params, opts, ["raw_request"])
|
168
|
-
end
|
169
|
-
|
170
|
-
def self.deserialize(data)
|
171
|
-
data = JSON.parse(data) if data.is_a?(String)
|
172
|
-
Util.convert_to_stripe_object(data, {})
|
173
|
-
end
|
174
135
|
end
|
175
136
|
|
176
137
|
Stripe.log_level = ENV["STRIPE_LOG"] unless ENV["STRIPE_LOG"].nil?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 13.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Stripe is the easiest way to accept payments online. See https://stripe.com
|
14
14
|
for details.
|
@@ -29,6 +29,10 @@ files:
|
|
29
29
|
- README.md
|
30
30
|
- Rakefile
|
31
31
|
- VERSION
|
32
|
+
- examples/README.md
|
33
|
+
- examples/meter_event_stream.rb
|
34
|
+
- examples/new_example.rb
|
35
|
+
- examples/stripe_webhook_handler.rb
|
32
36
|
- exe/stripe-console
|
33
37
|
- lib/data/ca-certificates.crt
|
34
38
|
- lib/stripe.rb
|
@@ -40,22 +44,25 @@ files:
|
|
40
44
|
- lib/stripe/api_operations/save.rb
|
41
45
|
- lib/stripe/api_operations/search.rb
|
42
46
|
- lib/stripe/api_operations/singleton_save.rb
|
47
|
+
- lib/stripe/api_requestor.rb
|
43
48
|
- lib/stripe/api_resource.rb
|
44
49
|
- lib/stripe/api_resource_test_helpers.rb
|
45
50
|
- lib/stripe/api_version.rb
|
46
51
|
- lib/stripe/connection_manager.rb
|
47
52
|
- lib/stripe/error_object.rb
|
48
53
|
- lib/stripe/errors.rb
|
54
|
+
- lib/stripe/event_types.rb
|
55
|
+
- lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb
|
56
|
+
- lib/stripe/events/v1_billing_meter_no_meter_found_event.rb
|
49
57
|
- lib/stripe/instrumentation.rb
|
50
58
|
- lib/stripe/list_object.rb
|
51
59
|
- lib/stripe/multipart_encoder.rb
|
52
60
|
- lib/stripe/oauth.rb
|
53
61
|
- lib/stripe/object_types.rb
|
54
|
-
- lib/stripe/
|
62
|
+
- lib/stripe/request_options.rb
|
55
63
|
- lib/stripe/resources.rb
|
56
64
|
- lib/stripe/resources/account.rb
|
57
65
|
- lib/stripe/resources/account_link.rb
|
58
|
-
- lib/stripe/resources/account_notice.rb
|
59
66
|
- lib/stripe/resources/account_session.rb
|
60
67
|
- lib/stripe/resources/alipay_account.rb
|
61
68
|
- lib/stripe/resources/apple_pay_domain.rb
|
@@ -66,6 +73,9 @@ files:
|
|
66
73
|
- lib/stripe/resources/balance_transaction.rb
|
67
74
|
- lib/stripe/resources/bank_account.rb
|
68
75
|
- lib/stripe/resources/billing/alert.rb
|
76
|
+
- lib/stripe/resources/billing/credit_balance_summary.rb
|
77
|
+
- lib/stripe/resources/billing/credit_balance_transaction.rb
|
78
|
+
- lib/stripe/resources/billing/credit_grant.rb
|
69
79
|
- lib/stripe/resources/billing/meter.rb
|
70
80
|
- lib/stripe/resources/billing/meter_event.rb
|
71
81
|
- lib/stripe/resources/billing/meter_event_adjustment.rb
|
@@ -73,9 +83,6 @@ files:
|
|
73
83
|
- lib/stripe/resources/billing_portal/configuration.rb
|
74
84
|
- lib/stripe/resources/billing_portal/session.rb
|
75
85
|
- lib/stripe/resources/capability.rb
|
76
|
-
- lib/stripe/resources/capital/financing_offer.rb
|
77
|
-
- lib/stripe/resources/capital/financing_summary.rb
|
78
|
-
- lib/stripe/resources/capital/financing_transaction.rb
|
79
86
|
- lib/stripe/resources/card.rb
|
80
87
|
- lib/stripe/resources/cash_balance.rb
|
81
88
|
- lib/stripe/resources/charge.rb
|
@@ -102,29 +109,22 @@ files:
|
|
102
109
|
- lib/stripe/resources/file.rb
|
103
110
|
- lib/stripe/resources/file_link.rb
|
104
111
|
- lib/stripe/resources/financial_connections/account.rb
|
105
|
-
- lib/stripe/resources/financial_connections/account_inferred_balance.rb
|
106
112
|
- lib/stripe/resources/financial_connections/account_owner.rb
|
107
113
|
- lib/stripe/resources/financial_connections/account_ownership.rb
|
108
|
-
- lib/stripe/resources/financial_connections/institution.rb
|
109
114
|
- lib/stripe/resources/financial_connections/session.rb
|
110
115
|
- lib/stripe/resources/financial_connections/transaction.rb
|
111
116
|
- lib/stripe/resources/forwarding/request.rb
|
112
117
|
- lib/stripe/resources/funding_instructions.rb
|
113
|
-
- lib/stripe/resources/gift_cards/card.rb
|
114
|
-
- lib/stripe/resources/gift_cards/transaction.rb
|
115
118
|
- lib/stripe/resources/identity/verification_report.rb
|
116
119
|
- lib/stripe/resources/identity/verification_session.rb
|
117
120
|
- lib/stripe/resources/invoice.rb
|
118
121
|
- lib/stripe/resources/invoice_item.rb
|
119
122
|
- lib/stripe/resources/invoice_line_item.rb
|
120
|
-
- lib/stripe/resources/invoice_payment.rb
|
121
123
|
- lib/stripe/resources/invoice_rendering_template.rb
|
122
124
|
- lib/stripe/resources/issuing/authorization.rb
|
123
125
|
- lib/stripe/resources/issuing/card.rb
|
124
126
|
- lib/stripe/resources/issuing/cardholder.rb
|
125
|
-
- lib/stripe/resources/issuing/credit_underwriting_record.rb
|
126
127
|
- lib/stripe/resources/issuing/dispute.rb
|
127
|
-
- lib/stripe/resources/issuing/dispute_settlement_detail.rb
|
128
128
|
- lib/stripe/resources/issuing/personalization_design.rb
|
129
129
|
- lib/stripe/resources/issuing/physical_bundle.rb
|
130
130
|
- lib/stripe/resources/issuing/token.rb
|
@@ -132,8 +132,6 @@ files:
|
|
132
132
|
- lib/stripe/resources/line_item.rb
|
133
133
|
- lib/stripe/resources/login_link.rb
|
134
134
|
- lib/stripe/resources/mandate.rb
|
135
|
-
- lib/stripe/resources/margin.rb
|
136
|
-
- lib/stripe/resources/order.rb
|
137
135
|
- lib/stripe/resources/payment_intent.rb
|
138
136
|
- lib/stripe/resources/payment_link.rb
|
139
137
|
- lib/stripe/resources/payment_method.rb
|
@@ -147,9 +145,6 @@ files:
|
|
147
145
|
- lib/stripe/resources/product_feature.rb
|
148
146
|
- lib/stripe/resources/promotion_code.rb
|
149
147
|
- lib/stripe/resources/quote.rb
|
150
|
-
- lib/stripe/resources/quote_phase.rb
|
151
|
-
- lib/stripe/resources/quote_preview_invoice.rb
|
152
|
-
- lib/stripe/resources/quote_preview_subscription_schedule.rb
|
153
148
|
- lib/stripe/resources/radar/early_fraud_warning.rb
|
154
149
|
- lib/stripe/resources/radar/value_list.rb
|
155
150
|
- lib/stripe/resources/radar/value_list_item.rb
|
@@ -168,10 +163,8 @@ files:
|
|
168
163
|
- lib/stripe/resources/subscription.rb
|
169
164
|
- lib/stripe/resources/subscription_item.rb
|
170
165
|
- lib/stripe/resources/subscription_schedule.rb
|
171
|
-
- lib/stripe/resources/tax/association.rb
|
172
166
|
- lib/stripe/resources/tax/calculation.rb
|
173
167
|
- lib/stripe/resources/tax/calculation_line_item.rb
|
174
|
-
- lib/stripe/resources/tax/form.rb
|
175
168
|
- lib/stripe/resources/tax/registration.rb
|
176
169
|
- lib/stripe/resources/tax/settings.rb
|
177
170
|
- lib/stripe/resources/tax/transaction.rb
|
@@ -183,7 +176,6 @@ files:
|
|
183
176
|
- lib/stripe/resources/terminal/connection_token.rb
|
184
177
|
- lib/stripe/resources/terminal/location.rb
|
185
178
|
- lib/stripe/resources/terminal/reader.rb
|
186
|
-
- lib/stripe/resources/terminal/reader_collected_data.rb
|
187
179
|
- lib/stripe/resources/test_helpers/test_clock.rb
|
188
180
|
- lib/stripe/resources/token.rb
|
189
181
|
- lib/stripe/resources/topup.rb
|
@@ -201,14 +193,201 @@ files:
|
|
201
193
|
- lib/stripe/resources/treasury/transaction_entry.rb
|
202
194
|
- lib/stripe/resources/usage_record.rb
|
203
195
|
- lib/stripe/resources/usage_record_summary.rb
|
196
|
+
- lib/stripe/resources/v2/billing/meter_event.rb
|
197
|
+
- lib/stripe/resources/v2/billing/meter_event_adjustment.rb
|
198
|
+
- lib/stripe/resources/v2/billing/meter_event_session.rb
|
199
|
+
- lib/stripe/resources/v2/event.rb
|
204
200
|
- lib/stripe/resources/webhook_endpoint.rb
|
205
201
|
- lib/stripe/search_result_object.rb
|
202
|
+
- lib/stripe/services.rb
|
203
|
+
- lib/stripe/services/account_capability_service.rb
|
204
|
+
- lib/stripe/services/account_external_account_service.rb
|
205
|
+
- lib/stripe/services/account_link_service.rb
|
206
|
+
- lib/stripe/services/account_login_link_service.rb
|
207
|
+
- lib/stripe/services/account_person_service.rb
|
208
|
+
- lib/stripe/services/account_service.rb
|
209
|
+
- lib/stripe/services/account_session_service.rb
|
210
|
+
- lib/stripe/services/apple_pay_domain_service.rb
|
211
|
+
- lib/stripe/services/application_fee_refund_service.rb
|
212
|
+
- lib/stripe/services/application_fee_service.rb
|
213
|
+
- lib/stripe/services/apps/secret_service.rb
|
214
|
+
- lib/stripe/services/apps_service.rb
|
215
|
+
- lib/stripe/services/balance_service.rb
|
216
|
+
- lib/stripe/services/balance_transaction_service.rb
|
217
|
+
- lib/stripe/services/billing/alert_service.rb
|
218
|
+
- lib/stripe/services/billing/credit_balance_summary_service.rb
|
219
|
+
- lib/stripe/services/billing/credit_balance_transaction_service.rb
|
220
|
+
- lib/stripe/services/billing/credit_grant_service.rb
|
221
|
+
- lib/stripe/services/billing/meter_event_adjustment_service.rb
|
222
|
+
- lib/stripe/services/billing/meter_event_service.rb
|
223
|
+
- lib/stripe/services/billing/meter_event_summary_service.rb
|
224
|
+
- lib/stripe/services/billing/meter_service.rb
|
225
|
+
- lib/stripe/services/billing_portal/configuration_service.rb
|
226
|
+
- lib/stripe/services/billing_portal/session_service.rb
|
227
|
+
- lib/stripe/services/billing_portal_service.rb
|
228
|
+
- lib/stripe/services/billing_service.rb
|
229
|
+
- lib/stripe/services/charge_service.rb
|
230
|
+
- lib/stripe/services/checkout/session_line_item_service.rb
|
231
|
+
- lib/stripe/services/checkout/session_service.rb
|
232
|
+
- lib/stripe/services/checkout_service.rb
|
233
|
+
- lib/stripe/services/climate/order_service.rb
|
234
|
+
- lib/stripe/services/climate/product_service.rb
|
235
|
+
- lib/stripe/services/climate/supplier_service.rb
|
236
|
+
- lib/stripe/services/climate_service.rb
|
237
|
+
- lib/stripe/services/confirmation_token_service.rb
|
238
|
+
- lib/stripe/services/country_spec_service.rb
|
239
|
+
- lib/stripe/services/coupon_service.rb
|
240
|
+
- lib/stripe/services/credit_note_line_item_service.rb
|
241
|
+
- lib/stripe/services/credit_note_preview_lines_service.rb
|
242
|
+
- lib/stripe/services/credit_note_service.rb
|
243
|
+
- lib/stripe/services/customer_balance_transaction_service.rb
|
244
|
+
- lib/stripe/services/customer_cash_balance_service.rb
|
245
|
+
- lib/stripe/services/customer_cash_balance_transaction_service.rb
|
246
|
+
- lib/stripe/services/customer_funding_instructions_service.rb
|
247
|
+
- lib/stripe/services/customer_payment_method_service.rb
|
248
|
+
- lib/stripe/services/customer_payment_source_service.rb
|
249
|
+
- lib/stripe/services/customer_service.rb
|
250
|
+
- lib/stripe/services/customer_session_service.rb
|
251
|
+
- lib/stripe/services/customer_tax_id_service.rb
|
252
|
+
- lib/stripe/services/dispute_service.rb
|
253
|
+
- lib/stripe/services/entitlements/active_entitlement_service.rb
|
254
|
+
- lib/stripe/services/entitlements/feature_service.rb
|
255
|
+
- lib/stripe/services/entitlements_service.rb
|
256
|
+
- lib/stripe/services/ephemeral_key_service.rb
|
257
|
+
- lib/stripe/services/event_service.rb
|
258
|
+
- lib/stripe/services/exchange_rate_service.rb
|
259
|
+
- lib/stripe/services/file_link_service.rb
|
260
|
+
- lib/stripe/services/file_service.rb
|
261
|
+
- lib/stripe/services/financial_connections/account_owner_service.rb
|
262
|
+
- lib/stripe/services/financial_connections/account_service.rb
|
263
|
+
- lib/stripe/services/financial_connections/session_service.rb
|
264
|
+
- lib/stripe/services/financial_connections/transaction_service.rb
|
265
|
+
- lib/stripe/services/financial_connections_service.rb
|
266
|
+
- lib/stripe/services/forwarding/request_service.rb
|
267
|
+
- lib/stripe/services/forwarding_service.rb
|
268
|
+
- lib/stripe/services/identity/verification_report_service.rb
|
269
|
+
- lib/stripe/services/identity/verification_session_service.rb
|
270
|
+
- lib/stripe/services/identity_service.rb
|
271
|
+
- lib/stripe/services/invoice_item_service.rb
|
272
|
+
- lib/stripe/services/invoice_line_item_service.rb
|
273
|
+
- lib/stripe/services/invoice_rendering_template_service.rb
|
274
|
+
- lib/stripe/services/invoice_service.rb
|
275
|
+
- lib/stripe/services/invoice_upcoming_lines_service.rb
|
276
|
+
- lib/stripe/services/issuing/authorization_service.rb
|
277
|
+
- lib/stripe/services/issuing/card_service.rb
|
278
|
+
- lib/stripe/services/issuing/cardholder_service.rb
|
279
|
+
- lib/stripe/services/issuing/dispute_service.rb
|
280
|
+
- lib/stripe/services/issuing/personalization_design_service.rb
|
281
|
+
- lib/stripe/services/issuing/physical_bundle_service.rb
|
282
|
+
- lib/stripe/services/issuing/token_service.rb
|
283
|
+
- lib/stripe/services/issuing/transaction_service.rb
|
284
|
+
- lib/stripe/services/issuing_service.rb
|
285
|
+
- lib/stripe/services/mandate_service.rb
|
286
|
+
- lib/stripe/services/oauth_service.rb
|
287
|
+
- lib/stripe/services/payment_intent_service.rb
|
288
|
+
- lib/stripe/services/payment_link_line_item_service.rb
|
289
|
+
- lib/stripe/services/payment_link_service.rb
|
290
|
+
- lib/stripe/services/payment_method_configuration_service.rb
|
291
|
+
- lib/stripe/services/payment_method_domain_service.rb
|
292
|
+
- lib/stripe/services/payment_method_service.rb
|
293
|
+
- lib/stripe/services/payout_service.rb
|
294
|
+
- lib/stripe/services/plan_service.rb
|
295
|
+
- lib/stripe/services/price_service.rb
|
296
|
+
- lib/stripe/services/product_feature_service.rb
|
297
|
+
- lib/stripe/services/product_service.rb
|
298
|
+
- lib/stripe/services/promotion_code_service.rb
|
299
|
+
- lib/stripe/services/quote_computed_upfront_line_items_service.rb
|
300
|
+
- lib/stripe/services/quote_line_item_service.rb
|
301
|
+
- lib/stripe/services/quote_service.rb
|
302
|
+
- lib/stripe/services/radar/early_fraud_warning_service.rb
|
303
|
+
- lib/stripe/services/radar/value_list_item_service.rb
|
304
|
+
- lib/stripe/services/radar/value_list_service.rb
|
305
|
+
- lib/stripe/services/radar_service.rb
|
306
|
+
- lib/stripe/services/refund_service.rb
|
307
|
+
- lib/stripe/services/reporting/report_run_service.rb
|
308
|
+
- lib/stripe/services/reporting/report_type_service.rb
|
309
|
+
- lib/stripe/services/reporting_service.rb
|
310
|
+
- lib/stripe/services/review_service.rb
|
311
|
+
- lib/stripe/services/setup_attempt_service.rb
|
312
|
+
- lib/stripe/services/setup_intent_service.rb
|
313
|
+
- lib/stripe/services/shipping_rate_service.rb
|
314
|
+
- lib/stripe/services/sigma/scheduled_query_run_service.rb
|
315
|
+
- lib/stripe/services/sigma_service.rb
|
316
|
+
- lib/stripe/services/source_service.rb
|
317
|
+
- lib/stripe/services/source_transaction_service.rb
|
318
|
+
- lib/stripe/services/subscription_item_service.rb
|
319
|
+
- lib/stripe/services/subscription_item_usage_record_service.rb
|
320
|
+
- lib/stripe/services/subscription_item_usage_record_summary_service.rb
|
321
|
+
- lib/stripe/services/subscription_schedule_service.rb
|
322
|
+
- lib/stripe/services/subscription_service.rb
|
323
|
+
- lib/stripe/services/tax/calculation_line_item_service.rb
|
324
|
+
- lib/stripe/services/tax/calculation_service.rb
|
325
|
+
- lib/stripe/services/tax/registration_service.rb
|
326
|
+
- lib/stripe/services/tax/settings_service.rb
|
327
|
+
- lib/stripe/services/tax/transaction_line_item_service.rb
|
328
|
+
- lib/stripe/services/tax/transaction_service.rb
|
329
|
+
- lib/stripe/services/tax_code_service.rb
|
330
|
+
- lib/stripe/services/tax_id_service.rb
|
331
|
+
- lib/stripe/services/tax_rate_service.rb
|
332
|
+
- lib/stripe/services/tax_service.rb
|
333
|
+
- lib/stripe/services/terminal/configuration_service.rb
|
334
|
+
- lib/stripe/services/terminal/connection_token_service.rb
|
335
|
+
- lib/stripe/services/terminal/location_service.rb
|
336
|
+
- lib/stripe/services/terminal/reader_service.rb
|
337
|
+
- lib/stripe/services/terminal_service.rb
|
338
|
+
- lib/stripe/services/test_helpers/confirmation_token_service.rb
|
339
|
+
- lib/stripe/services/test_helpers/customer_service.rb
|
340
|
+
- lib/stripe/services/test_helpers/issuing/authorization_service.rb
|
341
|
+
- lib/stripe/services/test_helpers/issuing/card_service.rb
|
342
|
+
- lib/stripe/services/test_helpers/issuing/personalization_design_service.rb
|
343
|
+
- lib/stripe/services/test_helpers/issuing/transaction_service.rb
|
344
|
+
- lib/stripe/services/test_helpers/issuing_service.rb
|
345
|
+
- lib/stripe/services/test_helpers/refund_service.rb
|
346
|
+
- lib/stripe/services/test_helpers/terminal/reader_service.rb
|
347
|
+
- lib/stripe/services/test_helpers/terminal_service.rb
|
348
|
+
- lib/stripe/services/test_helpers/test_clock_service.rb
|
349
|
+
- lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb
|
350
|
+
- lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb
|
351
|
+
- lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb
|
352
|
+
- lib/stripe/services/test_helpers/treasury/received_credit_service.rb
|
353
|
+
- lib/stripe/services/test_helpers/treasury/received_debit_service.rb
|
354
|
+
- lib/stripe/services/test_helpers/treasury_service.rb
|
355
|
+
- lib/stripe/services/test_helpers_service.rb
|
356
|
+
- lib/stripe/services/token_service.rb
|
357
|
+
- lib/stripe/services/topup_service.rb
|
358
|
+
- lib/stripe/services/transfer_reversal_service.rb
|
359
|
+
- lib/stripe/services/transfer_service.rb
|
360
|
+
- lib/stripe/services/treasury/credit_reversal_service.rb
|
361
|
+
- lib/stripe/services/treasury/debit_reversal_service.rb
|
362
|
+
- lib/stripe/services/treasury/financial_account_features_service.rb
|
363
|
+
- lib/stripe/services/treasury/financial_account_service.rb
|
364
|
+
- lib/stripe/services/treasury/inbound_transfer_service.rb
|
365
|
+
- lib/stripe/services/treasury/outbound_payment_service.rb
|
366
|
+
- lib/stripe/services/treasury/outbound_transfer_service.rb
|
367
|
+
- lib/stripe/services/treasury/received_credit_service.rb
|
368
|
+
- lib/stripe/services/treasury/received_debit_service.rb
|
369
|
+
- lib/stripe/services/treasury/transaction_entry_service.rb
|
370
|
+
- lib/stripe/services/treasury/transaction_service.rb
|
371
|
+
- lib/stripe/services/treasury_service.rb
|
372
|
+
- lib/stripe/services/v1_services.rb
|
373
|
+
- lib/stripe/services/v2/billing/meter_event_adjustment_service.rb
|
374
|
+
- lib/stripe/services/v2/billing/meter_event_service.rb
|
375
|
+
- lib/stripe/services/v2/billing/meter_event_session_service.rb
|
376
|
+
- lib/stripe/services/v2/billing/meter_event_stream_service.rb
|
377
|
+
- lib/stripe/services/v2/billing_service.rb
|
378
|
+
- lib/stripe/services/v2/core/event_service.rb
|
379
|
+
- lib/stripe/services/v2/core_service.rb
|
380
|
+
- lib/stripe/services/v2_services.rb
|
381
|
+
- lib/stripe/services/webhook_endpoint_service.rb
|
206
382
|
- lib/stripe/singleton_api_resource.rb
|
207
383
|
- lib/stripe/stripe_client.rb
|
208
384
|
- lib/stripe/stripe_configuration.rb
|
209
385
|
- lib/stripe/stripe_object.rb
|
210
386
|
- lib/stripe/stripe_response.rb
|
387
|
+
- lib/stripe/stripe_service.rb
|
388
|
+
- lib/stripe/thin_event.rb
|
211
389
|
- lib/stripe/util.rb
|
390
|
+
- lib/stripe/v2_list_object.rb
|
212
391
|
- lib/stripe/version.rb
|
213
392
|
- lib/stripe/webhook.rb
|
214
393
|
- stripe.gemspec
|
@@ -234,9 +413,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
234
413
|
version: 2.3.0
|
235
414
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
236
415
|
requirements:
|
237
|
-
- - "
|
416
|
+
- - ">="
|
238
417
|
- !ruby/object:Gem::Version
|
239
|
-
version:
|
418
|
+
version: '0'
|
240
419
|
requirements: []
|
241
420
|
rubygems_version: 3.3.27
|
242
421
|
signing_key:
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Stripe
|
4
|
-
class RequestSigningAuthenticator
|
5
|
-
AUTHORIZATION_HEADER_NAME = "Authorization"
|
6
|
-
CONTENT_TYPE_HEADER_NAME = "Content-Type"
|
7
|
-
STRIPE_CONTEXT_HEADER_NAME = "Stripe-Context"
|
8
|
-
STRIPE_ACCOUNT_HEADER_NAME = "Stripe-Account"
|
9
|
-
CONTENT_DIGEST_HEADER_NAME = "Content-Digest"
|
10
|
-
SIGNATURE_INPUT_HEADER_NAME = "Signature-Input"
|
11
|
-
SIGNATURE_HEADER_NAME = "Signature"
|
12
|
-
|
13
|
-
attr_reader :auth_token, :sign_lambda
|
14
|
-
|
15
|
-
def initialize(auth_token, sign_lambda)
|
16
|
-
raise ArgumentError, "auth_token must be a string" unless auth_token.is_a?(String)
|
17
|
-
raise ArgumentError, "sign_lambda must be a lambda" unless sign_lambda.is_a?(Proc)
|
18
|
-
|
19
|
-
@auth_token = auth_token
|
20
|
-
@sign_lambda = sign_lambda
|
21
|
-
end
|
22
|
-
|
23
|
-
def authenticate(method, headers, body)
|
24
|
-
covered_headers = [CONTENT_TYPE_HEADER_NAME,
|
25
|
-
CONTENT_DIGEST_HEADER_NAME,
|
26
|
-
STRIPE_CONTEXT_HEADER_NAME,
|
27
|
-
STRIPE_ACCOUNT_HEADER_NAME,
|
28
|
-
AUTHORIZATION_HEADER_NAME,]
|
29
|
-
|
30
|
-
headers[AUTHORIZATION_HEADER_NAME] = "STRIPE-V2-SIG #{auth_token}"
|
31
|
-
|
32
|
-
if method == :get
|
33
|
-
covered_headers -= [CONTENT_TYPE_HEADER_NAME,
|
34
|
-
CONTENT_DIGEST_HEADER_NAME,]
|
35
|
-
else
|
36
|
-
content = body || ""
|
37
|
-
headers[CONTENT_DIGEST_HEADER_NAME] =
|
38
|
-
%(sha-256=:#{content_digest(content)}:)
|
39
|
-
end
|
40
|
-
|
41
|
-
covered_headers_formatted = covered_headers
|
42
|
-
.map { |string| %("#{string.downcase}") }
|
43
|
-
.join(" ")
|
44
|
-
|
45
|
-
signature_input = "(#{covered_headers_formatted});created=#{created_time}"
|
46
|
-
|
47
|
-
inputs = covered_headers
|
48
|
-
.map { |header| %("#{header.downcase}": #{headers[header]}) }
|
49
|
-
.join("\n")
|
50
|
-
|
51
|
-
signature_base = %(#{inputs}\n"@signature-params": #{signature_input})
|
52
|
-
.encode(Encoding::UTF_8)
|
53
|
-
|
54
|
-
headers[SIGNATURE_INPUT_HEADER_NAME] = "sig1=#{signature_input}"
|
55
|
-
|
56
|
-
headers[SIGNATURE_HEADER_NAME] =
|
57
|
-
"sig1=:#{encoded_signature(signature_base)}:"
|
58
|
-
end
|
59
|
-
|
60
|
-
private def sign(signature_base)
|
61
|
-
@sign_lambda.call(signature_base)
|
62
|
-
end
|
63
|
-
|
64
|
-
private def encoded_signature(signature_base)
|
65
|
-
Base64.strict_encode64(sign(signature_base))
|
66
|
-
rescue StandardError
|
67
|
-
raise AuthenticationError, "Encountered '#{e.message} (#{e.class})' " \
|
68
|
-
"when calculating request signature."
|
69
|
-
end
|
70
|
-
|
71
|
-
private def content_digest(content)
|
72
|
-
Base64.strict_encode64(OpenSSL::Digest.new("SHA256").digest(content))
|
73
|
-
end
|
74
|
-
|
75
|
-
private def created_time
|
76
|
-
Time.now.to_i
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# File generated from our OpenAPI spec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Stripe
|
5
|
-
# A notice to a Connected account. Notice can be sent by Stripe on your behalf or you can opt to send the notices yourself.
|
6
|
-
#
|
7
|
-
# See the [guide to send notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) to your connected accounts.
|
8
|
-
class AccountNotice < APIResource
|
9
|
-
extend Stripe::APIOperations::List
|
10
|
-
include Stripe::APIOperations::Save
|
11
|
-
|
12
|
-
OBJECT_NAME = "account_notice"
|
13
|
-
def self.object_name
|
14
|
-
"account_notice"
|
15
|
-
end
|
16
|
-
|
17
|
-
# Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
|
18
|
-
def self.list(filters = {}, opts = {})
|
19
|
-
request_stripe_object(method: :get, path: "/v1/account_notices", params: filters, opts: opts)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Updates an AccountNotice object.
|
23
|
-
def self.update(id, params = {}, opts = {})
|
24
|
-
request_stripe_object(
|
25
|
-
method: :post,
|
26
|
-
path: format("/v1/account_notices/%<id>s", { id: CGI.escape(id) }),
|
27
|
-
params: params,
|
28
|
-
opts: opts
|
29
|
-
)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# File generated from our OpenAPI spec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Stripe
|
5
|
-
module Capital
|
6
|
-
# This is an object representing an offer of financing from
|
7
|
-
# Stripe Capital to a Connect subaccount.
|
8
|
-
class FinancingOffer < APIResource
|
9
|
-
extend Stripe::APIOperations::List
|
10
|
-
|
11
|
-
OBJECT_NAME = "capital.financing_offer"
|
12
|
-
def self.object_name
|
13
|
-
"capital.financing_offer"
|
14
|
-
end
|
15
|
-
|
16
|
-
# Retrieves the financing offers available for Connected accounts that belong to your platform.
|
17
|
-
def self.list(filters = {}, opts = {})
|
18
|
-
request_stripe_object(
|
19
|
-
method: :get,
|
20
|
-
path: "/v1/capital/financing_offers",
|
21
|
-
params: filters,
|
22
|
-
opts: opts
|
23
|
-
)
|
24
|
-
end
|
25
|
-
|
26
|
-
# Acknowledges that platform has received and delivered the financing_offer to
|
27
|
-
# the intended merchant recipient.
|
28
|
-
def mark_delivered(params = {}, opts = {})
|
29
|
-
request_stripe_object(
|
30
|
-
method: :post,
|
31
|
-
path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(self["id"]) }),
|
32
|
-
params: params,
|
33
|
-
opts: opts
|
34
|
-
)
|
35
|
-
end
|
36
|
-
|
37
|
-
# Acknowledges that platform has received and delivered the financing_offer to
|
38
|
-
# the intended merchant recipient.
|
39
|
-
def self.mark_delivered(financing_offer, params = {}, opts = {})
|
40
|
-
request_stripe_object(
|
41
|
-
method: :post,
|
42
|
-
path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(financing_offer) }),
|
43
|
-
params: params,
|
44
|
-
opts: opts
|
45
|
-
)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# File generated from our OpenAPI spec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Stripe
|
5
|
-
module Capital
|
6
|
-
# A financing object describes an account's current financing state. Used by Connect
|
7
|
-
# platforms to read the state of Capital offered to their connected accounts.
|
8
|
-
class FinancingSummary < SingletonAPIResource
|
9
|
-
OBJECT_NAME = "capital.financing_summary"
|
10
|
-
def self.object_name
|
11
|
-
"capital.financing_summary"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|