mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-31 00:00:42 -04:00
Compare commits
6 Commits
083c3a104e
...
452f8ca43d
Author | SHA1 | Date | |
---|---|---|---|
|
452f8ca43d | ||
|
4902b4c49d | ||
|
ad26ff3fca | ||
|
ee9b5c7ead | ||
|
3cecb75d46 | ||
|
18fef16be2 |
@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 10.7.0-beta.2 - 2024-01-19
|
||||||
|
* [#1307](https://github.com/stripe/stripe-ruby/pull/1307) Beta: report raw request usage
|
||||||
|
|
||||||
|
|
||||||
## 10.7.0-beta.1 - 2024-01-12
|
## 10.7.0-beta.1 - 2024-01-12
|
||||||
* [#1309](https://github.com/stripe/stripe-ruby/pull/1309) Update generated code for beta
|
* [#1309](https://github.com/stripe/stripe-ruby/pull/1309) Update generated code for beta
|
||||||
* [#1305](https://github.com/stripe/stripe-ruby/pull/1305) Update generated code for beta
|
* [#1305](https://github.com/stripe/stripe-ruby/pull/1305) Update generated code for beta
|
||||||
|
@ -146,8 +146,8 @@ module Stripe
|
|||||||
@opts = {}
|
@opts = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
def execute(method, url, params = {}, opts = {})
|
def execute(method, url, params = {}, opts = {}, usage = [])
|
||||||
resp, = execute_resource_request(method, url, params, opts)
|
resp, = execute_resource_request(method, url, params, opts, usage)
|
||||||
|
|
||||||
resp
|
resp
|
||||||
end
|
end
|
||||||
@ -156,7 +156,7 @@ module Stripe
|
|||||||
# Sends a request to Stripe REST API
|
# Sends a request to Stripe REST API
|
||||||
def self.raw_request(method, url, params = {}, opts = {})
|
def self.raw_request(method, url, params = {}, opts = {})
|
||||||
req = RawRequest.new
|
req = RawRequest.new
|
||||||
req.execute(method, url, params, opts)
|
req.execute(method, url, params, opts, ["raw_request"])
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.deserialize(data)
|
def self.deserialize(data)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Stripe
|
module Stripe
|
||||||
VERSION = "10.7.0-beta.1"
|
VERSION = "10.7.0-beta.2"
|
||||||
end
|
end
|
||||||
|
@ -108,5 +108,21 @@ class RawRequestTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
assert_equal stripe_version_override, req.headers["Stripe-Version"]
|
assert_equal stripe_version_override, req.headers["Stripe-Version"]
|
||||||
end
|
end
|
||||||
|
should "report usage" do
|
||||||
|
expected_body = "{\"id\": \"acc_123\"}"
|
||||||
|
telemetry_header = nil
|
||||||
|
|
||||||
|
Stripe.enable_telemetry = true
|
||||||
|
|
||||||
|
stub_request(:get, "#{Stripe.api_base}/v1/accounts/acc_124")
|
||||||
|
.with { |request| telemetry_header = request.headers["X-Stripe-Client-Telemetry"] }
|
||||||
|
.to_return(body: expected_body)
|
||||||
|
|
||||||
|
Stripe.raw_request(:get, "/v1/accounts/acc_123", {}, {})
|
||||||
|
Stripe.raw_request(:get, "/v1/accounts/acc_124", {}, {})
|
||||||
|
parsed_telemetry_header = JSON.parse(telemetry_header)
|
||||||
|
|
||||||
|
assert(parsed_telemetry_header["last_request_metrics"]["usage"] == ["raw_request"])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user