stripe 12.0.0 → 12.1.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: 446974a2656e8116ce09817c52f60f15016378f1e755c05b23b32dd87ab95674
4
- data.tar.gz: fcbf3d1a8dcbfafdd94535193b3ebf75dc3e25b39b06cd4f7acdbac9e6e8b49b
3
+ metadata.gz: 9aca4084cfbcc4eec52a2f5b1756be4ac140769e46520bd644967473468898fc
4
+ data.tar.gz: b6b4350bc34d08ba00eb6791e53ec5a570345c86930149032305dd58bce9374c
5
5
  SHA512:
6
- metadata.gz: 2e1605800ffbad689caa7bce3a02e17cfdb0d22602f488308d3e75fb9ff663613e8d82259a96abc0e6c9f7808344d7ae70259360f985f2d6a552cd10922a6aca
7
- data.tar.gz: 197e67cb767c40385844d05320f0543343ed16e3714b412a17cff5cb2d14cbb5ee71f5e32efc0d3d760c2f4343c42e24c4c09c290b71ce6ba58d6d6799e39a7c
6
+ metadata.gz: 5a59e650d1e896c9d3f4c549518a0837f0593f05be7c18373ad51125849edbaec032295742bf79f7727efc568edc26464307b9e285831cdd61e3ef6e9df62e14
7
+ data.tar.gz: 3d0c0ab2d096538c0db2ed09f2ebb263f299fbffa524d0713c7a6026c328fc7647116270f4badcb83ea3264d64a885a78093329f30d3d2bec82bdc07fa05ace3
data/CHANGELOG.md CHANGED
@@ -1,4 +1,19 @@
1
1
  # Changelog
2
+ ## 12.1.0 - 2024-07-05
3
+ * [#1425](https://github.com/stripe/stripe-ruby/pull/1425) Update generated code
4
+ * Add support for `add_lines`, `remove_lines`, and `update_lines` methods on resource `Invoice`
5
+ * [#1420](https://github.com/stripe/stripe-ruby/pull/1420) Update static methods for delete/list on BankAccount/Card to throw NotImplementedError
6
+ * The below methods have been throwing `InvalidRequestError` because the urls used to make the requests have been buggy. Updating them to throw `NotImplementedError` instead just like their counterparts for update & retrieve because they cannot be implemented without the parent id.
7
+
8
+ Methods affected | Use these instead in the context of payment method | Use these in the context of external accounts
9
+ ------ | ------ | ----
10
+ Stripe:: BankAccount.delete | Stripe::Customer.delete_source | Stripe::Account.delete_external_account
11
+ Stripe:: BankAccount.list | Stripe::Customer.list_sources | Stripe::Customer.list_external_accounts
12
+ Stripe:: Card.delete | Stripe::Customer.delete_source | Stripe::Account.delete_external_account
13
+ Stripe:: Card.list | Stripe::Customer.list_sources | Stripe::Customer.list_external_accounts
14
+ * [#1427](https://github.com/stripe/stripe-ruby/pull/1427) Regenerate rbis
15
+ * [#1426](https://github.com/stripe/stripe-ruby/pull/1426) Remove coveralls and re-added JRuby
16
+
2
17
  ## 12.0.0 - 2024-06-24
3
18
  * [#1418](https://github.com/stripe/stripe-ruby/pull/1418) Add missing static method for verify on BankAccount
4
19
  * [#1419](https://github.com/stripe/stripe-ruby/pull/1419)
data/Gemfile CHANGED
@@ -5,7 +5,6 @@ source "https://rubygems.org"
5
5
  gemspec
6
6
 
7
7
  group :development do
8
- gem "coveralls_reborn", "~> 0.25.0" if RUBY_VERSION >= "3.1"
9
8
  gem "mocha", "~> 1.16.0"
10
9
  gem "rack", ">= 2.0.6"
11
10
  gem "rake"
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v1093
1
+ v1111
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/stripe.svg)](https://badge.fury.io/rb/stripe)
4
4
  [![Build Status](https://github.com/stripe/stripe-ruby/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-ruby/actions?query=branch%3Amaster)
5
- [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-ruby/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-ruby?branch=master)
6
5
 
7
6
  The Stripe Ruby library provides convenient access to the Stripe API from
8
7
  applications written in the Ruby language. It includes a pre-defined set of
data/VERSION CHANGED
@@ -1 +1 @@
1
- 12.0.0
1
+ 12.1.0
@@ -64,12 +64,12 @@ module Stripe
64
64
  end
65
65
 
66
66
  def self.delete(id, params = {}, opts = {})
67
- request_stripe_object(
68
- method: :delete,
69
- path: "#{resource_url}/#{id}",
70
- params: params,
71
- opts: opts
72
- )
67
+ raise NotImplementedError,
68
+ "Bank accounts cannot be deleted without a customer ID or an " \
69
+ "account ID. Delete a bank account using " \
70
+ "`Customer.delete_source('customer_id', 'bank_account_id')` " \
71
+ "or `Account.delete_external_account('account_id', " \
72
+ "'bank_account_id')`"
73
73
  end
74
74
 
75
75
  def delete(params = {}, opts = {})
@@ -82,12 +82,11 @@ module Stripe
82
82
  end
83
83
 
84
84
  def self.list(filters = {}, opts = {})
85
- request_stripe_object(
86
- method: :delete,
87
- path: resource_url.to_s,
88
- params: filters,
89
- opts: opts
90
- )
85
+ raise NotImplementedError,
86
+ "Bank accounts cannot be listed without a customer ID or an " \
87
+ "account ID. List bank accounts using " \
88
+ "`Customer.list_sources('customer_id')` " \
89
+ "or `Account.list_external_accounts('account_id')`"
91
90
  end
92
91
  end
93
92
  end
@@ -42,12 +42,11 @@ module Stripe
42
42
  end
43
43
 
44
44
  def self.delete(id, params = {}, opts = {})
45
- request_stripe_object(
46
- method: :delete,
47
- path: "#{resource_url}/#{id}",
48
- params: params,
49
- opts: opts
50
- )
45
+ raise NotImplementedError,
46
+ "Card cannot be deleted without a customer ID or an account " \
47
+ "ID. Delete a card using `Customer.delete_source(" \
48
+ "'customer_id', 'card_id')` or " \
49
+ "`Account.delete_external_account('account_id', 'card_id')`"
51
50
  end
52
51
 
53
52
  def delete(params = {}, opts = {})
@@ -60,12 +59,11 @@ module Stripe
60
59
  end
61
60
 
62
61
  def self.list(filters = {}, opts = {})
63
- request_stripe_object(
64
- method: :delete,
65
- path: resource_url.to_s,
66
- params: filters,
67
- opts: opts
68
- )
62
+ raise NotImplementedError,
63
+ "Cards cannot be listed without a customer ID or an account " \
64
+ "ID. List cards using `Customer.list_sources(" \
65
+ "'customer_id')` or " \
66
+ "`Account.list_external_accounts('account_id')`"
69
67
  end
70
68
  end
71
69
  end
@@ -2,8 +2,8 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
- # A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)
6
- # control over a customer.
5
+ # A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
6
+ # control over a Customer.
7
7
  class CustomerSession < APIResource
8
8
  extend Stripe::APIOperations::Create
9
9
 
@@ -12,7 +12,7 @@ module Stripe
12
12
  "customer_session"
13
13
  end
14
14
 
15
- # Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
15
+ # Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
16
16
  def self.create(params = {}, opts = {})
17
17
  request_stripe_object(
18
18
  method: :post,
@@ -49,6 +49,26 @@ module Stripe
49
49
 
50
50
  nested_resource_class_methods :line, operations: %i[list]
51
51
 
52
+ # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
53
+ def add_lines(params = {}, opts = {})
54
+ request_stripe_object(
55
+ method: :post,
56
+ path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(self["id"]) }),
57
+ params: params,
58
+ opts: opts
59
+ )
60
+ end
61
+
62
+ # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
63
+ def self.add_lines(invoice, params = {}, opts = {})
64
+ request_stripe_object(
65
+ method: :post,
66
+ path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(invoice) }),
67
+ params: params,
68
+ opts: opts
69
+ )
70
+ end
71
+
52
72
  # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
53
73
  def self.create(params = {}, opts = {})
54
74
  request_stripe_object(method: :post, path: "/v1/invoices", params: params, opts: opts)
@@ -165,6 +185,26 @@ module Stripe
165
185
  )
166
186
  end
167
187
 
188
+ # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
189
+ def remove_lines(params = {}, opts = {})
190
+ request_stripe_object(
191
+ method: :post,
192
+ path: format("/v1/invoices/%<invoice>s/remove_lines", { invoice: CGI.escape(self["id"]) }),
193
+ params: params,
194
+ opts: opts
195
+ )
196
+ end
197
+
198
+ # Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
199
+ def self.remove_lines(invoice, params = {}, opts = {})
200
+ request_stripe_object(
201
+ method: :post,
202
+ path: format("/v1/invoices/%<invoice>s/remove_lines", { invoice: CGI.escape(invoice) }),
203
+ params: params,
204
+ opts: opts
205
+ )
206
+ end
207
+
168
208
  def self.search(params = {}, opts = {})
169
209
  request_stripe_object(method: :get, path: "/v1/invoices/search", params: params, opts: opts)
170
210
  end
@@ -223,6 +263,26 @@ module Stripe
223
263
  )
224
264
  end
225
265
 
266
+ # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
267
+ def update_lines(params = {}, opts = {})
268
+ request_stripe_object(
269
+ method: :post,
270
+ path: format("/v1/invoices/%<invoice>s/update_lines", { invoice: CGI.escape(self["id"]) }),
271
+ params: params,
272
+ opts: opts
273
+ )
274
+ end
275
+
276
+ # Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
277
+ def self.update_lines(invoice, params = {}, opts = {})
278
+ request_stripe_object(
279
+ method: :post,
280
+ path: format("/v1/invoices/%<invoice>s/update_lines", { invoice: CGI.escape(invoice) }),
281
+ params: params,
282
+ opts: opts
283
+ )
284
+ end
285
+
226
286
  # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
227
287
  #
228
288
  # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "12.0.0"
4
+ VERSION = "12.1.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: 12.0.0
4
+ version: 12.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-24 00:00:00.000000000 Z
11
+ date: 2024-07-05 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.