stripe 2.5.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/History.txt +4 -0
  3. data/VERSION +1 -1
  4. data/lib/stripe/account.rb +2 -0
  5. data/lib/stripe/alipay_account.rb +2 -0
  6. data/lib/stripe/apple_pay_domain.rb +2 -0
  7. data/lib/stripe/application_fee.rb +2 -0
  8. data/lib/stripe/application_fee_refund.rb +2 -0
  9. data/lib/stripe/balance.rb +1 -0
  10. data/lib/stripe/balance_transaction.rb +2 -0
  11. data/lib/stripe/bank_account.rb +2 -0
  12. data/lib/stripe/bitcoin_receiver.rb +2 -0
  13. data/lib/stripe/bitcoin_transaction.rb +2 -0
  14. data/lib/stripe/card.rb +2 -0
  15. data/lib/stripe/charge.rb +2 -0
  16. data/lib/stripe/country_spec.rb +2 -0
  17. data/lib/stripe/coupon.rb +2 -0
  18. data/lib/stripe/customer.rb +2 -0
  19. data/lib/stripe/dispute.rb +2 -0
  20. data/lib/stripe/event.rb +2 -0
  21. data/lib/stripe/file_upload.rb +2 -0
  22. data/lib/stripe/invoice.rb +2 -0
  23. data/lib/stripe/invoice_item.rb +2 -0
  24. data/lib/stripe/list_object.rb +2 -0
  25. data/lib/stripe/order.rb +2 -0
  26. data/lib/stripe/order_return.rb +2 -0
  27. data/lib/stripe/payout.rb +2 -0
  28. data/lib/stripe/plan.rb +2 -0
  29. data/lib/stripe/product.rb +2 -0
  30. data/lib/stripe/recipient.rb +2 -0
  31. data/lib/stripe/recipient_transfer.rb +2 -0
  32. data/lib/stripe/refund.rb +2 -0
  33. data/lib/stripe/reversal.rb +2 -0
  34. data/lib/stripe/sku.rb +2 -0
  35. data/lib/stripe/source.rb +2 -0
  36. data/lib/stripe/subscription.rb +2 -0
  37. data/lib/stripe/subscription_item.rb +2 -0
  38. data/lib/stripe/three_d_secure.rb +2 -0
  39. data/lib/stripe/token.rb +2 -0
  40. data/lib/stripe/transfer.rb +2 -0
  41. data/lib/stripe/util.rb +37 -37
  42. data/lib/stripe/version.rb +1 -1
  43. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4f4a87a330e0cdcde4a35762e56dfaee640ad0b
4
- data.tar.gz: e678908e0ce2cbb76c380b59a61057aaad6d0506
3
+ metadata.gz: b5b655483032b5281ff2bccf369e08c66731996e
4
+ data.tar.gz: 63a2e6852445f94454662b40aebf3006088fd95c
5
5
  SHA512:
6
- metadata.gz: 35501ad53bbd37c8846938041b2b0c0fdeeb6f4c46982b71ebca335c5634230619bdf83e2bdaa4b083f99d944cfb0b296277e7e025220f708340443ef02b9bd5
7
- data.tar.gz: 14dfd0b06b93e26df2eb54b8795a059708232957ac9cc1f24f579385c3c970f7bca268b5002162fcbe16fdf676ddc404a9197ca618f27dbf508cfbf5c13b90b8
6
+ metadata.gz: 7cebea1dfb72b5a059f39ef0385cfeb60bcfe7fb813e443fefbf8489eb7eb4028ffd4089aa3720cc8641f4fdb7cf4af1382e446578b5698014440116ce4199f1
7
+ data.tar.gz: 96800765a11c5f8ec5b8e1417861ceb4fe296a784a28f25cc4fadbc7541577ee0a0ca1ae26c2ebd2cadf9b1b56914053eab51d6511282f9018e51024314d3699
@@ -1,3 +1,7 @@
1
+ === 2.6.0 2017-04-26
2
+
3
+ * Add `OBJECT_NAME` constants to all API resources
4
+
1
5
  === 2.5.0 2017-04-24
2
6
 
3
7
  * Make `opts` argument in `Util.convert_to_stripe_object` optional
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.6.0
@@ -6,6 +6,8 @@ module Stripe
6
6
  include Stripe::APIOperations::Delete
7
7
  include Stripe::APIOperations::Save
8
8
 
9
+ OBJECT_NAME = 'account'
10
+
9
11
  save_nested_resource :external_account
10
12
 
11
13
  # This method is deprecated. Please use `#external_account=` instead.
@@ -3,6 +3,8 @@ module Stripe
3
3
  include Stripe::APIOperations::Save
4
4
  include Stripe::APIOperations::Delete
5
5
 
6
+ OBJECT_NAME = 'alipay_account'
7
+
6
8
  def resource_url
7
9
  if respond_to?(:customer) && !self.customer.nil?
8
10
  "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
@@ -5,6 +5,8 @@ module Stripe
5
5
  include Stripe::APIOperations::Delete
6
6
  extend Stripe::APIOperations::List
7
7
 
8
+ OBJECT_NAME = 'apple_pay_domain'
9
+
8
10
  def self.resource_url
9
11
  '/v1/apple_pay/domains'
10
12
  end
@@ -2,6 +2,8 @@ module Stripe
2
2
  class ApplicationFee < APIResource
3
3
  extend Stripe::APIOperations::List
4
4
 
5
+ OBJECT_NAME = 'application_fee'
6
+
5
7
  def self.resource_url
6
8
  '/v1/application_fees'
7
9
  end
@@ -3,6 +3,8 @@ module Stripe
3
3
  include Stripe::APIOperations::Save
4
4
  extend Stripe::APIOperations::List
5
5
 
6
+ OBJECT_NAME = 'fee_refund'
7
+
6
8
  def resource_url
7
9
  "#{ApplicationFee.resource_url}/#{CGI.escape(fee)}/refunds/#{CGI.escape(id)}"
8
10
  end
@@ -1,4 +1,5 @@
1
1
  module Stripe
2
2
  class Balance < SingletonAPIResource
3
+ OBJECT_NAME = 'balance'
3
4
  end
4
5
  end
@@ -2,6 +2,8 @@ module Stripe
2
2
  class BalanceTransaction < APIResource
3
3
  extend Stripe::APIOperations::List
4
4
 
5
+ OBJECT_NAME = 'balance_transaction'
6
+
5
7
  def self.resource_url
6
8
  '/v1/balance/history'
7
9
  end
@@ -4,6 +4,8 @@ module Stripe
4
4
  include Stripe::APIOperations::Delete
5
5
  extend Stripe::APIOperations::List
6
6
 
7
+ OBJECT_NAME = 'bank_account'
8
+
7
9
  def verify(params={}, opts={})
8
10
  resp, opts = request(:post, resource_url + '/verify', params, opts)
9
11
  initialize_from(resp.data, opts)
@@ -5,6 +5,8 @@ module Stripe
5
5
  include Stripe::APIOperations::Delete
6
6
  extend Stripe::APIOperations::List
7
7
 
8
+ OBJECT_NAME = 'bitcoin_receiver'
9
+
8
10
  def self.resource_url
9
11
  "/v1/bitcoin/receivers"
10
12
  end
@@ -2,6 +2,8 @@ module Stripe
2
2
  class BitcoinTransaction < APIResource
3
3
  extend Stripe::APIOperations::List
4
4
 
5
+ OBJECT_NAME = 'bitcoin_transaction'
6
+
5
7
  def self.resource_url
6
8
  "/v1/bitcoin/transactions"
7
9
  end
@@ -4,6 +4,8 @@ module Stripe
4
4
  include Stripe::APIOperations::Delete
5
5
  extend Stripe::APIOperations::List
6
6
 
7
+ OBJECT_NAME = 'card'
8
+
7
9
  def resource_url
8
10
  if respond_to?(:recipient) && !recipient.nil? && !recipient.empty?
9
11
  "#{Recipient.resource_url}/#{CGI.escape(recipient)}/cards/#{CGI.escape(id)}"
@@ -4,6 +4,8 @@ module Stripe
4
4
  extend Stripe::APIOperations::Create
5
5
  include Stripe::APIOperations::Save
6
6
 
7
+ OBJECT_NAME = 'charge'
8
+
7
9
  def refund(params={}, opts={})
8
10
  # Old versions of charge objects included a `refunds` field that was just
9
11
  # a vanilla array instead of a Stripe list object.
@@ -2,6 +2,8 @@ module Stripe
2
2
  class CountrySpec < APIResource
3
3
  extend Stripe::APIOperations::List
4
4
 
5
+ OBJECT_NAME = 'country_spec'
6
+
5
7
  def self.resource_url
6
8
  '/v1/country_specs'
7
9
  end
@@ -4,5 +4,7 @@ module Stripe
4
4
  include Stripe::APIOperations::Save
5
5
  include Stripe::APIOperations::Delete
6
6
  extend Stripe::APIOperations::List
7
+
8
+ OBJECT_NAME = 'coupon'
7
9
  end
8
10
  end
@@ -5,6 +5,8 @@ module Stripe
5
5
  include Stripe::APIOperations::Save
6
6
  extend Stripe::APIOperations::List
7
7
 
8
+ OBJECT_NAME = 'customer'
9
+
8
10
  save_nested_resource :source
9
11
 
10
12
  def add_invoice_item(params, opts={})
@@ -3,6 +3,8 @@ module Stripe
3
3
  extend Stripe::APIOperations::List
4
4
  include Stripe::APIOperations::Save
5
5
 
6
+ OBJECT_NAME = 'dispute'
7
+
6
8
  def close(params={}, opts={})
7
9
  resp, opts = request(:post, close_url, params, opts)
8
10
  initialize_from(resp.data, opts)
@@ -1,5 +1,7 @@
1
1
  module Stripe
2
2
  class Event < APIResource
3
3
  extend Stripe::APIOperations::List
4
+
5
+ OBJECT_NAME = 'event'
4
6
  end
5
7
  end
@@ -3,6 +3,8 @@ module Stripe
3
3
  extend Stripe::APIOperations::Create
4
4
  extend Stripe::APIOperations::List
5
5
 
6
+ OBJECT_NAME = 'file_upload'
7
+
6
8
  def self.resource_url
7
9
  "/v1/files"
8
10
  end
@@ -4,6 +4,8 @@ module Stripe
4
4
  include Stripe::APIOperations::Save
5
5
  extend Stripe::APIOperations::Create
6
6
 
7
+ OBJECT_NAME = 'invoice'
8
+
7
9
  def self.upcoming(params, opts={})
8
10
  resp, opts = request(:get, upcoming_url, params, opts)
9
11
  Util.convert_to_stripe_object(resp.data, opts)
@@ -4,5 +4,7 @@ module Stripe
4
4
  extend Stripe::APIOperations::Create
5
5
  include Stripe::APIOperations::Delete
6
6
  include Stripe::APIOperations::Save
7
+
8
+ OBJECT_NAME = 'invoiceitem'
7
9
  end
8
10
  end
@@ -5,6 +5,8 @@ module Stripe
5
5
  include Stripe::APIOperations::Request
6
6
  include Stripe::APIOperations::Create
7
7
 
8
+ OBJECT_NAME = 'list'
9
+
8
10
  # This accessor allows a `ListObject` to inherit various filters that were
9
11
  # given to a predecessor. This allows for things like consistent limits,
10
12
  # expansions, and predicates as a user pages through resources.
@@ -4,6 +4,8 @@ module Stripe
4
4
  extend Stripe::APIOperations::Create
5
5
  include Stripe::APIOperations::Save
6
6
 
7
+ OBJECT_NAME = 'order'
8
+
7
9
  def pay(params, opts={})
8
10
  resp, opts = request(:post, pay_url, params, opts)
9
11
  initialize_from(resp.data, opts)
@@ -2,6 +2,8 @@ module Stripe
2
2
  class OrderReturn < APIResource
3
3
  extend Stripe::APIOperations::List
4
4
 
5
+ OBJECT_NAME = 'order_return'
6
+
5
7
  def self.resource_url
6
8
  "/v1/order_returns"
7
9
  end
@@ -4,6 +4,8 @@ module Stripe
4
4
  extend Stripe::APIOperations::Create
5
5
  include Stripe::APIOperations::Save
6
6
 
7
+ OBJECT_NAME = 'payout'
8
+
7
9
  def cancel
8
10
  resp, api_key = self.request(:post, cancel_url)
9
11
  initialize_from(resp.data, api_key)
@@ -4,5 +4,7 @@ module Stripe
4
4
  include Stripe::APIOperations::Delete
5
5
  extend Stripe::APIOperations::List
6
6
  include Stripe::APIOperations::Save
7
+
8
+ OBJECT_NAME = 'plan'
7
9
  end
8
10
  end
@@ -4,5 +4,7 @@ module Stripe
4
4
  extend Stripe::APIOperations::Create
5
5
  include Stripe::APIOperations::Save
6
6
  include Stripe::APIOperations::Delete
7
+
8
+ OBJECT_NAME = 'product'
7
9
  end
8
10
  end
@@ -5,6 +5,8 @@ module Stripe
5
5
  include Stripe::APIOperations::Save
6
6
  extend Stripe::APIOperations::List
7
7
 
8
+ OBJECT_NAME = 'recipient'
9
+
8
10
  def transfers
9
11
  Transfer.all({ :recipient => id }, @api_key)
10
12
  end
@@ -1,4 +1,6 @@
1
1
  module Stripe
2
2
  class RecipientTransfer < StripeObject
3
+
4
+ OBJECT_NAME = 'recipient_transfer'
3
5
  end
4
6
  end
@@ -3,5 +3,7 @@ module Stripe
3
3
  extend Stripe::APIOperations::Create
4
4
  extend Stripe::APIOperations::List
5
5
  include Stripe::APIOperations::Save
6
+
7
+ OBJECT_NAME = 'refund'
6
8
  end
7
9
  end
@@ -3,6 +3,8 @@ module Stripe
3
3
  extend Stripe::APIOperations::List
4
4
  include Stripe::APIOperations::Save
5
5
 
6
+ OBJECT_NAME = 'transfer_reversal'
7
+
6
8
  def resource_url
7
9
  "#{Transfer.resource_url}/#{CGI.escape(transfer)}/reversals/#{CGI.escape(id)}"
8
10
  end
@@ -4,5 +4,7 @@ module Stripe
4
4
  extend Stripe::APIOperations::Create
5
5
  include Stripe::APIOperations::Save
6
6
  include Stripe::APIOperations::Delete
7
+
8
+ OBJECT_NAME = 'sku'
7
9
  end
8
10
  end
@@ -3,6 +3,8 @@ module Stripe
3
3
  extend Stripe::APIOperations::Create
4
4
  include Stripe::APIOperations::Save
5
5
 
6
+ OBJECT_NAME = 'source'
7
+
6
8
  def delete(params={}, opts={})
7
9
  if respond_to?(:customer) && !customer.nil? && !customer.empty?
8
10
  url = "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
@@ -5,6 +5,8 @@ module Stripe
5
5
  include Stripe::APIOperations::Save
6
6
  include Stripe::APIOperations::Delete
7
7
 
8
+ OBJECT_NAME = 'subscription'
9
+
8
10
  save_nested_resource :source
9
11
 
10
12
  def delete_discount
@@ -5,6 +5,8 @@ module Stripe
5
5
  extend Stripe::APIOperations::List
6
6
  include Stripe::APIOperations::Save
7
7
 
8
+ OBJECT_NAME = 'subscription_item'
9
+
8
10
  def self.resource_url
9
11
  '/v1/subscription_items'
10
12
  end
@@ -2,6 +2,8 @@ module Stripe
2
2
  class ThreeDSecure < APIResource
3
3
  extend Stripe::APIOperations::Create
4
4
 
5
+ OBJECT_NAME = 'three_d_secure'
6
+
5
7
  def self.resource_url
6
8
  "/v1/3d_secure"
7
9
  end
@@ -1,5 +1,7 @@
1
1
  module Stripe
2
2
  class Token < APIResource
3
3
  extend Stripe::APIOperations::Create
4
+
5
+ OBJECT_NAME = 'token'
4
6
  end
5
7
  end
@@ -4,6 +4,8 @@ module Stripe
4
4
  extend Stripe::APIOperations::Create
5
5
  include Stripe::APIOperations::Save
6
6
 
7
+ OBJECT_NAME = 'transfer'
8
+
7
9
  def cancel
8
10
  resp, api_key = self.request(:post, cancel_url)
9
11
  initialize_from(resp.data, api_key)
@@ -20,45 +20,45 @@ module Stripe
20
20
  def self.object_classes
21
21
  @object_classes ||= {
22
22
  # data structures
23
- 'list' => ListObject,
23
+ ListObject::OBJECT_NAME => ListObject,
24
24
 
25
25
  # business objects
26
- 'account' => Account,
27
- 'alipay_account' => AlipayAccount,
28
- 'apple_pay_domain' => ApplePayDomain,
29
- 'application_fee' => ApplicationFee,
30
- 'balance' => Balance,
31
- 'balance_transaction' => BalanceTransaction,
32
- 'bank_account' => BankAccount,
33
- 'bitcoin_receiver' => BitcoinReceiver,
34
- 'bitcoin_transaction' => BitcoinTransaction,
35
- 'card' => Card,
36
- 'charge' => Charge,
37
- 'country_spec' => CountrySpec,
38
- 'coupon' => Coupon,
39
- 'customer' => Customer,
40
- 'dispute' => Dispute,
41
- 'event' => Event,
42
- 'fee_refund' => ApplicationFeeRefund,
43
- 'file_upload' => FileUpload,
44
- 'invoice' => Invoice,
45
- 'invoiceitem' => InvoiceItem,
46
- 'order' => Order,
47
- 'order_return' => OrderReturn,
48
- 'payout' => Payout,
49
- 'plan' => Plan,
50
- 'product' => Product,
51
- 'recipient' => Recipient,
52
- 'recipient_transfer' => RecipientTransfer,
53
- 'refund' => Refund,
54
- 'sku' => SKU,
55
- 'source' => Source,
56
- 'subscription' => Subscription,
57
- 'subscription_item' => SubscriptionItem,
58
- 'three_d_secure' => ThreeDSecure,
59
- 'token' => Token,
60
- 'transfer' => Transfer,
61
- 'transfer_reversal' => Reversal,
26
+ Account::OBJECT_NAME => Account,
27
+ AlipayAccount::OBJECT_NAME => AlipayAccount,
28
+ ApplePayDomain::OBJECT_NAME => ApplePayDomain,
29
+ ApplicationFee::OBJECT_NAME => ApplicationFee,
30
+ ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
31
+ Balance::OBJECT_NAME => Balance,
32
+ BalanceTransaction::OBJECT_NAME => BalanceTransaction,
33
+ BankAccount::OBJECT_NAME => BankAccount,
34
+ BitcoinReceiver::OBJECT_NAME => BitcoinReceiver,
35
+ BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
36
+ Card::OBJECT_NAME => Card,
37
+ Charge::OBJECT_NAME => Charge,
38
+ CountrySpec::OBJECT_NAME => CountrySpec,
39
+ Coupon::OBJECT_NAME => Coupon,
40
+ Customer::OBJECT_NAME => Customer,
41
+ Dispute::OBJECT_NAME => Dispute,
42
+ Event::OBJECT_NAME => Event,
43
+ FileUpload::OBJECT_NAME => FileUpload,
44
+ Invoice::OBJECT_NAME => Invoice,
45
+ InvoiceItem::OBJECT_NAME => InvoiceItem,
46
+ Order::OBJECT_NAME => Order,
47
+ OrderReturn::OBJECT_NAME => OrderReturn,
48
+ Payout::OBJECT_NAME => Payout,
49
+ Plan::OBJECT_NAME => Plan,
50
+ Product::OBJECT_NAME => Product,
51
+ Recipient::OBJECT_NAME => Recipient,
52
+ RecipientTransfer::OBJECT_NAME => RecipientTransfer,
53
+ Refund::OBJECT_NAME => Refund,
54
+ Reversal::OBJECT_NAME => Reversal,
55
+ SKU::OBJECT_NAME => SKU,
56
+ Source::OBJECT_NAME => Source,
57
+ Subscription::OBJECT_NAME => Subscription,
58
+ SubscriptionItem::OBJECT_NAME => SubscriptionItem,
59
+ ThreeDSecure::OBJECT_NAME => ThreeDSecure,
60
+ Token::OBJECT_NAME => Token,
61
+ Transfer::OBJECT_NAME => Transfer,
62
62
  }
63
63
  end
64
64
 
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '2.5.0'
2
+ VERSION = '2.6.0'
3
3
  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: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-24 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday