stripe 13.0.0 → 13.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93281cf4747b2cf59d647ef17cbe034031435578c8729c0bf06eab21cfc04c37
4
- data.tar.gz: a4e618140b391965e3a8deae7055416435a3cfccd3eaabd8b415d27e38beb4f9
3
+ metadata.gz: 8703e26f6493e135c48ab421eb1c197c297e287d1fb89870e949a6267baabc6a
4
+ data.tar.gz: 7a423d816ee6b63331e5c54c2c4ea7f236ae1e1af5b7dedbb151530360ae4830
5
5
  SHA512:
6
- metadata.gz: 1099c298d6ff0fc5ed0db7064679d88c3fe5a48eafa9575a9220404f8d42d3a06b85f61228446c11fce3f06556fa1049f82f78dfd1bd2b0ae25c4e9bd9e73679
7
- data.tar.gz: c9f18b4b29441bae95f73d20787c4fa24f0534a38721e2bf4192956ef7f6ee95ad9f5e83235dba538065e31ea76bdf5fe7340faa7e079b54fe4d7a360a567d42
6
+ metadata.gz: b6d1aa02657c0e6b5a866797f696271e8e26aadf66a05a92fef3e1e814498d3ea540718377d54409f535071af206061acaaa2457052b26a1cee44c4b822ad226
7
+ data.tar.gz: 632f4d3fa56137d1878351cd9892794110723e5289df308fbc0b3e662e0f53279e75836f7237e209c50860424cd3a3e7fcdb633f6375fa4f13cd4b682235af2f
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # Changelog
2
+ ## 13.0.1 - 2024-10-18
3
+ * [#1471](https://github.com/stripe/stripe-ruby/pull/1471) update object tags for meter-related classes
4
+
5
+ - fixes a bug where the `object` property of the `MeterEvent`, `MeterEventAdjustment`, and `MeterEventSession` didn't match the server.
6
+ * [#1470](https://github.com/stripe/stripe-ruby/pull/1470) Cleaned up examples and added documentation
7
+
2
8
  ## 13.0.0 - 2024-10-01
3
9
  * [#1458](https://github.com/stripe/stripe-ruby/pull/1458) Support for APIs in the new API version 2024-09-30.acacia
4
10
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 13.0.0
1
+ 13.0.1
data/examples/README.md CHANGED
@@ -3,9 +3,14 @@
3
3
  From the examples folder, run:
4
4
  `RUBYLIB=../lib ruby your_example.rb`
5
5
 
6
+ e.g.
7
+
8
+ `RUBYLIB=../lib ruby thinevent_webhook_handler.rb`
9
+
6
10
  ## Adding a new example
7
11
 
8
12
  1. Clone new_example.rb
9
13
  2. Implement your example
10
- 3. Run it (as per above)
11
- 4. 👍
14
+ 3. Fill out the file comment. Include a description and key steps that are being demonstrated.
15
+ 4. Run it (as per above)
16
+ 5. 👍
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ # example_template.py - This is a template for defining new examples. It is not intended to be used directly.
4
+ #
5
+ # <describe what this example does>
6
+ #
7
+ # In this example, we:
8
+ # - <key step 1>
9
+ # - <key step 2
10
+ # - ...
11
+ #
12
+ # <describe assumptions about the user's stripe account, environment, or configuration;
13
+ # or things to watch out for when running>
14
+
15
+ require "stripe"
16
+ require "date"
17
+
18
+ class ExampleTemplate
19
+ attr_accessor :api_key
20
+
21
+ def initialize(api_key)
22
+ @api_key = api_key
23
+ end
24
+
25
+ def do_something_great
26
+ puts "Hello World"
27
+ # client = Stripe::StripeClient.new(api_key)
28
+ # client.v1
29
+ end
30
+ end
31
+
32
+ # Send meter events
33
+ api_key = "{{API_KEY}}"
34
+
35
+ example = ExampleTemplate.new(api_key)
36
+ example.do_something_great
@@ -1,5 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # meter_event_stream.py - use the high-throughput meter event stream to report create billing meter events.
4
+ #
5
+ # In this example, we:
6
+ # - create a meter event session and store the session's authentication token
7
+ # - define an event with a payload
8
+ # - use the meter_event_stream service accessor in StripeClient to create an event stream that reports this event
9
+ #
10
+ # This example expects a billing meter with an event_name of 'alpaca_ai_tokens'. If you have
11
+ # a different meter event name, you can change it before running this example.
12
+
3
13
  require "stripe"
4
14
  require "date"
5
15
 
@@ -1,6 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
  # typed: false
3
3
 
4
+ # thinevent_webhook_handler.rb - receive and process thin events like the
5
+ # v1.billing.meter.error_report_triggered event.
6
+ #
7
+ # In this example, we:
8
+ # - create a StripeClient called client
9
+ # - use client.parse_thin_event to parse the received thin event webhook body
10
+ # - call client.v2.core.events.retrieve to retrieve the full event object
11
+ # - if it is a V1BillingMeterErrorReportTriggeredEvent event type, call
12
+ # event.fetchRelatedObject to retrieve the Billing Meter object associated
13
+ # with the event.
14
+
4
15
  require "stripe"
5
16
  require "sinatra"
6
17
 
@@ -6,9 +6,9 @@ module Stripe
6
6
  module Billing
7
7
  # Fix me empty_doc_string.
8
8
  class MeterEvent < APIResource
9
- OBJECT_NAME = "billing.meter_event"
9
+ OBJECT_NAME = "v2.billing.meter_event"
10
10
  def self.object_name
11
- "billing.meter_event"
11
+ "v2.billing.meter_event"
12
12
  end
13
13
  end
14
14
  end
@@ -5,9 +5,9 @@ module Stripe
5
5
  module V2
6
6
  module Billing
7
7
  class MeterEventAdjustment < APIResource
8
- OBJECT_NAME = "billing.meter_event_adjustment"
8
+ OBJECT_NAME = "v2.billing.meter_event_adjustment"
9
9
  def self.object_name
10
- "billing.meter_event_adjustment"
10
+ "v2.billing.meter_event_adjustment"
11
11
  end
12
12
  end
13
13
  end
@@ -5,9 +5,9 @@ module Stripe
5
5
  module V2
6
6
  module Billing
7
7
  class MeterEventSession < APIResource
8
- OBJECT_NAME = "billing.meter_event_session"
8
+ OBJECT_NAME = "v2.billing.meter_event_session"
9
9
  def self.object_name
10
- "billing.meter_event_session"
10
+ "v2.billing.meter_event_session"
11
11
  end
12
12
  end
13
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "13.0.0"
4
+ VERSION = "13.0.1"
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: 13.0.0
4
+ version: 13.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-01 00:00:00.000000000 Z
11
+ date: 2024-10-18 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.
@@ -30,9 +30,9 @@ files:
30
30
  - Rakefile
31
31
  - VERSION
32
32
  - examples/README.md
33
+ - examples/example_template.rb
33
34
  - examples/meter_event_stream.rb
34
- - examples/new_example.rb
35
- - examples/stripe_webhook_handler.rb
35
+ - examples/thinevent_webhook_handler.rb
36
36
  - exe/stripe-console
37
37
  - lib/data/ca-certificates.crt
38
38
  - lib/stripe.rb
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "stripe"
4
- require "date"
5
-
6
- class NewExample
7
- attr_accessor :api_key
8
-
9
- def initialize(api_key)
10
- @api_key = api_key
11
- end
12
-
13
- def do_something_great
14
- puts "Hello World"
15
- # client = Stripe::StripeClient.new(api_key)
16
- # client.v1
17
- end
18
- end
19
-
20
- # Send meter events
21
- api_key = "{{API_KEY}}"
22
-
23
- example = NewExample.new(api_key)
24
- example.do_something_great