stripe 13.0.0 → 13.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/VERSION +1 -1
- data/examples/README.md +7 -2
- data/examples/example_template.rb +36 -0
- data/examples/meter_event_stream.rb +10 -0
- data/examples/{stripe_webhook_handler.rb → thinevent_webhook_handler.rb} +11 -0
- data/lib/stripe/resources/v2/billing/meter_event.rb +2 -2
- data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +2 -2
- data/lib/stripe/resources/v2/billing/meter_event_session.rb +2 -2
- data/lib/stripe/version.rb +1 -1
- metadata +4 -4
- data/examples/new_example.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8703e26f6493e135c48ab421eb1c197c297e287d1fb89870e949a6267baabc6a
|
4
|
+
data.tar.gz: 7a423d816ee6b63331e5c54c2c4ea7f236ae1e1af5b7dedbb151530360ae4830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
data/lib/stripe/version.rb
CHANGED
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.
|
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-
|
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/
|
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
|
data/examples/new_example.rb
DELETED
@@ -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
|