stripe 5.38.0 → 5.42.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c7a2e67a4d91e1a22dff9303644b5f2efb74675bce05e364fff8d287f3fa8bd
4
- data.tar.gz: a560d866c948d0bbc8f3389571c313da67a26650a771159fa785d7a1e3beccc9
3
+ metadata.gz: 59ec737c599289ebecd1ba030eadd9a2ae4ab262f1495d1de5a5ed4757cc542a
4
+ data.tar.gz: dbc4cbf84351eec5c7fb641db3b00cf8b92b2605aedb8efc266733238cad4f6a
5
5
  SHA512:
6
- metadata.gz: a257d84bec5ef9fe3005b362da5c5194a71e257e77baa71c5872b990fefc3e3ee7cc26201d773cf4f5ca29af0fd8b2d3f3b047e11a833c51aba7bca2f6b3947a
7
- data.tar.gz: eae3ef2579f9ce37a5e447cd46ca67bdfebc2324e5767cc0925d7f2bee5d8f289a69512ff9221cb28bdd9c4ec39a8cea1f7b5af14b67d18b2fa8a3c9ce7dbb47
6
+ metadata.gz: '08f077d4f908041fea497c83eb105713e3d324d39ff037067de53a4bc3f0d8bb9ba84f0c13d873c4b0a86d1d04345974ef67bb1a3051c53616368bd74f86c385'
7
+ data.tar.gz: 8cd83d8c0568b831e3aa17d74aa7ae81396215c98e0978f0c4ec930cd437f7d3784a9be4cce33f82454f6801607a38be9792aef0ec0242770094f059e368343f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.42.0 - 2021-12-13
4
+ * [#1022](https://github.com/stripe/stripe-ruby/pull/1022) Add connection manager logging and include object IDs in logging.
5
+
6
+ ## 5.41.0 - 2021-11-16
7
+ * [#1017](https://github.com/stripe/stripe-ruby/pull/1017) API Updates
8
+ * Add support for new resource `ShippingRate`
9
+
10
+ ## 5.40.0 - 2021-11-11
11
+ * [#1015](https://github.com/stripe/stripe-ruby/pull/1015) API Updates
12
+ * Add support for `expire` method on resource `Checkout.Session`
13
+ * [#1013](https://github.com/stripe/stripe-ruby/pull/1013) Add tests for child resources.
14
+ * [#1012](https://github.com/stripe/stripe-ruby/pull/1012) Add tests for namespaced resources.
15
+ * [#1011](https://github.com/stripe/stripe-ruby/pull/1011) codegen: 3 more files
16
+
17
+ ## 5.39.0 - 2021-10-11
18
+ * [#1010](https://github.com/stripe/stripe-ruby/pull/1010) API Updates
19
+ * Add support for `list_payment_methods` method on resource `Customer`
20
+
3
21
  ## 5.38.0 - 2021-08-10
4
22
  * [#993](https://github.com/stripe/stripe-ruby/pull/993) Add `request_id` to RequestEndEvent
5
23
  * [#991](https://github.com/stripe/stripe-ruby/pull/991) Codegen more files
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.38.0
1
+ 5.42.0
@@ -103,13 +103,34 @@ module Stripe
103
103
  headers
104
104
  )
105
105
 
106
- @mutex.synchronize do
106
+ Util.log_debug("ConnectionManager starting request",
107
+ method_name: method_name,
108
+ path: path,
109
+ process_id: Process.pid,
110
+ thread_object_id: Thread.current.object_id,
111
+ connection_manager_object_id: object_id,
112
+ connection_object_id: connection.object_id,
113
+ log_timestamp: Util.monotonic_time)
114
+
115
+ resp = @mutex.synchronize do
107
116
  # The block parameter is special here. If a block is provided, the block
108
117
  # is invoked with the Net::HTTPResponse. However, the body will not have
109
118
  # been read yet in the block, and can be streamed by calling
110
119
  # HTTPResponse#read_body.
111
120
  connection.request(request, body, &block)
112
121
  end
122
+
123
+ Util.log_debug("ConnectionManager request complete",
124
+ method_name: method_name,
125
+ path: path,
126
+ process_id: Process.pid,
127
+ thread_object_id: Thread.current.object_id,
128
+ connection_manager_object_id: object_id,
129
+ connection_object_id: connection.object_id,
130
+ response_object_id: resp.object_id,
131
+ log_timestamp: Util.monotonic_time)
132
+
133
+ resp
113
134
  end
114
135
 
115
136
  #
@@ -79,6 +79,7 @@ module Stripe
79
79
  Review::OBJECT_NAME => Review,
80
80
  SetupAttempt::OBJECT_NAME => SetupAttempt,
81
81
  SetupIntent::OBJECT_NAME => SetupIntent,
82
+ ShippingRate::OBJECT_NAME => ShippingRate,
82
83
  Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
83
84
  SKU::OBJECT_NAME => SKU,
84
85
  Source::OBJECT_NAME => Source,
@@ -10,7 +10,18 @@ module Stripe
10
10
 
11
11
  OBJECT_NAME = "checkout.session"
12
12
 
13
+ custom_method :expire, http_verb: :post
14
+
13
15
  nested_resource_class_methods :line_item, operations: %i[list]
16
+
17
+ def expire(params = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :post,
20
+ path: resource_url + "/expire",
21
+ params: params,
22
+ opts: opts
23
+ )
24
+ end
14
25
  end
15
26
  end
16
27
  end
@@ -11,11 +11,22 @@ module Stripe
11
11
 
12
12
  OBJECT_NAME = "customer"
13
13
 
14
+ custom_method :list_payment_methods, http_verb: :get, http_path: "payment_methods"
15
+
14
16
  nested_resource_class_methods :balance_transaction,
15
17
  operations: %i[create retrieve update list]
16
18
  nested_resource_class_methods :tax_id,
17
19
  operations: %i[create retrieve delete list]
18
20
 
21
+ def list_payment_methods(params = {}, opts = {})
22
+ request_stripe_object(
23
+ method: :get,
24
+ path: resource_url + "/payment_methods",
25
+ params: params,
26
+ opts: opts
27
+ )
28
+ end
29
+
19
30
  custom_method :delete_discount, http_verb: :delete, http_path: "discount"
20
31
 
21
32
  save_nested_resource :source
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -1,8 +1,9 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
4
5
  module Issuing
5
- class CardDetails < Stripe::StripeObject
6
+ class CardDetails < StripeObject
6
7
  OBJECT_NAME = "issuing.card_details"
7
8
  end
8
9
  end
@@ -0,0 +1,12 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class ShippingRate < APIResource
6
+ extend Stripe::APIOperations::Create
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "shipping_rate"
11
+ end
12
+ end
@@ -1,3 +1,4 @@
1
+ # File generated from our OpenAPI spec
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module Stripe
@@ -68,6 +68,7 @@ require "stripe/resources/reversal"
68
68
  require "stripe/resources/review"
69
69
  require "stripe/resources/setup_attempt"
70
70
  require "stripe/resources/setup_intent"
71
+ require "stripe/resources/shipping_rate"
71
72
  require "stripe/resources/sigma/scheduled_query_run"
72
73
  require "stripe/resources/sku"
73
74
  require "stripe/resources/source"
@@ -585,7 +585,7 @@ module Stripe
585
585
  handle_error_response(resp, context)
586
586
  end
587
587
 
588
- log_response(context, request_start, http_status, resp.body)
588
+ log_response(context, request_start, http_status, resp.body, resp)
589
589
  notify_request_end(context, request_duration, http_status,
590
590
  num_retries, user_data)
591
591
 
@@ -609,7 +609,7 @@ module Stripe
609
609
  error_context = context.dup_from_response_headers(e.http_headers)
610
610
  http_status = resp.code.to_i
611
611
  log_response(error_context, request_start,
612
- e.http_status, e.http_body)
612
+ e.http_status, e.http_body, resp)
613
613
  else
614
614
  log_response_error(error_context, request_start, e)
615
615
  end
@@ -903,10 +903,13 @@ module Stripe
903
903
  body: context.body,
904
904
  idempotency_key: context.idempotency_key,
905
905
  query: context.query,
906
- config: config)
906
+ config: config,
907
+ process_id: Process.pid,
908
+ thread_object_id: Thread.current.object_id,
909
+ log_timestamp: Util.monotonic_time)
907
910
  end
908
911
 
909
- private def log_response(context, request_start, status, body)
912
+ private def log_response(context, request_start, status, body, resp)
910
913
  Util.log_info("Response from Stripe API",
911
914
  account: context.account,
912
915
  api_version: context.api_version,
@@ -921,7 +924,11 @@ module Stripe
921
924
  body: body,
922
925
  idempotency_key: context.idempotency_key,
923
926
  request_id: context.request_id,
924
- config: config)
927
+ config: config,
928
+ process_id: Process.pid,
929
+ thread_object_id: Thread.current.object_id,
930
+ response_object_id: resp.object_id,
931
+ log_timestamp: Util.monotonic_time)
925
932
 
926
933
  return unless context.request_id
927
934
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "5.38.0"
4
+ VERSION = "5.42.0"
5
5
  end
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: 5.38.0
4
+ version: 5.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-10 00:00:00.000000000 Z
11
+ date: 2021-12-13 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.
@@ -113,6 +113,7 @@ files:
113
113
  - lib/stripe/resources/review.rb
114
114
  - lib/stripe/resources/setup_attempt.rb
115
115
  - lib/stripe/resources/setup_intent.rb
116
+ - lib/stripe/resources/shipping_rate.rb
116
117
  - lib/stripe/resources/sigma/scheduled_query_run.rb
117
118
  - lib/stripe/resources/sku.rb
118
119
  - lib/stripe/resources/source.rb