stripe 3.3.2 → 3.4.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.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +20 -0
  4. data/.rubocop_todo.yml +62 -0
  5. data/.travis.yml +1 -1
  6. data/Gemfile +19 -12
  7. data/History.txt +10 -0
  8. data/README.md +5 -1
  9. data/Rakefile +8 -5
  10. data/VERSION +1 -1
  11. data/bin/stripe-console +2 -2
  12. data/lib/stripe.rb +72 -74
  13. data/lib/stripe/account.rb +15 -17
  14. data/lib/stripe/alipay_account.rb +10 -7
  15. data/lib/stripe/api_operations/create.rb +1 -1
  16. data/lib/stripe/api_operations/delete.rb +1 -1
  17. data/lib/stripe/api_operations/list.rb +2 -2
  18. data/lib/stripe/api_operations/request.rb +5 -12
  19. data/lib/stripe/api_operations/save.rb +6 -6
  20. data/lib/stripe/api_resource.rb +7 -9
  21. data/lib/stripe/apple_pay_domain.rb +2 -2
  22. data/lib/stripe/application_fee.rb +5 -5
  23. data/lib/stripe/application_fee_refund.rb +5 -5
  24. data/lib/stripe/balance.rb +1 -1
  25. data/lib/stripe/balance_transaction.rb +2 -2
  26. data/lib/stripe/bank_account.rb +7 -7
  27. data/lib/stripe/bitcoin_receiver.rb +4 -2
  28. data/lib/stripe/bitcoin_transaction.rb +3 -1
  29. data/lib/stripe/card.rb +5 -5
  30. data/lib/stripe/charge.rb +18 -18
  31. data/lib/stripe/country_spec.rb +2 -2
  32. data/lib/stripe/coupon.rb +1 -1
  33. data/lib/stripe/customer.rb +23 -23
  34. data/lib/stripe/dispute.rb +3 -3
  35. data/lib/stripe/ephemeral_key.rb +4 -4
  36. data/lib/stripe/errors.rb +4 -4
  37. data/lib/stripe/event.rb +1 -1
  38. data/lib/stripe/file_upload.rb +5 -5
  39. data/lib/stripe/invoice.rb +7 -7
  40. data/lib/stripe/invoice_item.rb +1 -1
  41. data/lib/stripe/invoice_line_item.rb +1 -1
  42. data/lib/stripe/list_object.rb +14 -18
  43. data/lib/stripe/login_link.rb +3 -3
  44. data/lib/stripe/oauth.rb +15 -13
  45. data/lib/stripe/order.rb +5 -5
  46. data/lib/stripe/order_return.rb +1 -1
  47. data/lib/stripe/payout.rb +3 -3
  48. data/lib/stripe/plan.rb +1 -1
  49. data/lib/stripe/product.rb +1 -1
  50. data/lib/stripe/recipient.rb +3 -2
  51. data/lib/stripe/recipient_transfer.rb +1 -2
  52. data/lib/stripe/refund.rb +1 -1
  53. data/lib/stripe/reversal.rb +5 -5
  54. data/lib/stripe/singleton_api_resource.rb +3 -3
  55. data/lib/stripe/sku.rb +1 -1
  56. data/lib/stripe/source.rb +13 -10
  57. data/lib/stripe/stripe_client.rb +149 -169
  58. data/lib/stripe/stripe_object.rb +77 -76
  59. data/lib/stripe/subscription.rb +5 -5
  60. data/lib/stripe/subscription_item.rb +2 -2
  61. data/lib/stripe/three_d_secure.rb +1 -1
  62. data/lib/stripe/token.rb +1 -1
  63. data/lib/stripe/transfer.rb +3 -3
  64. data/lib/stripe/util.rb +77 -62
  65. data/lib/stripe/version.rb +1 -1
  66. data/lib/stripe/webhook.rb +14 -10
  67. data/stripe.gemspec +14 -14
  68. data/test/stripe/account_test.rb +69 -81
  69. data/test/stripe/alipay_account_test.rb +19 -1
  70. data/test/stripe/api_operations_test.rb +7 -7
  71. data/test/stripe/api_resource_test.rb +224 -260
  72. data/test/stripe/apple_pay_domain_test.rb +8 -8
  73. data/test/stripe/application_fee_refund_test.rb +8 -8
  74. data/test/stripe/application_fee_test.rb +3 -3
  75. data/test/stripe/balance_test.rb +2 -2
  76. data/test/stripe/bank_account_test.rb +9 -11
  77. data/test/stripe/charge_test.rb +11 -11
  78. data/test/stripe/country_spec_test.rb +4 -4
  79. data/test/stripe/coupon_test.rb +10 -10
  80. data/test/stripe/customer_card_test.rb +11 -15
  81. data/test/stripe/customer_test.rb +26 -27
  82. data/test/stripe/dispute_test.rb +8 -8
  83. data/test/stripe/ephemeral_key_test.rb +14 -14
  84. data/test/stripe/errors_test.rb +2 -2
  85. data/test/stripe/file_upload_test.rb +26 -28
  86. data/test/stripe/invoice_item_test.rb +14 -14
  87. data/test/stripe/invoice_line_item_test.rb +1 -1
  88. data/test/stripe/invoice_test.rb +37 -37
  89. data/test/stripe/list_object_test.rb +60 -76
  90. data/test/stripe/login_link_test.rb +14 -14
  91. data/test/stripe/oauth_test.rb +42 -50
  92. data/test/stripe/order_return_test.rb +5 -5
  93. data/test/stripe/order_test.rb +12 -12
  94. data/test/stripe/payout_test.rb +9 -9
  95. data/test/stripe/plan_test.rb +9 -9
  96. data/test/stripe/product_test.rb +8 -8
  97. data/test/stripe/recipient_test.rb +9 -10
  98. data/test/stripe/refund_test.rb +9 -9
  99. data/test/stripe/reversal_test.rb +10 -10
  100. data/test/stripe/sku_test.rb +8 -8
  101. data/test/stripe/source_test.rb +14 -16
  102. data/test/stripe/stripe_client_test.rb +235 -266
  103. data/test/stripe/stripe_object_test.rb +163 -147
  104. data/test/stripe/stripe_response_test.rb +4 -3
  105. data/test/stripe/subscription_item_test.rb +11 -11
  106. data/test/stripe/subscription_test.rb +14 -14
  107. data/test/stripe/three_d_secure_test.rb +2 -2
  108. data/test/stripe/transfer_test.rb +8 -8
  109. data/test/stripe/util_test.rb +59 -57
  110. data/test/stripe/webhook_test.rb +18 -16
  111. data/test/stripe_test.rb +4 -4
  112. data/test/test_data.rb +26 -26
  113. data/test/test_helper.rb +29 -25
  114. metadata +6 -10
  115. data/test/stripe/bitcoin_receiver_test.rb +0 -67
  116. data/test/stripe/bitcoin_transaction_test.rb +0 -19
  117. data/test/stripe/recipient_card_test.rb +0 -44
@@ -2,10 +2,10 @@ module Stripe
2
2
  class CountrySpec < APIResource
3
3
  extend Stripe::APIOperations::List
4
4
 
5
- OBJECT_NAME = 'country_spec'
5
+ OBJECT_NAME = "country_spec".freeze
6
6
 
7
7
  def self.resource_url
8
- '/v1/country_specs'
8
+ "/v1/country_specs"
9
9
  end
10
10
  end
11
11
  end
data/lib/stripe/coupon.rb CHANGED
@@ -5,6 +5,6 @@ module Stripe
5
5
  include Stripe::APIOperations::Delete
6
6
  extend Stripe::APIOperations::List
7
7
 
8
- OBJECT_NAME = 'coupon'
8
+ OBJECT_NAME = "coupon".freeze
9
9
  end
10
10
  end
@@ -5,75 +5,75 @@ module Stripe
5
5
  include Stripe::APIOperations::Save
6
6
  extend Stripe::APIOperations::List
7
7
 
8
- OBJECT_NAME = 'customer'
8
+ OBJECT_NAME = "customer".freeze
9
9
 
10
10
  save_nested_resource :source
11
11
 
12
- def add_invoice_item(params, opts={})
12
+ def add_invoice_item(params, opts = {})
13
13
  opts = @opts.merge(Util.normalize_opts(opts))
14
- InvoiceItem.create(params.merge(:customer => id), opts)
14
+ InvoiceItem.create(params.merge(customer: id), opts)
15
15
  end
16
16
 
17
- def invoices(params={}, opts={})
17
+ def invoices(params = {}, opts = {})
18
18
  opts = @opts.merge(Util.normalize_opts(opts))
19
- Invoice.all(params.merge(:customer => id), opts)
19
+ Invoice.all(params.merge(customer: id), opts)
20
20
  end
21
21
 
22
- def invoice_items(params={}, opts={})
22
+ def invoice_items(params = {}, opts = {})
23
23
  opts = @opts.merge(Util.normalize_opts(opts))
24
- InvoiceItem.all(params.merge(:customer => id), opts)
24
+ InvoiceItem.all(params.merge(customer: id), opts)
25
25
  end
26
26
 
27
- def upcoming_invoice(params={}, opts={})
27
+ def upcoming_invoice(params = {}, opts = {})
28
28
  opts = @opts.merge(Util.normalize_opts(opts))
29
- Invoice.upcoming(params.merge(:customer => id), opts)
29
+ Invoice.upcoming(params.merge(customer: id), opts)
30
30
  end
31
31
 
32
- def charges(params={}, opts={})
32
+ def charges(params = {}, opts = {})
33
33
  opts = @opts.merge(Util.normalize_opts(opts))
34
- Charge.all(params.merge(:customer => id), opts)
34
+ Charge.all(params.merge(customer: id), opts)
35
35
  end
36
36
 
37
- def create_upcoming_invoice(params={}, opts={})
37
+ def create_upcoming_invoice(params = {}, opts = {})
38
38
  opts = @opts.merge(Util.normalize_opts(opts))
39
- Invoice.create(params.merge(:customer => id), opts)
39
+ Invoice.create(params.merge(customer: id), opts)
40
40
  end
41
41
 
42
- def cancel_subscription(params={}, opts={})
42
+ def cancel_subscription(params = {}, opts = {})
43
43
  resp, opts = request(:delete, subscription_url, params, opts)
44
- initialize_from({ :subscription => resp.data }, opts, true)
44
+ initialize_from({ subscription: resp.data }, opts, true)
45
45
  subscription
46
46
  end
47
47
 
48
- def update_subscription(params={}, opts={})
48
+ def update_subscription(params = {}, opts = {})
49
49
  resp, opts = request(:post, subscription_url, params, opts)
50
- initialize_from({ :subscription => resp.data }, opts, true)
50
+ initialize_from({ subscription: resp.data }, opts, true)
51
51
  subscription
52
52
  end
53
53
 
54
- def create_subscription(params={}, opts={})
54
+ def create_subscription(params = {}, opts = {})
55
55
  resp, opts = request(:post, subscriptions_url, params, opts)
56
- initialize_from({ :subscription => resp.data }, opts, true)
56
+ initialize_from({ subscription: resp.data }, opts, true)
57
57
  subscription
58
58
  end
59
59
 
60
60
  def delete_discount
61
61
  _, opts = request(:delete, discount_url)
62
- initialize_from({ :discount => nil }, opts, true)
62
+ initialize_from({ discount: nil }, opts, true)
63
63
  end
64
64
 
65
65
  private
66
66
 
67
67
  def discount_url
68
- resource_url + '/discount'
68
+ resource_url + "/discount"
69
69
  end
70
70
 
71
71
  def subscription_url
72
- resource_url + '/subscription'
72
+ resource_url + "/subscription"
73
73
  end
74
74
 
75
75
  def subscriptions_url
76
- resource_url + '/subscriptions'
76
+ resource_url + "/subscriptions"
77
77
  end
78
78
  end
79
79
  end
@@ -3,15 +3,15 @@ module Stripe
3
3
  extend Stripe::APIOperations::List
4
4
  include Stripe::APIOperations::Save
5
5
 
6
- OBJECT_NAME = 'dispute'
6
+ OBJECT_NAME = "dispute".freeze
7
7
 
8
- def close(params={}, opts={})
8
+ def close(params = {}, opts = {})
9
9
  resp, opts = request(:post, close_url, params, opts)
10
10
  initialize_from(resp.data, opts)
11
11
  end
12
12
 
13
13
  def close_url
14
- resource_url + '/close'
14
+ resource_url + "/close"
15
15
  end
16
16
  end
17
17
  end
@@ -3,15 +3,15 @@ module Stripe
3
3
  extend Stripe::APIOperations::Create
4
4
  include Stripe::APIOperations::Delete
5
5
 
6
- OBJECT_NAME = 'ephemeral_key'
6
+ OBJECT_NAME = "ephemeral_key".freeze
7
7
 
8
8
  def self.resource_url
9
- '/v1/ephemeral_keys'
9
+ "/v1/ephemeral_keys"
10
10
  end
11
11
 
12
- def self.create(params={}, opts={})
12
+ def self.create(params = {}, opts = {})
13
13
  opts = Util.normalize_opts(opts)
14
- raise ArgumentError.new('stripe_version must be specified to create an ephemeral key') if !opts[:stripe_version]
14
+ raise ArgumentError, "stripe_version must be specified to create an ephemeral key" unless opts[:stripe_version]
15
15
  super
16
16
  end
17
17
  end
data/lib/stripe/errors.rb CHANGED
@@ -17,7 +17,7 @@ module Stripe
17
17
  attr_reader :request_id
18
18
 
19
19
  # Initializes a StripeError.
20
- def initialize(message=nil, http_status: nil, http_body: nil, json_body: nil,
20
+ def initialize(message = nil, http_status: nil, http_body: nil, json_body: nil,
21
21
  http_headers: nil)
22
22
  @message = message
23
23
  @http_status = http_status
@@ -60,7 +60,7 @@ module Stripe
60
60
  def initialize(message, param, code, http_status: nil, http_body: nil, json_body: nil,
61
61
  http_headers: nil)
62
62
  super(message, http_status: http_status, http_body: http_body,
63
- json_body: json_body, http_headers: http_headers)
63
+ json_body: json_body, http_headers: http_headers)
64
64
  @param = param
65
65
  @code = code
66
66
  end
@@ -74,7 +74,7 @@ module Stripe
74
74
  def initialize(message, param, http_status: nil, http_body: nil, json_body: nil,
75
75
  http_headers: nil)
76
76
  super(message, http_status: http_status, http_body: http_body,
77
- json_body: json_body, http_headers: http_headers)
77
+ json_body: json_body, http_headers: http_headers)
78
78
  @param = param
79
79
  end
80
80
  end
@@ -109,7 +109,7 @@ module Stripe
109
109
  def initialize(code, description, http_status: nil, http_body: nil, json_body: nil,
110
110
  http_headers: nil)
111
111
  super(description, http_status: http_status, http_body: http_body,
112
- json_body: json_body, http_headers: http_headers)
112
+ json_body: json_body, http_headers: http_headers)
113
113
  @code = code
114
114
  end
115
115
  end
data/lib/stripe/event.rb CHANGED
@@ -2,6 +2,6 @@ module Stripe
2
2
  class Event < APIResource
3
3
  extend Stripe::APIOperations::List
4
4
 
5
- OBJECT_NAME = 'event'
5
+ OBJECT_NAME = "event".freeze
6
6
  end
7
7
  end
@@ -3,20 +3,20 @@ module Stripe
3
3
  extend Stripe::APIOperations::Create
4
4
  extend Stripe::APIOperations::List
5
5
 
6
- OBJECT_NAME = 'file_upload'
6
+ OBJECT_NAME = "file_upload".freeze
7
7
 
8
8
  def self.resource_url
9
9
  "/v1/files"
10
10
  end
11
11
 
12
- def self.request(method, url, params={}, opts={})
12
+ def self.request(method, url, params = {}, opts = {})
13
13
  opts = {
14
- :api_base => Stripe::uploads_base
14
+ api_base: Stripe.uploads_base,
15
15
  }.merge(Util.normalize_opts(opts))
16
16
  super
17
17
  end
18
18
 
19
- def self.create(params={}, opts={})
19
+ def self.create(params = {}, opts = {})
20
20
  # rest-client would accept a vanilla `File` for upload, but Faraday does
21
21
  # not. Support the old API by wrapping a `File` with an `UploadIO` object
22
22
  # if we're given one.
@@ -25,7 +25,7 @@ module Stripe
25
25
  end
26
26
 
27
27
  opts = {
28
- :content_type => 'multipart/form-data',
28
+ content_type: "multipart/form-data",
29
29
  }.merge(Util.normalize_opts(opts))
30
30
  super
31
31
  end
@@ -4,26 +4,26 @@ module Stripe
4
4
  include Stripe::APIOperations::Save
5
5
  extend Stripe::APIOperations::Create
6
6
 
7
- OBJECT_NAME = 'invoice'
7
+ OBJECT_NAME = "invoice".freeze
8
8
 
9
- def self.upcoming(params, opts={})
9
+ def self.upcoming(params, opts = {})
10
10
  resp, opts = request(:get, upcoming_url, params, opts)
11
11
  Util.convert_to_stripe_object(resp.data, opts)
12
12
  end
13
13
 
14
- def pay(params={}, opts={})
14
+ def pay(params = {}, opts = {})
15
15
  resp, opts = request(:post, pay_url, params, opts)
16
16
  initialize_from(resp.data, opts)
17
17
  end
18
18
 
19
- private
20
-
21
19
  def self.upcoming_url
22
- resource_url + '/upcoming'
20
+ resource_url + "/upcoming"
23
21
  end
22
+ private_class_method :upcoming_url
24
23
 
25
24
  def pay_url
26
- resource_url + '/pay'
25
+ resource_url + "/pay"
27
26
  end
27
+ private :pay_url
28
28
  end
29
29
  end
@@ -5,6 +5,6 @@ module Stripe
5
5
  include Stripe::APIOperations::Delete
6
6
  include Stripe::APIOperations::Save
7
7
 
8
- OBJECT_NAME = 'invoiceitem'
8
+ OBJECT_NAME = "invoiceitem".freeze
9
9
  end
10
10
  end
@@ -1,5 +1,5 @@
1
1
  module Stripe
2
2
  class InvoiceLineItem < StripeObject
3
- OBJECT_NAME = 'line_item'
3
+ OBJECT_NAME = "line_item".freeze
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@ module Stripe
5
5
  include Stripe::APIOperations::Request
6
6
  include Stripe::APIOperations::Create
7
7
 
8
- OBJECT_NAME = 'list'
8
+ OBJECT_NAME = "list".freeze
9
9
 
10
10
  # This accessor allows a `ListObject` to inherit various filters that were
11
11
  # given to a predecessor. This allows for things like consistent limits,
@@ -15,8 +15,8 @@ module Stripe
15
15
  # An empty list object. This is returned from +next+ when we know that
16
16
  # there isn't a next page in order to replicate the behavior of the API
17
17
  # when it attempts to return a page beyond the last.
18
- def self.empty_list(opts={})
19
- ListObject.construct_from({ :data => [] }, opts)
18
+ def self.empty_list(opts = {})
19
+ ListObject.construct_from({ data: [] }, opts)
20
20
  end
21
21
 
22
22
  def initialize(*args)
@@ -29,7 +29,7 @@ module Stripe
29
29
  when String, Symbol
30
30
  super
31
31
  else
32
- raise ArgumentError.new("You tried to access the #{k.inspect} index, but ListObject types only support String keys. (HINT: List calls return an object with a 'data' (which is the data array). You likely want to call #data[#{k.inspect}])")
32
+ raise ArgumentError, "You tried to access the #{k.inspect} index, but ListObject types only support String keys. (HINT: List calls return an object with a 'data' (which is the data array). You likely want to call #data[#{k.inspect}])"
33
33
  end
34
34
  end
35
35
 
@@ -39,7 +39,7 @@ module Stripe
39
39
  # Note that this method makes no effort to fetch a new page when it gets to
40
40
  # the end of the current page's resources. See also +auto_paging_each+.
41
41
  def each(&blk)
42
- self.data.each(&blk)
42
+ data.each(&blk)
43
43
  end
44
44
 
45
45
  # Iterates through each resource in all pages, making additional fetches to
@@ -61,12 +61,12 @@ module Stripe
61
61
 
62
62
  # Returns true if the page object contains no elements.
63
63
  def empty?
64
- self.data.empty?
64
+ data.empty?
65
65
  end
66
66
 
67
- def retrieve(id, opts={})
67
+ def retrieve(id, opts = {})
68
68
  id, retrieve_params = Util.normalize_id(id)
69
- resp, opts = request(:get,"#{resource_url}/#{CGI.escape(id)}", retrieve_params, opts)
69
+ resp, opts = request(:get, "#{resource_url}/#{CGI.escape(id)}", retrieve_params, opts)
70
70
  Util.convert_to_stripe_object(resp.data, opts)
71
71
  end
72
72
 
@@ -74,13 +74,11 @@ module Stripe
74
74
  #
75
75
  # This method will try to respect the limit of the current page. If none
76
76
  # was given, the default limit will be fetched again.
77
- def next_page(params={}, opts={})
78
- return self.class.empty_list(opts) if !has_more
77
+ def next_page(params = {}, opts = {})
78
+ return self.class.empty_list(opts) unless has_more
79
79
  last_id = data.last.id
80
80
 
81
- params = filters.merge({
82
- :starting_after => last_id,
83
- }).merge(params)
81
+ params = filters.merge(starting_after: last_id).merge(params)
84
82
 
85
83
  list(params, opts)
86
84
  end
@@ -89,18 +87,16 @@ module Stripe
89
87
  #
90
88
  # This method will try to respect the limit of the current page. If none
91
89
  # was given, the default limit will be fetched again.
92
- def previous_page(params={}, opts={})
90
+ def previous_page(params = {}, opts = {})
93
91
  first_id = data.first.id
94
92
 
95
- params = filters.merge({
96
- :ending_before => first_id,
97
- }).merge(params)
93
+ params = filters.merge(ending_before: first_id).merge(params)
98
94
 
99
95
  list(params, opts)
100
96
  end
101
97
 
102
98
  def resource_url
103
- self.url ||
99
+ url ||
104
100
  raise(ArgumentError, "List object does not contain a 'url' field.")
105
101
  end
106
102
  end
@@ -1,9 +1,9 @@
1
1
  module Stripe
2
2
  class LoginLink < APIResource
3
- OBJECT_NAME = 'login_link'
3
+ OBJECT_NAME = "login_link".freeze
4
4
 
5
- def self.retrieve(id, opts=nil)
6
- raise NotImplementedError.new("Login links do not have IDs and cannot be retrieved. They can only be created using accounts.login_links.create")
5
+ def self.retrieve(_id, _opts = nil)
6
+ raise NotImplementedError, "Login links do not have IDs and cannot be retrieved. They can only be created using accounts.login_links.create"
7
7
  end
8
8
  end
9
9
  end
data/lib/stripe/oauth.rb CHANGED
@@ -12,43 +12,45 @@ module Stripe
12
12
  end
13
13
  end
14
14
 
15
- def self.get_client_id(params={})
15
+ def self.get_client_id(params = {})
16
16
  client_id = params[:client_id] || Stripe.client_id
17
17
  unless client_id
18
- raise AuthenticationError.new('No client_id provided. ' \
18
+ raise AuthenticationError, "No client_id provided. " \
19
19
  'Set your client_id using "Stripe.client_id = <CLIENT-ID>". ' \
20
- 'You can find your client_ids in your Stripe dashboard at ' \
21
- 'https://dashboard.stripe.com/account/applications/settings, ' \
22
- 'after registering your account as a platform. See ' \
23
- 'https://stripe.com/docs/connect/standalone-accounts for details, ' \
24
- 'or email support@stripe.com if you have any questions.')
20
+ "You can find your client_ids in your Stripe dashboard at " \
21
+ "https://dashboard.stripe.com/account/applications/settings, " \
22
+ "after registering your account as a platform. See " \
23
+ "https://stripe.com/docs/connect/standalone-accounts for details, " \
24
+ "or email support@stripe.com if you have any questions."
25
25
  end
26
26
  client_id
27
27
  end
28
28
 
29
- def self.authorize_url(params={}, opts={})
29
+ def self.authorize_url(params = {}, opts = {})
30
30
  base = opts[:connect_base] || Stripe.connect_base
31
31
 
32
32
  params[:client_id] = get_client_id(params)
33
- params[:response_type] ||= 'code'
33
+ params[:response_type] ||= "code"
34
34
  query = Util.encode_parameters(params)
35
35
 
36
36
  "#{base}/oauth/authorize?#{query}"
37
37
  end
38
38
 
39
- def self.token(params={}, opts={})
39
+ def self.token(params = {}, opts = {})
40
40
  opts = Util.normalize_opts(opts)
41
41
  resp, opts = OAuthOperations.request(
42
- :post, '/oauth/token', params, opts)
42
+ :post, "/oauth/token", params, opts
43
+ )
43
44
  # This is just going to return a generic StripeObject, but that's okay
44
45
  Util.convert_to_stripe_object(resp.data, opts)
45
46
  end
46
47
 
47
- def self.deauthorize(params={}, opts={})
48
+ def self.deauthorize(params = {}, opts = {})
48
49
  opts = Util.normalize_opts(opts)
49
50
  params[:client_id] = get_client_id(params)
50
51
  resp, opts = OAuthOperations.request(
51
- :post, '/oauth/deauthorize', params, opts)
52
+ :post, "/oauth/deauthorize", params, opts
53
+ )
52
54
  # This is just going to return a generic StripeObject, but that's okay
53
55
  Util.convert_to_stripe_object(resp.data, opts)
54
56
  end