stripe 5.39.0 → 10.1.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 +304 -0
- data/Gemfile +5 -2
- data/Makefile +13 -0
- data/OPENAPI_VERSION +1 -0
- data/README.md +40 -6
- data/VERSION +1 -1
- 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 +62 -34
- data/lib/stripe/api_operations/request.rb +10 -0
- data/lib/stripe/api_operations/save.rb +13 -3
- data/lib/stripe/api_operations/search.rb +16 -0
- data/lib/stripe/api_resource.rb +3 -18
- data/lib/stripe/api_resource_test_helpers.rb +49 -0
- data/lib/stripe/api_version.rb +8 -0
- data/lib/stripe/connection_manager.rb +22 -1
- data/lib/stripe/instrumentation.rb +45 -7
- data/lib/stripe/object_types.rb +35 -10
- data/lib/stripe/resources/account.rb +37 -11
- data/lib/stripe/resources/account_link.rb +4 -0
- data/lib/stripe/resources/account_session.rb +17 -0
- data/lib/stripe/resources/application_fee.rb +1 -2
- data/lib/stripe/resources/application_fee_refund.rb +5 -0
- data/lib/stripe/resources/apps/secret.rb +40 -0
- data/lib/stripe/resources/balance.rb +11 -0
- data/lib/stripe/resources/balance_transaction.rb +4 -0
- data/lib/stripe/resources/bank_account.rb +7 -0
- data/lib/stripe/resources/billing_portal/configuration.rb +1 -0
- data/lib/stripe/resources/billing_portal/session.rb +14 -0
- data/lib/stripe/resources/capability.rb +3 -0
- data/lib/stripe/resources/card.rb +6 -3
- data/lib/stripe/resources/cash_balance.rb +23 -0
- data/lib/stripe/resources/charge.rb +23 -3
- data/lib/stripe/resources/checkout/session.rb +49 -2
- data/lib/stripe/resources/country_spec.rb +6 -0
- data/lib/stripe/resources/coupon.rb +3 -0
- data/lib/stripe/resources/credit_note.rb +27 -9
- data/lib/stripe/resources/credit_note_line_item.rb +1 -0
- data/lib/stripe/resources/customer.rb +119 -15
- data/lib/stripe/resources/customer_balance_transaction.rb +6 -0
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +14 -0
- data/lib/stripe/resources/discount.rb +5 -0
- data/lib/stripe/resources/dispute.rb +15 -3
- data/lib/stripe/resources/event.rb +30 -0
- data/lib/stripe/resources/exchange_rate.rb +26 -0
- data/lib/stripe/resources/file.rb +7 -0
- data/lib/stripe/resources/file_link.rb +3 -0
- data/lib/stripe/resources/financial_connections/account.rb +67 -0
- data/lib/stripe/resources/financial_connections/account_owner.rb +11 -0
- data/lib/stripe/resources/financial_connections/account_ownership.rb +11 -0
- data/lib/stripe/resources/financial_connections/session.rb +13 -0
- data/lib/stripe/resources/funding_instructions.rb +21 -0
- data/lib/stripe/resources/identity/verification_report.rb +11 -0
- data/lib/stripe/resources/identity/verification_session.rb +31 -5
- data/lib/stripe/resources/invoice.rb +100 -17
- data/lib/stripe/resources/invoice_item.rb +11 -0
- data/lib/stripe/resources/issuing/authorization.rb +114 -5
- data/lib/stripe/resources/issuing/card.rb +78 -8
- data/lib/stripe/resources/issuing/cardholder.rb +3 -0
- data/lib/stripe/resources/issuing/dispute.rb +13 -3
- data/lib/stripe/resources/issuing/token.rb +14 -0
- data/lib/stripe/resources/issuing/transaction.rb +49 -0
- data/lib/stripe/resources/line_item.rb +1 -0
- data/lib/stripe/resources/login_link.rb +1 -0
- data/lib/stripe/resources/mandate.rb +1 -0
- data/lib/stripe/resources/payment_intent.rb +103 -6
- data/lib/stripe/resources/payment_link.rb +35 -0
- data/lib/stripe/resources/payment_method.rb +25 -5
- data/lib/stripe/resources/payment_method_configuration.rb +26 -0
- data/lib/stripe/resources/payment_method_domain.rb +34 -0
- data/lib/stripe/resources/payout.rb +28 -5
- data/lib/stripe/resources/person.rb +6 -0
- data/lib/stripe/resources/plan.rb +8 -0
- data/lib/stripe/resources/price.rb +15 -0
- data/lib/stripe/resources/product.rb +17 -0
- data/lib/stripe/resources/promotion_code.rb +2 -0
- data/lib/stripe/resources/quote.rb +58 -35
- data/lib/stripe/resources/radar/early_fraud_warning.rb +4 -0
- data/lib/stripe/resources/radar/value_list.rb +3 -0
- data/lib/stripe/resources/radar/value_list_item.rb +3 -0
- data/lib/stripe/resources/refund.rb +49 -0
- data/lib/stripe/resources/reporting/report_run.rb +8 -0
- data/lib/stripe/resources/reporting/report_type.rb +8 -1
- data/lib/stripe/resources/reversal.rb +13 -0
- data/lib/stripe/resources/review.rb +14 -3
- data/lib/stripe/resources/setup_attempt.rb +4 -0
- data/lib/stripe/resources/setup_intent.rb +59 -5
- data/lib/stripe/resources/shipping_rate.rb +14 -0
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -0
- data/lib/stripe/resources/source.rb +27 -8
- data/lib/stripe/resources/source_transaction.rb +5 -0
- data/lib/stripe/resources/subscription.rb +57 -3
- data/lib/stripe/resources/subscription_item.rb +2 -7
- data/lib/stripe/resources/subscription_schedule.rb +23 -5
- data/lib/stripe/resources/tax/calculation.rb +33 -0
- data/lib/stripe/resources/tax/calculation_line_item.rb +10 -0
- data/lib/stripe/resources/tax/registration.rb +19 -0
- data/lib/stripe/resources/tax/settings.rb +15 -0
- data/lib/stripe/resources/tax/transaction.rb +49 -0
- data/lib/stripe/resources/tax/transaction_line_item.rb +10 -0
- data/lib/stripe/resources/tax_code.rb +1 -0
- data/lib/stripe/resources/tax_id.rb +4 -0
- data/lib/stripe/resources/tax_rate.rb +3 -0
- data/lib/stripe/resources/terminal/configuration.rb +16 -0
- data/lib/stripe/resources/terminal/connection_token.rb +3 -0
- data/lib/stripe/resources/terminal/location.rb +3 -0
- data/lib/stripe/resources/terminal/reader.rb +119 -0
- data/lib/stripe/resources/test_helpers/test_clock.rb +35 -0
- data/lib/stripe/resources/token.rb +20 -0
- data/lib/stripe/resources/topup.rb +15 -3
- data/lib/stripe/resources/transfer.rb +11 -13
- data/lib/stripe/resources/treasury/credit_reversal.rb +14 -0
- data/lib/stripe/resources/treasury/debit_reversal.rb +14 -0
- data/lib/stripe/resources/treasury/financial_account.rb +52 -0
- data/lib/stripe/resources/treasury/financial_account_features.rb +12 -0
- data/lib/stripe/resources/treasury/inbound_transfer.rb +94 -0
- data/lib/stripe/resources/treasury/outbound_payment.rb +96 -0
- data/lib/stripe/resources/treasury/outbound_transfer.rb +96 -0
- data/lib/stripe/resources/treasury/received_credit.rb +30 -0
- data/lib/stripe/resources/treasury/received_debit.rb +30 -0
- data/lib/stripe/resources/treasury/transaction.rb +13 -0
- data/lib/stripe/resources/treasury/transaction_entry.rb +17 -0
- data/lib/stripe/resources/usage_record.rb +4 -0
- data/lib/stripe/resources/webhook_endpoint.rb +7 -0
- data/lib/stripe/resources.rb +33 -10
- data/lib/stripe/search_result_object.rb +86 -0
- data/lib/stripe/stripe_client.rb +37 -22
- data/lib/stripe/stripe_configuration.rb +5 -1
- data/lib/stripe/stripe_object.rb +2 -2
- data/lib/stripe/util.rb +85 -2
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe/webhook.rb +2 -1
- data/lib/stripe.rb +5 -1
- data/stripe.gemspec +3 -3
- metadata +45 -14
- 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 -9
- 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
data/lib/stripe/stripe_client.rb
CHANGED
@@ -494,15 +494,16 @@ module Stripe
|
|
494
494
|
end
|
495
495
|
end
|
496
496
|
|
497
|
-
http_resp =
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
497
|
+
http_resp =
|
498
|
+
execute_request_with_rescues(method, api_base, headers, context) do
|
499
|
+
self.class
|
500
|
+
.default_connection_manager(config)
|
501
|
+
.execute_request(method, url,
|
502
|
+
body: body,
|
503
|
+
headers: headers,
|
504
|
+
query: query,
|
505
|
+
&response_block)
|
506
|
+
end
|
506
507
|
|
507
508
|
[http_resp, api_key]
|
508
509
|
end
|
@@ -564,7 +565,7 @@ module Stripe
|
|
564
565
|
http_status >= 400
|
565
566
|
end
|
566
567
|
|
567
|
-
private def execute_request_with_rescues(method, api_base, context)
|
568
|
+
private def execute_request_with_rescues(method, api_base, headers, context)
|
568
569
|
num_retries = 0
|
569
570
|
|
570
571
|
begin
|
@@ -585,9 +586,9 @@ module Stripe
|
|
585
586
|
handle_error_response(resp, context)
|
586
587
|
end
|
587
588
|
|
588
|
-
log_response(context, request_start, http_status, resp.body)
|
589
|
+
log_response(context, request_start, http_status, resp.body, resp)
|
589
590
|
notify_request_end(context, request_duration, http_status,
|
590
|
-
num_retries, user_data)
|
591
|
+
num_retries, user_data, resp, headers)
|
591
592
|
|
592
593
|
if config.enable_telemetry? && context.request_id
|
593
594
|
request_duration_ms = (request_duration * 1000).to_i
|
@@ -609,12 +610,12 @@ module Stripe
|
|
609
610
|
error_context = context.dup_from_response_headers(e.http_headers)
|
610
611
|
http_status = resp.code.to_i
|
611
612
|
log_response(error_context, request_start,
|
612
|
-
e.http_status, e.http_body)
|
613
|
+
e.http_status, e.http_body, resp)
|
613
614
|
else
|
614
615
|
log_response_error(error_context, request_start, e)
|
615
616
|
end
|
616
617
|
notify_request_end(context, request_duration, http_status, num_retries,
|
617
|
-
user_data)
|
618
|
+
user_data, resp, headers)
|
618
619
|
|
619
620
|
if self.class.should_retry?(e,
|
620
621
|
method: method,
|
@@ -657,17 +658,24 @@ module Stripe
|
|
657
658
|
end
|
658
659
|
|
659
660
|
private def notify_request_end(context, duration, http_status, num_retries,
|
660
|
-
user_data)
|
661
|
+
user_data, resp, headers)
|
661
662
|
return if !Instrumentation.any_subscribers?(:request_end) &&
|
662
663
|
!Instrumentation.any_subscribers?(:request)
|
663
664
|
|
664
|
-
|
665
|
+
request_context = Stripe::Instrumentation::RequestContext.new(
|
665
666
|
duration: duration,
|
667
|
+
context: context,
|
668
|
+
header: headers
|
669
|
+
)
|
670
|
+
response_context = Stripe::Instrumentation::ResponseContext.new(
|
666
671
|
http_status: http_status,
|
667
|
-
|
672
|
+
response: resp
|
673
|
+
)
|
674
|
+
|
675
|
+
event = Instrumentation::RequestEndEvent.new(
|
676
|
+
request_context: request_context,
|
677
|
+
response_context: response_context,
|
668
678
|
num_retries: num_retries,
|
669
|
-
path: context.path,
|
670
|
-
request_id: context.request_id,
|
671
679
|
user_data: user_data || {}
|
672
680
|
)
|
673
681
|
Stripe::Instrumentation.notify(:request_end, event)
|
@@ -903,10 +911,13 @@ module Stripe
|
|
903
911
|
body: context.body,
|
904
912
|
idempotency_key: context.idempotency_key,
|
905
913
|
query: context.query,
|
906
|
-
config: config
|
914
|
+
config: config,
|
915
|
+
process_id: Process.pid,
|
916
|
+
thread_object_id: Thread.current.object_id,
|
917
|
+
log_timestamp: Util.monotonic_time)
|
907
918
|
end
|
908
919
|
|
909
|
-
private def log_response(context, request_start, status, body)
|
920
|
+
private def log_response(context, request_start, status, body, resp)
|
910
921
|
Util.log_info("Response from Stripe API",
|
911
922
|
account: context.account,
|
912
923
|
api_version: context.api_version,
|
@@ -921,7 +932,11 @@ module Stripe
|
|
921
932
|
body: body,
|
922
933
|
idempotency_key: context.idempotency_key,
|
923
934
|
request_id: context.request_id,
|
924
|
-
config: config
|
935
|
+
config: config,
|
936
|
+
process_id: Process.pid,
|
937
|
+
thread_object_id: Thread.current.object_id,
|
938
|
+
response_object_id: resp.object_id,
|
939
|
+
log_timestamp: Util.monotonic_time)
|
925
940
|
|
926
941
|
return unless context.request_id
|
927
942
|
|
@@ -63,6 +63,7 @@ module Stripe
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def initialize
|
66
|
+
@api_version = ApiVersion::CURRENT
|
66
67
|
@ca_bundle_path = Stripe::DEFAULT_CA_BUNDLE_PATH
|
67
68
|
@enable_telemetry = true
|
68
69
|
@verify_ssl_certs = true
|
@@ -86,13 +87,16 @@ module Stripe
|
|
86
87
|
val = Stripe::LEVEL_DEBUG
|
87
88
|
elsif val == "info"
|
88
89
|
val = Stripe::LEVEL_INFO
|
90
|
+
elsif val == "error"
|
91
|
+
val = Stripe::LEVEL_ERROR
|
89
92
|
end
|
90
93
|
|
91
94
|
levels = [Stripe::LEVEL_INFO, Stripe::LEVEL_DEBUG, Stripe::LEVEL_ERROR]
|
92
95
|
|
93
96
|
if !val.nil? && !levels.include?(val)
|
94
97
|
raise ArgumentError,
|
95
|
-
"log_level should only be set to `nil`, `debug
|
98
|
+
"log_level should only be set to `nil`, `debug`, `info`," \
|
99
|
+
" or `error`"
|
96
100
|
end
|
97
101
|
@log_level = val
|
98
102
|
end
|
data/lib/stripe/stripe_object.rb
CHANGED
@@ -429,13 +429,13 @@ module Stripe
|
|
429
429
|
# * +:opts:+ Options for StripeObject like an API key.
|
430
430
|
# * +:partial:+ Indicates that the re-initialization should not attempt to
|
431
431
|
# remove accessors.
|
432
|
-
protected def initialize_from(values, opts
|
432
|
+
protected def initialize_from(values, opts)
|
433
433
|
@opts = Util.normalize_opts(opts)
|
434
434
|
|
435
435
|
# the `#send` is here so that we can keep this method private
|
436
436
|
@original_values = self.class.send(:deep_copy, values)
|
437
437
|
|
438
|
-
removed =
|
438
|
+
removed = Set.new(@values.keys - values.keys)
|
439
439
|
added = Set.new(values.keys - @values.keys)
|
440
440
|
|
441
441
|
# Wipe old state before setting new. This is useful for e.g. updating a
|
data/lib/stripe/util.rb
CHANGED
@@ -47,6 +47,53 @@ module Stripe
|
|
47
47
|
Util.object_classes[object_name] == klass
|
48
48
|
end
|
49
49
|
|
50
|
+
# Adds a custom method to a resource class. This is used to add support for
|
51
|
+
# non-CRUDL API requests, e.g. capturing charges. custom_method takes the
|
52
|
+
# following parameters:
|
53
|
+
# - name: the name of the custom method to create (as a symbol)
|
54
|
+
# - http_verb: the HTTP verb for the API request (:get, :post, or :delete)
|
55
|
+
# - http_path: the path to append to the resource's URL. If not provided,
|
56
|
+
# the name is used as the path
|
57
|
+
# - resource: the resource implementation class
|
58
|
+
# - target: the class that custom static method will be added to
|
59
|
+
#
|
60
|
+
# For example, this call:
|
61
|
+
# custom_method :capture, http_verb: post
|
62
|
+
# adds a `capture` class method to the resource class that, when called,
|
63
|
+
# will send a POST request to `/v1/<object_name>/capture`.
|
64
|
+
def self.custom_method(resource, target, name, http_verb, http_path)
|
65
|
+
unless %i[get post delete].include?(http_verb)
|
66
|
+
raise ArgumentError,
|
67
|
+
"Invalid http_verb value: #{http_verb.inspect}. Should be one " \
|
68
|
+
"of :get, :post or :delete."
|
69
|
+
end
|
70
|
+
unless target.respond_to?(:resource_url)
|
71
|
+
raise ArgumentError,
|
72
|
+
"Invalid target value: #{target}. Target class should have a " \
|
73
|
+
"`resource_url` method."
|
74
|
+
end
|
75
|
+
http_path ||= name.to_s
|
76
|
+
target.define_singleton_method(name) do |id, params = {}, opts = {}|
|
77
|
+
unless id.is_a?(String)
|
78
|
+
raise ArgumentError,
|
79
|
+
"id should be a string representing the ID of an API resource"
|
80
|
+
end
|
81
|
+
|
82
|
+
url = "#{target.resource_url}/"\
|
83
|
+
"#{CGI.escape(id)}/"\
|
84
|
+
"#{CGI.escape(http_path)}"
|
85
|
+
|
86
|
+
resp, opts = resource.execute_resource_request(
|
87
|
+
http_verb,
|
88
|
+
url,
|
89
|
+
params,
|
90
|
+
opts
|
91
|
+
)
|
92
|
+
|
93
|
+
Util.convert_to_stripe_object_with_params(resp.data, params, opts)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
50
97
|
# Converts a hash of fields or an array of hashes into a +StripeObject+ or
|
51
98
|
# array of +StripeObject+s. These new objects will be created as a concrete
|
52
99
|
# type as dictated by their `object` field (e.g. an `object` value of
|
@@ -57,9 +104,27 @@ module Stripe
|
|
57
104
|
# ==== Attributes
|
58
105
|
#
|
59
106
|
# * +data+ - Hash of fields and values to be converted into a StripeObject.
|
107
|
+
# * +params+ - Params for +StripeObject+ like filters used in search that
|
108
|
+
# will be reused on subsequent API calls.
|
60
109
|
# * +opts+ - Options for +StripeObject+ like an API key that will be reused
|
61
110
|
# on subsequent API calls.
|
62
111
|
def self.convert_to_stripe_object(data, opts = {})
|
112
|
+
convert_to_stripe_object_with_params(data, {}, opts)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Converts a hash of fields or an array of hashes into a +StripeObject+ or
|
116
|
+
# array of +StripeObject+s. These new objects will be created as a concrete
|
117
|
+
# type as dictated by their `object` field (e.g. an `object` value of
|
118
|
+
# `charge` would create an instance of +Charge+), but if `object` is not
|
119
|
+
# present or of an unknown type, the newly created instance will fall back
|
120
|
+
# to being a +StripeObject+.
|
121
|
+
#
|
122
|
+
# ==== Attributes
|
123
|
+
#
|
124
|
+
# * +data+ - Hash of fields and values to be converted into a StripeObject.
|
125
|
+
# * +opts+ - Options for +StripeObject+ like an API key that will be reused
|
126
|
+
# on subsequent API calls.
|
127
|
+
def self.convert_to_stripe_object_with_params(data, params, opts = {})
|
63
128
|
opts = normalize_opts(opts)
|
64
129
|
|
65
130
|
case data
|
@@ -68,8 +133,17 @@ module Stripe
|
|
68
133
|
when Hash
|
69
134
|
# Try converting to a known object class. If none available, fall back
|
70
135
|
# to generic StripeObject
|
71
|
-
|
72
|
-
|
136
|
+
object_name = data[:object] || data["object"]
|
137
|
+
obj = object_classes.fetch(object_name, StripeObject)
|
138
|
+
.construct_from(data, opts)
|
139
|
+
|
140
|
+
# set filters so that we can fetch the same limit, expansions, and
|
141
|
+
# predicates when accessing the next and previous pages
|
142
|
+
if obj && (obj.is_a?(SearchResultObject) || obj.is_a?(ListObject))
|
143
|
+
obj.filters = params.dup
|
144
|
+
end
|
145
|
+
|
146
|
+
obj
|
73
147
|
else
|
74
148
|
data
|
75
149
|
end
|
@@ -343,6 +417,15 @@ module Stripe
|
|
343
417
|
# Hopefully val is a string, but protect in case it's not.
|
344
418
|
val = val.to_s
|
345
419
|
|
420
|
+
# Some values returned by the server are encoded in ASCII-8BIT before
|
421
|
+
# being parsed as UTF-8 by Marshal. If we don't transform these here, then
|
422
|
+
# puts will fail as it tries to render UTF-8 characters as ASCII-8BIT
|
423
|
+
# which is not valid.
|
424
|
+
if val && val.encoding == Encoding::ASCII_8BIT
|
425
|
+
# Dup the string as it is a frozen literal.
|
426
|
+
val = val.dup.force_encoding("UTF-8")
|
427
|
+
end
|
428
|
+
|
346
429
|
if %r{[^\w\-/]} =~ val
|
347
430
|
# If the string contains any special characters, escape any double
|
348
431
|
# quotes it has, remove newlines, and wrap the whole thing in quotes.
|
data/lib/stripe/version.rb
CHANGED
data/lib/stripe/webhook.rb
CHANGED
@@ -108,8 +108,9 @@ module Stripe
|
|
108
108
|
end
|
109
109
|
|
110
110
|
if tolerance && timestamp < Time.now - tolerance
|
111
|
+
formatted_timestamp = Time.at(timestamp).strftime("%F %T")
|
111
112
|
raise SignatureVerificationError.new(
|
112
|
-
"Timestamp outside the tolerance zone (#{
|
113
|
+
"Timestamp outside the tolerance zone (#{formatted_timestamp})",
|
113
114
|
header, http_body: payload
|
114
115
|
)
|
115
116
|
end
|
data/lib/stripe.rb
CHANGED
@@ -15,6 +15,7 @@ require "uri"
|
|
15
15
|
require "forwardable"
|
16
16
|
|
17
17
|
# Version
|
18
|
+
require "stripe/api_version"
|
18
19
|
require "stripe/version"
|
19
20
|
|
20
21
|
# API operations
|
@@ -24,6 +25,7 @@ require "stripe/api_operations/list"
|
|
24
25
|
require "stripe/api_operations/nested_resource"
|
25
26
|
require "stripe/api_operations/request"
|
26
27
|
require "stripe/api_operations/save"
|
28
|
+
require "stripe/api_operations/search"
|
27
29
|
|
28
30
|
# API resource support classes
|
29
31
|
require "stripe/errors"
|
@@ -35,8 +37,10 @@ require "stripe/stripe_client"
|
|
35
37
|
require "stripe/stripe_object"
|
36
38
|
require "stripe/stripe_response"
|
37
39
|
require "stripe/list_object"
|
40
|
+
require "stripe/search_result_object"
|
38
41
|
require "stripe/error_object"
|
39
42
|
require "stripe/api_resource"
|
43
|
+
require "stripe/api_resource_test_helpers"
|
40
44
|
require "stripe/singleton_api_resource"
|
41
45
|
require "stripe/webhook"
|
42
46
|
require "stripe/stripe_configuration"
|
@@ -103,7 +107,7 @@ module Stripe
|
|
103
107
|
# with API requests. Useful for plugin authors to identify their plugin when
|
104
108
|
# communicating with Stripe.
|
105
109
|
#
|
106
|
-
# Takes a name and optional
|
110
|
+
# Takes a name and optional partner program ID, plugin URL, and version.
|
107
111
|
def self.set_app_info(name, partner_id: nil, url: nil, version: nil)
|
108
112
|
@app_info = {
|
109
113
|
name: name,
|
data/stripe.gemspec
CHANGED
@@ -13,16 +13,16 @@ Gem::Specification.new do |s|
|
|
13
13
|
"See https://stripe.com for details."
|
14
14
|
s.author = "Stripe"
|
15
15
|
s.email = "support@stripe.com"
|
16
|
-
s.homepage = "https://stripe.com/docs/api
|
16
|
+
s.homepage = "https://stripe.com/docs/api?lang=ruby"
|
17
17
|
s.license = "MIT"
|
18
18
|
|
19
19
|
s.metadata = {
|
20
20
|
"bug_tracker_uri" => "https://github.com/stripe/stripe-ruby/issues",
|
21
21
|
"changelog_uri" =>
|
22
22
|
"https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md",
|
23
|
-
"documentation_uri" => "https://stripe.com/docs/api
|
23
|
+
"documentation_uri" => "https://stripe.com/docs/api?lang=ruby",
|
24
24
|
"github_repo" => "ssh://github.com/stripe/stripe-ruby",
|
25
|
-
"homepage_uri" => "https://stripe.com/docs/api
|
25
|
+
"homepage_uri" => "https://stripe.com/docs/api?lang=ruby",
|
26
26
|
"source_code_uri" => "https://github.com/stripe/stripe-ruby",
|
27
27
|
}
|
28
28
|
|
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: 10.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-02 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.
|
@@ -24,6 +24,8 @@ files:
|
|
24
24
|
- Gemfile
|
25
25
|
- History.txt
|
26
26
|
- LICENSE
|
27
|
+
- Makefile
|
28
|
+
- OPENAPI_VERSION
|
27
29
|
- README.md
|
28
30
|
- Rakefile
|
29
31
|
- VERSION
|
@@ -36,7 +38,10 @@ files:
|
|
36
38
|
- lib/stripe/api_operations/nested_resource.rb
|
37
39
|
- lib/stripe/api_operations/request.rb
|
38
40
|
- lib/stripe/api_operations/save.rb
|
41
|
+
- lib/stripe/api_operations/search.rb
|
39
42
|
- lib/stripe/api_resource.rb
|
43
|
+
- lib/stripe/api_resource_test_helpers.rb
|
44
|
+
- lib/stripe/api_version.rb
|
40
45
|
- lib/stripe/connection_manager.rb
|
41
46
|
- lib/stripe/error_object.rb
|
42
47
|
- lib/stripe/errors.rb
|
@@ -48,19 +53,20 @@ files:
|
|
48
53
|
- lib/stripe/resources.rb
|
49
54
|
- lib/stripe/resources/account.rb
|
50
55
|
- lib/stripe/resources/account_link.rb
|
56
|
+
- lib/stripe/resources/account_session.rb
|
51
57
|
- lib/stripe/resources/alipay_account.rb
|
52
58
|
- lib/stripe/resources/apple_pay_domain.rb
|
53
59
|
- lib/stripe/resources/application_fee.rb
|
54
60
|
- lib/stripe/resources/application_fee_refund.rb
|
61
|
+
- lib/stripe/resources/apps/secret.rb
|
55
62
|
- lib/stripe/resources/balance.rb
|
56
63
|
- lib/stripe/resources/balance_transaction.rb
|
57
64
|
- lib/stripe/resources/bank_account.rb
|
58
65
|
- lib/stripe/resources/billing_portal/configuration.rb
|
59
66
|
- lib/stripe/resources/billing_portal/session.rb
|
60
|
-
- lib/stripe/resources/bitcoin_receiver.rb
|
61
|
-
- lib/stripe/resources/bitcoin_transaction.rb
|
62
67
|
- lib/stripe/resources/capability.rb
|
63
68
|
- lib/stripe/resources/card.rb
|
69
|
+
- lib/stripe/resources/cash_balance.rb
|
64
70
|
- lib/stripe/resources/charge.rb
|
65
71
|
- lib/stripe/resources/checkout/session.rb
|
66
72
|
- lib/stripe/resources/country_spec.rb
|
@@ -69,6 +75,7 @@ files:
|
|
69
75
|
- lib/stripe/resources/credit_note_line_item.rb
|
70
76
|
- lib/stripe/resources/customer.rb
|
71
77
|
- lib/stripe/resources/customer_balance_transaction.rb
|
78
|
+
- lib/stripe/resources/customer_cash_balance_transaction.rb
|
72
79
|
- lib/stripe/resources/discount.rb
|
73
80
|
- lib/stripe/resources/dispute.rb
|
74
81
|
- lib/stripe/resources/ephemeral_key.rb
|
@@ -76,6 +83,11 @@ files:
|
|
76
83
|
- lib/stripe/resources/exchange_rate.rb
|
77
84
|
- lib/stripe/resources/file.rb
|
78
85
|
- lib/stripe/resources/file_link.rb
|
86
|
+
- lib/stripe/resources/financial_connections/account.rb
|
87
|
+
- lib/stripe/resources/financial_connections/account_owner.rb
|
88
|
+
- lib/stripe/resources/financial_connections/account_ownership.rb
|
89
|
+
- lib/stripe/resources/financial_connections/session.rb
|
90
|
+
- lib/stripe/resources/funding_instructions.rb
|
79
91
|
- lib/stripe/resources/identity/verification_report.rb
|
80
92
|
- lib/stripe/resources/identity/verification_session.rb
|
81
93
|
- lib/stripe/resources/invoice.rb
|
@@ -83,17 +95,18 @@ files:
|
|
83
95
|
- lib/stripe/resources/invoice_line_item.rb
|
84
96
|
- lib/stripe/resources/issuing/authorization.rb
|
85
97
|
- lib/stripe/resources/issuing/card.rb
|
86
|
-
- lib/stripe/resources/issuing/card_details.rb
|
87
98
|
- lib/stripe/resources/issuing/cardholder.rb
|
88
99
|
- lib/stripe/resources/issuing/dispute.rb
|
100
|
+
- lib/stripe/resources/issuing/token.rb
|
89
101
|
- lib/stripe/resources/issuing/transaction.rb
|
90
102
|
- lib/stripe/resources/line_item.rb
|
91
103
|
- lib/stripe/resources/login_link.rb
|
92
104
|
- lib/stripe/resources/mandate.rb
|
93
|
-
- lib/stripe/resources/order.rb
|
94
|
-
- lib/stripe/resources/order_return.rb
|
95
105
|
- lib/stripe/resources/payment_intent.rb
|
106
|
+
- lib/stripe/resources/payment_link.rb
|
96
107
|
- lib/stripe/resources/payment_method.rb
|
108
|
+
- lib/stripe/resources/payment_method_configuration.rb
|
109
|
+
- lib/stripe/resources/payment_method_domain.rb
|
97
110
|
- lib/stripe/resources/payout.rb
|
98
111
|
- lib/stripe/resources/person.rb
|
99
112
|
- lib/stripe/resources/plan.rb
|
@@ -104,7 +117,6 @@ files:
|
|
104
117
|
- lib/stripe/resources/radar/early_fraud_warning.rb
|
105
118
|
- lib/stripe/resources/radar/value_list.rb
|
106
119
|
- lib/stripe/resources/radar/value_list_item.rb
|
107
|
-
- lib/stripe/resources/recipient.rb
|
108
120
|
- lib/stripe/resources/recipient_transfer.rb
|
109
121
|
- lib/stripe/resources/refund.rb
|
110
122
|
- lib/stripe/resources/reporting/report_run.rb
|
@@ -113,26 +125,45 @@ files:
|
|
113
125
|
- lib/stripe/resources/review.rb
|
114
126
|
- lib/stripe/resources/setup_attempt.rb
|
115
127
|
- lib/stripe/resources/setup_intent.rb
|
128
|
+
- lib/stripe/resources/shipping_rate.rb
|
116
129
|
- lib/stripe/resources/sigma/scheduled_query_run.rb
|
117
|
-
- lib/stripe/resources/sku.rb
|
118
130
|
- lib/stripe/resources/source.rb
|
119
131
|
- lib/stripe/resources/source_transaction.rb
|
120
132
|
- lib/stripe/resources/subscription.rb
|
121
133
|
- lib/stripe/resources/subscription_item.rb
|
122
134
|
- lib/stripe/resources/subscription_schedule.rb
|
135
|
+
- lib/stripe/resources/tax/calculation.rb
|
136
|
+
- lib/stripe/resources/tax/calculation_line_item.rb
|
137
|
+
- lib/stripe/resources/tax/registration.rb
|
138
|
+
- lib/stripe/resources/tax/settings.rb
|
139
|
+
- lib/stripe/resources/tax/transaction.rb
|
140
|
+
- lib/stripe/resources/tax/transaction_line_item.rb
|
123
141
|
- lib/stripe/resources/tax_code.rb
|
124
142
|
- lib/stripe/resources/tax_id.rb
|
125
143
|
- lib/stripe/resources/tax_rate.rb
|
144
|
+
- lib/stripe/resources/terminal/configuration.rb
|
126
145
|
- lib/stripe/resources/terminal/connection_token.rb
|
127
146
|
- lib/stripe/resources/terminal/location.rb
|
128
147
|
- lib/stripe/resources/terminal/reader.rb
|
129
|
-
- lib/stripe/resources/
|
148
|
+
- lib/stripe/resources/test_helpers/test_clock.rb
|
130
149
|
- lib/stripe/resources/token.rb
|
131
150
|
- lib/stripe/resources/topup.rb
|
132
151
|
- lib/stripe/resources/transfer.rb
|
152
|
+
- lib/stripe/resources/treasury/credit_reversal.rb
|
153
|
+
- lib/stripe/resources/treasury/debit_reversal.rb
|
154
|
+
- lib/stripe/resources/treasury/financial_account.rb
|
155
|
+
- lib/stripe/resources/treasury/financial_account_features.rb
|
156
|
+
- lib/stripe/resources/treasury/inbound_transfer.rb
|
157
|
+
- lib/stripe/resources/treasury/outbound_payment.rb
|
158
|
+
- lib/stripe/resources/treasury/outbound_transfer.rb
|
159
|
+
- lib/stripe/resources/treasury/received_credit.rb
|
160
|
+
- lib/stripe/resources/treasury/received_debit.rb
|
161
|
+
- lib/stripe/resources/treasury/transaction.rb
|
162
|
+
- lib/stripe/resources/treasury/transaction_entry.rb
|
133
163
|
- lib/stripe/resources/usage_record.rb
|
134
164
|
- lib/stripe/resources/usage_record_summary.rb
|
135
165
|
- lib/stripe/resources/webhook_endpoint.rb
|
166
|
+
- lib/stripe/search_result_object.rb
|
136
167
|
- lib/stripe/singleton_api_resource.rb
|
137
168
|
- lib/stripe/stripe_client.rb
|
138
169
|
- lib/stripe/stripe_configuration.rb
|
@@ -142,15 +173,15 @@ files:
|
|
142
173
|
- lib/stripe/version.rb
|
143
174
|
- lib/stripe/webhook.rb
|
144
175
|
- stripe.gemspec
|
145
|
-
homepage: https://stripe.com/docs/api
|
176
|
+
homepage: https://stripe.com/docs/api?lang=ruby
|
146
177
|
licenses:
|
147
178
|
- MIT
|
148
179
|
metadata:
|
149
180
|
bug_tracker_uri: https://github.com/stripe/stripe-ruby/issues
|
150
181
|
changelog_uri: https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md
|
151
|
-
documentation_uri: https://stripe.com/docs/api
|
182
|
+
documentation_uri: https://stripe.com/docs/api?lang=ruby
|
152
183
|
github_repo: ssh://github.com/stripe/stripe-ruby
|
153
|
-
homepage_uri: https://stripe.com/docs/api
|
184
|
+
homepage_uri: https://stripe.com/docs/api?lang=ruby
|
154
185
|
source_code_uri: https://github.com/stripe/stripe-ruby
|
155
186
|
post_install_message:
|
156
187
|
rdoc_options: []
|
@@ -167,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
198
|
- !ruby/object:Gem::Version
|
168
199
|
version: '0'
|
169
200
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
201
|
+
rubygems_version: 3.3.26
|
171
202
|
signing_key:
|
172
203
|
specification_version: 4
|
173
204
|
summary: Ruby bindings for the Stripe API
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# File generated from our OpenAPI spec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Stripe
|
5
|
-
# Directly creating or retrieving BitcoinReceivers is deprecated. Please use
|
6
|
-
# the Sources API instead: https://stripe.com/docs/sources/bitcoin
|
7
|
-
class BitcoinReceiver < APIResource
|
8
|
-
extend Stripe::APIOperations::List
|
9
|
-
|
10
|
-
OBJECT_NAME = "bitcoin_receiver"
|
11
|
-
|
12
|
-
def self.resource_url
|
13
|
-
"/v1/bitcoin/receivers"
|
14
|
-
end
|
15
|
-
|
16
|
-
def resource_url
|
17
|
-
if respond_to?(:customer) && !customer.nil? && customer != ""
|
18
|
-
"#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
|
19
|
-
else
|
20
|
-
"#{self.class.resource_url}/#{CGI.escape(id)}"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# File generated from our OpenAPI spec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Stripe
|
5
|
-
# Directly retrieving BitcoinTransactions is deprecated. Please use
|
6
|
-
# the Sources API instead: https://stripe.com/docs/sources/bitcoin
|
7
|
-
class BitcoinTransaction < APIResource
|
8
|
-
extend Stripe::APIOperations::List
|
9
|
-
|
10
|
-
OBJECT_NAME = "bitcoin_transaction"
|
11
|
-
|
12
|
-
def self.resource_url
|
13
|
-
"/v1/bitcoin/transactions"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# File generated from our OpenAPI spec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Stripe
|
5
|
-
class Order < APIResource
|
6
|
-
extend Stripe::APIOperations::Create
|
7
|
-
extend Stripe::APIOperations::List
|
8
|
-
include Stripe::APIOperations::Save
|
9
|
-
|
10
|
-
OBJECT_NAME = "order"
|
11
|
-
|
12
|
-
custom_method :pay, http_verb: :post
|
13
|
-
custom_method :return_order, http_verb: :post, http_path: "returns"
|
14
|
-
|
15
|
-
def pay(params = {}, opts = {})
|
16
|
-
request_stripe_object(
|
17
|
-
method: :post,
|
18
|
-
path: resource_url + "/pay",
|
19
|
-
params: params,
|
20
|
-
opts: opts
|
21
|
-
)
|
22
|
-
end
|
23
|
-
|
24
|
-
def return_order(params = {}, opts = {})
|
25
|
-
request_stripe_object(
|
26
|
-
method: :post,
|
27
|
-
path: resource_url + "/returns",
|
28
|
-
params: params,
|
29
|
-
opts: opts
|
30
|
-
)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# File generated from our OpenAPI spec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Stripe
|
5
|
-
# Recipients objects are deprecated. Please use Stripe Connect instead.
|
6
|
-
class Recipient < APIResource
|
7
|
-
extend Stripe::APIOperations::Create
|
8
|
-
include Stripe::APIOperations::Delete
|
9
|
-
extend Stripe::APIOperations::List
|
10
|
-
include Stripe::APIOperations::Save
|
11
|
-
|
12
|
-
OBJECT_NAME = "recipient"
|
13
|
-
end
|
14
|
-
end
|
data/lib/stripe/resources/sku.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# File generated from our OpenAPI spec
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module Stripe
|
5
|
-
class SKU < APIResource
|
6
|
-
extend Stripe::APIOperations::Create
|
7
|
-
include Stripe::APIOperations::Delete
|
8
|
-
extend Stripe::APIOperations::List
|
9
|
-
include Stripe::APIOperations::Save
|
10
|
-
|
11
|
-
OBJECT_NAME = "sku"
|
12
|
-
end
|
13
|
-
end
|