stripe 5.24.0 → 5.25.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: dad4d3bffd7ba2748a3331de5d3b97108732144b33818a5e79efd6eb597e4834
4
- data.tar.gz: c46abe2511c5316276921da29766c22aed11bb92b136b53fb7ea82fb542640c5
3
+ metadata.gz: 2bff9fb79cc55a44a50f4f3bf5ae748d3a23a242e283cee0988a27ad0df2c1b3
4
+ data.tar.gz: 668da0eecea17d8fe1714f0cb51639ce8c928be8e21ba0a3ac1ba3c5b0014a62
5
5
  SHA512:
6
- metadata.gz: 824c459fec4234b09e6d04d20b79728db4ccd19e0dc5cbe9874d319a995b62cb7c252dff31fad3c0fae295682bd68cfbb9fb52f0e98044f3708f1999c0f55d16
7
- data.tar.gz: 6f1557c58e7c0ab6e407444208c142953889ec1f2746464804cf38d6766550aca0577902982211a696522f47e5ffc06d304f17c4fc7b4fdfbe60c1603077a72d
6
+ metadata.gz: 0c0cd52e780ad6f033ef5fa5c6966f1a8a51c667cf2ef99190dcaa7a501c1ea58bfe6cdeab55d90b4d308cbeb1596bc716d45ac212b2de0b0667c243d55b6195
7
+ data.tar.gz: 129ea3f6979acbd37fea34fe1dc739e0664ac327118b8768eee49cec4d4b9ac4e70987d8f739d2b121e8535776ed0e2abdcc474343352788c3dd400f0de4b178
@@ -17,7 +17,7 @@ sudo: false
17
17
  env:
18
18
  global:
19
19
  # If changing this number, please also change it in `test/test_helper.rb`.
20
- - STRIPE_MOCK_VERSION=0.95.0
20
+ - STRIPE_MOCK_VERSION=0.98.0
21
21
 
22
22
  cache:
23
23
  directories:
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.25.0 - 2020-09-02
4
+ * [#944](https://github.com/stripe/stripe-ruby/pull/944) Add support for the Issuing Dispute Submit API
5
+
3
6
  ## 5.24.0 - 2020-08-26
4
7
  * [#939](https://github.com/stripe/stripe-ruby/pull/939) Extract configurations into separate object
5
8
  * [#940](https://github.com/stripe/stripe-ruby/pull/940) Fix typo in documentation of `stripe_object.rb`
data/README.md CHANGED
@@ -60,14 +60,14 @@ available in your [Stripe Dashboard][api-keys]. Set `Stripe.api_key` to its
60
60
  value:
61
61
 
62
62
  ```ruby
63
- require "stripe"
64
- Stripe.api_key = "sk_test_..."
63
+ require 'stripe'
64
+ Stripe.api_key = 'sk_test_...'
65
65
 
66
66
  # list customers
67
67
  Stripe::Customer.list()
68
68
 
69
69
  # retrieve single customer
70
- Stripe::Customer.retrieve("cus_123456789")
70
+ Stripe::Customer.retrieve('cus_123456789')
71
71
  ```
72
72
 
73
73
  ### Per-request Configuration
@@ -82,38 +82,38 @@ require "stripe"
82
82
  Stripe::Customer.list(
83
83
  {},
84
84
  {
85
- api_key: "sk_test_...",
86
- stripe_account: "acct_...",
87
- stripe_version: "2018-02-28",
85
+ api_key: 'sk_test_...',
86
+ stripe_account: 'acct_...',
87
+ stripe_version: '2018-02-28',
88
88
  }
89
89
  )
90
90
 
91
91
  Stripe::Customer.retrieve(
92
- "cus_123456789",
92
+ 'cus_123456789',
93
93
  {
94
- api_key: "sk_test_...",
95
- stripe_account: "acct_...",
96
- stripe_version: "2018-02-28",
94
+ api_key: 'sk_test_...',
95
+ stripe_account: 'acct_...',
96
+ stripe_version: '2018-02-28',
97
97
  }
98
98
  )
99
99
 
100
100
  Stripe::Customer.retrieve(
101
101
  {
102
- id: "cus_123456789",
102
+ id: 'cus_123456789',
103
103
  expand: %w(balance_transaction)
104
104
  },
105
105
  {
106
- stripe_version: "2018-02-28",
107
- api_key: "sk_test_...",
106
+ stripe_version: '2018-02-28',
107
+ api_key: 'sk_test_...',
108
108
  }
109
109
  )
110
110
 
111
111
  Stripe::Customer.capture(
112
- "cus_123456789",
112
+ 'cus_123456789',
113
113
  {},
114
114
  {
115
- stripe_version: "2018-02-28",
116
- api_key: "sk_test_...",
115
+ stripe_version: '2018-02-28',
116
+ api_key: 'sk_test_...',
117
117
  }
118
118
  )
119
119
  ```
@@ -136,7 +136,7 @@ method:
136
136
  ```ruby
137
137
  client = Stripe::StripeClient.new
138
138
  customer, resp = client.request do
139
- Stripe::Customer.retrieve("cus_123456789",)
139
+ Stripe::Customer.retrieve('cus_123456789',)
140
140
  end
141
141
  puts resp.request_id
142
142
  ```
@@ -146,7 +146,7 @@ puts resp.request_id
146
146
  A proxy can be configured with `Stripe.proxy`:
147
147
 
148
148
  ```ruby
149
- Stripe.proxy = "https://user:pass@example.com:1234"
149
+ Stripe.proxy = 'https://user:pass@example.com:1234'
150
150
  ```
151
151
 
152
152
  ### Configuring an API Version
@@ -155,7 +155,7 @@ By default, the library will use the API version pinned to the account making
155
155
  a request. This can be overridden with this global option:
156
156
 
157
157
  ```ruby
158
- Stripe.api_version = "2018-02-28"
158
+ Stripe.api_version = '2018-02-28'
159
159
  ```
160
160
 
161
161
  See [versioning in the API reference][versioning] for more information.
@@ -166,7 +166,7 @@ By default, the library will use its own internal bundle of known CA
166
166
  certificates, but it's possible to configure your own:
167
167
 
168
168
  ```ruby
169
- Stripe.ca_bundle_path = "path/to/ca/bundle"
169
+ Stripe.ca_bundle_path = 'path/to/ca/bundle'
170
170
  ```
171
171
 
172
172
  ### Configuring Automatic Retries
@@ -258,7 +258,7 @@ For example:
258
258
  Stripe::Instrumentation.subscribe(:request_end) do |request_event|
259
259
  tags = {
260
260
  method: request_event.method,
261
- resource: request_event.path.split("/")[2],
261
+ resource: request_event.path.split('/')[2],
262
262
  code: request_event.http_status,
263
263
  retries: request_event.num_retries
264
264
  }
@@ -272,7 +272,7 @@ If you're writing a plugin that uses the library, we'd appreciate it if you
272
272
  identified using `#set_app_info`:
273
273
 
274
274
  ```ruby
275
- Stripe.set_app_info("MyAwesomePlugin", version: "1.2.34", url: "https://myawesomeplugin.info");
275
+ Stripe.set_app_info('MyAwesomePlugin', version: '1.2.34', url: 'https://myawesomeplugin.info')
276
276
  ```
277
277
 
278
278
  This information is passed along when the library makes calls to the Stripe
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.24.0
1
+ 5.25.0
@@ -9,6 +9,17 @@ module Stripe
9
9
  include Stripe::APIOperations::Save
10
10
 
11
11
  OBJECT_NAME = "issuing.dispute"
12
+
13
+ custom_method :submit, http_verb: :post
14
+
15
+ def submit(params = {}, opts = {})
16
+ request_stripe_object(
17
+ method: :post,
18
+ path: resource_url + "/submit",
19
+ params: params,
20
+ opts: opts
21
+ )
22
+ end
12
23
  end
13
24
  end
14
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "5.24.0"
4
+ VERSION = "5.25.0"
5
5
  end
@@ -111,15 +111,15 @@ module Stripe
111
111
  end
112
112
 
113
113
  should "send expand when fetching through ListObject" do
114
- stub_request(:get, "#{Stripe.api_base}/v1/customers/cus_123")
115
- .to_return(body: JSON.generate(customer_fixture))
114
+ stub_request(:get, "#{Stripe.api_base}/v1/charges/ch_123")
115
+ .to_return(body: JSON.generate(charge_fixture))
116
116
 
117
- stub_request(:get, "#{Stripe.api_base}/v1/customers/cus_123/sources/cc_test_card")
118
- .with(query: { "expand" => ["customer"] })
119
- .to_return(body: JSON.generate(customer_fixture))
117
+ stub_request(:get, "#{Stripe.api_base}/v1/charges/ch_123/refunds/re_123")
118
+ .with(query: { "expand" => ["balance_transaction"] })
119
+ .to_return(body: JSON.generate(charge_fixture))
120
120
 
121
- customer = Stripe::Customer.retrieve("cus_123")
122
- customer.sources.retrieve(id: "cc_test_card", expand: [:customer])
121
+ charge = Stripe::Charge.retrieve("ch_123")
122
+ charge.refunds.retrieve(id: "re_123", expand: [:balance_transaction])
123
123
  end
124
124
 
125
125
  context "when specifying per-object credentials" do
@@ -5,6 +5,12 @@ require ::File.expand_path("../test_helper", __dir__)
5
5
  module Stripe
6
6
  class CustomerCardTest < Test::Unit::TestCase
7
7
  setup do
8
+ # Unfortunately, the OpenAPI spec has an issue where the sources list has the wrong
9
+ # url so we need to mock this call instead.
10
+ customer_json = { id: "cus_123", object: "customer", sources: { object: "list", data: [], has_more: true, url: "/v1/customers/cus_123/sources" } }
11
+ stub_request(:get, "#{Stripe.api_base}/v1/customers/cus_123")
12
+ .to_return(body: JSON.generate(customer_json))
13
+
8
14
  @customer = Stripe::Customer.retrieve("cus_123")
9
15
  end
10
16
 
@@ -6,7 +6,7 @@ module Stripe
6
6
  module Issuing
7
7
  class DisputeTest < Test::Unit::TestCase
8
8
  should "be creatable" do
9
- dispute = Stripe::Issuing::Dispute.create
9
+ dispute = Stripe::Issuing::Dispute.create(transaction: "ipi_123")
10
10
 
11
11
  assert_requested :post, "#{Stripe.api_base}/v1/issuing/disputes"
12
12
  assert dispute.is_a?(Stripe::Issuing::Dispute)
@@ -30,6 +30,25 @@ module Stripe
30
30
  assert_requested :post, "#{Stripe.api_base}/v1/issuing/disputes/ich_123"
31
31
  assert dispute.is_a?(Stripe::Issuing::Dispute)
32
32
  end
33
+
34
+ context "#submit" do
35
+ should "submit the dispute" do
36
+ dispute = Stripe::Issuing::Dispute.retrieve("idp_123")
37
+ dispute = dispute.submit
38
+ assert_requested :post,
39
+ "#{Stripe.api_base}/v1/issuing/disputes/idp_123/submit"
40
+ assert dispute.is_a?(Stripe::Issuing::Dispute)
41
+ end
42
+ end
43
+
44
+ context ".submit" do
45
+ should "submit the dispute" do
46
+ dispute = Stripe::Issuing::Dispute.submit("idp_123")
47
+ assert_requested :post,
48
+ "#{Stripe.api_base}/v1/issuing/disputes/idp_123/submit"
49
+ assert dispute.is_a?(Stripe::Issuing::Dispute)
50
+ end
51
+ end
33
52
  end
34
53
  end
35
54
  end
@@ -16,7 +16,7 @@ require ::File.expand_path("test_data", __dir__)
16
16
  require ::File.expand_path("stripe_mock", __dir__)
17
17
 
18
18
  # If changing this number, please also change it in `.travis.yml`.
19
- MOCK_MINIMUM_VERSION = "0.95.0"
19
+ MOCK_MINIMUM_VERSION = "0.98.0"
20
20
  MOCK_PORT = Stripe::StripeMock.start
21
21
 
22
22
  # Disable all real network connections except those that are outgoing to
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: 5.24.0
4
+ version: 5.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-26 00:00:00.000000000 Z
11
+ date: 2020-09-02 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.