stripe 13.0.0 → 13.0.2
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +1 -1
- 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/api_resource.rb +0 -1
- 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: 5bb4e5e3353b792a5253af7a6d02d741f0a889b69e96a862b9dd0e7e4b70e5a4
|
4
|
+
data.tar.gz: a64378a08b23ba357d17d807636bc35e95fe3cf4b72c268960859b6a51b066c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ab94f415b05c7671704c9f2aeb11b0f6f3515eedca50564c1568c1cce37825f3459f6369ca95157f0f0d6252119888b26b1efdea03542250faacffba6c17084
|
7
|
+
data.tar.gz: 6e5f594ae791ed24c0e7b998dd0cf5726d8477c14c3d2cb3395a6fe694e2c0da2d4c27e4bd2523d3f8d464a8016fc5dcff95c1b4d8e396ae9194ae7ebbd51a34
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,15 @@
|
|
1
1
|
# Changelog
|
2
|
+
## 13.0.2 - 2024-10-23
|
3
|
+
* [#1473](https://github.com/stripe/stripe-ruby/pull/1473) Always return the result of APIResource#refresh in APIResource.retrieve
|
4
|
+
|
5
|
+
* Fix bug where we would not return the mutated `self` object when calling `APIResource.retrieve`
|
6
|
+
|
7
|
+
## 13.0.1 - 2024-10-18
|
8
|
+
* [#1471](https://github.com/stripe/stripe-ruby/pull/1471) update object tags for meter-related classes
|
9
|
+
|
10
|
+
- fixes a bug where the `object` property of the `MeterEvent`, `MeterEventAdjustment`, and `MeterEventSession` didn't match the server.
|
11
|
+
* [#1470](https://github.com/stripe/stripe-ruby/pull/1470) Cleaned up examples and added documentation
|
12
|
+
|
2
13
|
## 13.0.0 - 2024-10-01
|
3
14
|
* [#1458](https://github.com/stripe/stripe-ruby/pull/1458) Support for APIs in the new API version 2024-09-30.acacia
|
4
15
|
|
data/README.md
CHANGED
@@ -367,7 +367,7 @@ background terminal ([stripe-mock's README][stripe-mock] also contains
|
|
367
367
|
instructions for installing via Homebrew and other methods):
|
368
368
|
|
369
369
|
```sh
|
370
|
-
go
|
370
|
+
go install github.com/stripe/stripe-mock@latest
|
371
371
|
stripe-mock
|
372
372
|
```
|
373
373
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
13.0.
|
1
|
+
13.0.2
|
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
|
|
data/lib/stripe/api_resource.rb
CHANGED
@@ -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.2
|
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-23 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
|