stripe 4.18.1 → 4.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +3 -0
  5. data/README.md +9 -9
  6. data/VERSION +1 -1
  7. data/lib/stripe.rb +2 -75
  8. data/lib/stripe/object_types.rb +97 -0
  9. data/lib/stripe/resources.rb +78 -0
  10. data/lib/stripe/{account.rb → resources/account.rb} +13 -12
  11. data/lib/stripe/{account_link.rb → resources/account_link.rb} +0 -0
  12. data/lib/stripe/{alipay_account.rb → resources/alipay_account.rb} +0 -0
  13. data/lib/stripe/{apple_pay_domain.rb → resources/apple_pay_domain.rb} +0 -0
  14. data/lib/stripe/{application_fee.rb → resources/application_fee.rb} +0 -0
  15. data/lib/stripe/{application_fee_refund.rb → resources/application_fee_refund.rb} +0 -0
  16. data/lib/stripe/{balance.rb → resources/balance.rb} +0 -0
  17. data/lib/stripe/{balance_transaction.rb → resources/balance_transaction.rb} +0 -0
  18. data/lib/stripe/{bank_account.rb → resources/bank_account.rb} +2 -4
  19. data/lib/stripe/{bitcoin_receiver.rb → resources/bitcoin_receiver.rb} +3 -4
  20. data/lib/stripe/{bitcoin_transaction.rb → resources/bitcoin_transaction.rb} +0 -0
  21. data/lib/stripe/{capability.rb → resources/capability.rb} +0 -0
  22. data/lib/stripe/{card.rb → resources/card.rb} +3 -6
  23. data/lib/stripe/{charge.rb → resources/charge.rb} +0 -0
  24. data/lib/stripe/{checkout → resources/checkout}/session.rb +0 -0
  25. data/lib/stripe/{country_spec.rb → resources/country_spec.rb} +0 -0
  26. data/lib/stripe/{coupon.rb → resources/coupon.rb} +0 -0
  27. data/lib/stripe/{credit_note.rb → resources/credit_note.rb} +1 -1
  28. data/lib/stripe/{customer.rb → resources/customer.rb} +8 -5
  29. data/lib/stripe/resources/customer_balance_transaction.rb +30 -0
  30. data/lib/stripe/{discount.rb → resources/discount.rb} +0 -0
  31. data/lib/stripe/{dispute.rb → resources/dispute.rb} +1 -1
  32. data/lib/stripe/{ephemeral_key.rb → resources/ephemeral_key.rb} +0 -0
  33. data/lib/stripe/{event.rb → resources/event.rb} +0 -0
  34. data/lib/stripe/{exchange_rate.rb → resources/exchange_rate.rb} +0 -0
  35. data/lib/stripe/{file.rb → resources/file.rb} +4 -1
  36. data/lib/stripe/{file_link.rb → resources/file_link.rb} +0 -0
  37. data/lib/stripe/{invoice.rb → resources/invoice.rb} +6 -7
  38. data/lib/stripe/{invoice_item.rb → resources/invoice_item.rb} +0 -0
  39. data/lib/stripe/{invoice_line_item.rb → resources/invoice_line_item.rb} +0 -0
  40. data/lib/stripe/{issuer_fraud_record.rb → resources/issuer_fraud_record.rb} +0 -0
  41. data/lib/stripe/{issuing → resources/issuing}/authorization.rb +2 -2
  42. data/lib/stripe/{issuing → resources/issuing}/card.rb +0 -0
  43. data/lib/stripe/{issuing → resources/issuing}/card_details.rb +0 -0
  44. data/lib/stripe/{issuing → resources/issuing}/cardholder.rb +0 -0
  45. data/lib/stripe/{issuing → resources/issuing}/dispute.rb +0 -0
  46. data/lib/stripe/{issuing → resources/issuing}/transaction.rb +0 -0
  47. data/lib/stripe/{login_link.rb → resources/login_link.rb} +0 -0
  48. data/lib/stripe/{order.rb → resources/order.rb} +4 -4
  49. data/lib/stripe/{order_return.rb → resources/order_return.rb} +0 -0
  50. data/lib/stripe/{payment_intent.rb → resources/payment_intent.rb} +3 -3
  51. data/lib/stripe/{payment_method.rb → resources/payment_method.rb} +2 -2
  52. data/lib/stripe/{payout.rb → resources/payout.rb} +1 -1
  53. data/lib/stripe/{person.rb → resources/person.rb} +0 -0
  54. data/lib/stripe/{plan.rb → resources/plan.rb} +0 -0
  55. data/lib/stripe/{product.rb → resources/product.rb} +0 -0
  56. data/lib/stripe/{radar → resources/radar}/early_fraud_warning.rb +0 -0
  57. data/lib/stripe/{radar → resources/radar}/value_list.rb +0 -0
  58. data/lib/stripe/{radar → resources/radar}/value_list_item.rb +0 -0
  59. data/lib/stripe/{recipient.rb → resources/recipient.rb} +0 -0
  60. data/lib/stripe/{recipient_transfer.rb → resources/recipient_transfer.rb} +0 -0
  61. data/lib/stripe/{refund.rb → resources/refund.rb} +0 -0
  62. data/lib/stripe/{reporting → resources/reporting}/report_run.rb +0 -0
  63. data/lib/stripe/{reporting → resources/reporting}/report_type.rb +0 -0
  64. data/lib/stripe/{reversal.rb → resources/reversal.rb} +0 -0
  65. data/lib/stripe/{review.rb → resources/review.rb} +1 -1
  66. data/lib/stripe/{sigma → resources/sigma}/scheduled_query_run.rb +0 -0
  67. data/lib/stripe/{sku.rb → resources/sku.rb} +0 -0
  68. data/lib/stripe/{source.rb → resources/source.rb} +5 -5
  69. data/lib/stripe/{source_transaction.rb → resources/source_transaction.rb} +0 -0
  70. data/lib/stripe/{subscription.rb → resources/subscription.rb} +2 -2
  71. data/lib/stripe/{subscription_item.rb → resources/subscription_item.rb} +1 -2
  72. data/lib/stripe/{subscription_schedule.rb → resources/subscription_schedule.rb} +5 -8
  73. data/lib/stripe/{subscription_schedule_revision.rb → resources/subscription_schedule_revision.rb} +0 -0
  74. data/lib/stripe/{tax_id.rb → resources/tax_id.rb} +0 -0
  75. data/lib/stripe/{tax_rate.rb → resources/tax_rate.rb} +0 -0
  76. data/lib/stripe/{terminal → resources/terminal}/connection_token.rb +0 -0
  77. data/lib/stripe/{terminal → resources/terminal}/location.rb +0 -0
  78. data/lib/stripe/{terminal → resources/terminal}/reader.rb +0 -0
  79. data/lib/stripe/{three_d_secure.rb → resources/three_d_secure.rb} +0 -0
  80. data/lib/stripe/{token.rb → resources/token.rb} +0 -0
  81. data/lib/stripe/{topup.rb → resources/topup.rb} +1 -1
  82. data/lib/stripe/{transfer.rb → resources/transfer.rb} +4 -3
  83. data/lib/stripe/{usage_record.rb → resources/usage_record.rb} +0 -0
  84. data/lib/stripe/{usage_record_summary.rb → resources/usage_record_summary.rb} +0 -0
  85. data/lib/stripe/{webhook_endpoint.rb → resources/webhook_endpoint.rb} +0 -0
  86. data/lib/stripe/util.rb +2 -85
  87. data/lib/stripe/version.rb +1 -1
  88. data/test/stripe/customer_balance_transaction_test.rb +37 -0
  89. data/test/stripe/customer_test.rb +43 -0
  90. data/test/test_helper.rb +1 -1
  91. metadata +82 -77
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d2bc94a670bcbb6341ce794ad5415d30aece0177fc50a6a176c7a5a33083664
4
- data.tar.gz: e45ad1040e1ebe11e4493a8b77c35cbe7b25bda4511a23d4c655a1a2ef3f0a0a
3
+ metadata.gz: 8549706571e22e7f77c30b681b3ad558a76e0002e34820ba473d51ca62bd7a41
4
+ data.tar.gz: 46a72199ee1a486608cea9bd7d6f3fc2b0f0381d09d96d991301951e960585de
5
5
  SHA512:
6
- metadata.gz: b4aa8383711814c62576ff737c40fb8f83e40c9c4b60753d54f7cbf42fa3d652083373d5f2d587850e9e76c8d6090ce6fa2e2408157860e108e4a6d72526fe15
7
- data.tar.gz: daf904e718c62170c2f8a4da0be10b29d5c040d9a9fbbcb95ad8a57bdd91a862a6cd21aff54fa7de46aa62c9bd79097f801d6b768d4083b7dd24e34e96f6e630
6
+ metadata.gz: '0873264fe51ba6fd4d912324f6ec7611abfbc5ff52808d764608244cea72e002fd76b3519c0b0fb2cb545fb77db72ca8917778b795abf931beae8598dfbf4186'
7
+ data.tar.gz: 638de26c0d0a4be4d98cedd96d7704c745f1823e046f2a40a33c7bd32e895e57b884bc35bc1c6d838c7d69aebcf2a9cb18f733aad4ece12c6e6b017c20db5755
@@ -16,6 +16,7 @@ Layout/IndentHash:
16
16
  Metrics/LineLength:
17
17
  Exclude:
18
18
  - "test/**/*.rb"
19
+ - "lib/stripe/resources/**/*.rb"
19
20
 
20
21
  Metrics/MethodLength:
21
22
  # There's ~2 long methods in `StripeClient`. If we want to truncate those a
@@ -18,7 +18,7 @@ sudo: false
18
18
  env:
19
19
  global:
20
20
  # If changing this number, please also change it in `test/test_helper.rb`.
21
- - STRIPE_MOCK_VERSION=0.57.0
21
+ - STRIPE_MOCK_VERSION=0.58.0
22
22
 
23
23
  cache:
24
24
  directories:
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.19.0 - 2019-06-17
4
+ * [#770](https://github.com/stripe/stripe-ruby/pull/770) Add support for `CustomerBalanceTransaction` resource and APIs
5
+
3
6
  ## 4.18.1 - 2019-05-27
4
7
  * [#789](https://github.com/stripe/stripe-ruby/pull/789) Allow `Order#pay` to be called without arguments
5
8
 
data/README.md CHANGED
@@ -81,29 +81,29 @@ require "stripe"
81
81
  Stripe::Charge.list(
82
82
  {},
83
83
  {
84
- :api_key => "sk_test_...",
85
- :stripe_account => "acct_...",
86
- :stripe_version => "2018-02-28"
84
+ api_key: "sk_test_...",
85
+ stripe_account: "acct_...",
86
+ stripe_version: "2018-02-28",
87
87
  }
88
88
  )
89
89
 
90
90
  Stripe::Charge.retrieve(
91
91
  "ch_18atAXCdGbJFKhCuBAa4532Z",
92
92
  {
93
- :api_key => "sk_test_...",
94
- :stripe_account => "acct_...",
95
- :stripe_version => "2018-02-28"
93
+ api_key: "sk_test_...",
94
+ stripe_account: "acct_...",
95
+ stripe_version: "2018-02-28",
96
96
  }
97
97
  )
98
98
 
99
99
  Stripe::Charge.retrieve(
100
100
  {
101
- id: 'ch_18atAXCdGbJFKhCuBAa4532Z',
101
+ id: "ch_18atAXCdGbJFKhCuBAa4532Z",
102
102
  expand: %w(balance_transaction)
103
103
  },
104
104
  {
105
- stripe_version: '2018-02-28',
106
- api_key: 'sk_test_...'
105
+ stripe_version: "2018-02-28",
106
+ api_key: "sk_test_...",
107
107
  }
108
108
  )
109
109
  ```
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.18.1
1
+ 4.19.0
@@ -26,6 +26,7 @@ require "stripe/api_operations/save"
26
26
 
27
27
  # API resource support classes
28
28
  require "stripe/errors"
29
+ require "stripe/object_types"
29
30
  require "stripe/util"
30
31
  require "stripe/stripe_client"
31
32
  require "stripe/stripe_object"
@@ -36,81 +37,7 @@ require "stripe/singleton_api_resource"
36
37
  require "stripe/webhook"
37
38
 
38
39
  # Named API resources
39
- require "stripe/account"
40
- require "stripe/account_link"
41
- require "stripe/alipay_account"
42
- require "stripe/apple_pay_domain"
43
- require "stripe/application_fee"
44
- require "stripe/application_fee_refund"
45
- require "stripe/balance"
46
- require "stripe/balance_transaction"
47
- require "stripe/bank_account"
48
- require "stripe/bitcoin_receiver"
49
- require "stripe/bitcoin_transaction"
50
- require "stripe/capability"
51
- require "stripe/card"
52
- require "stripe/charge"
53
- require "stripe/checkout/session"
54
- require "stripe/country_spec"
55
- require "stripe/coupon"
56
- require "stripe/credit_note"
57
- require "stripe/customer"
58
- require "stripe/discount"
59
- require "stripe/dispute"
60
- require "stripe/ephemeral_key"
61
- require "stripe/event"
62
- require "stripe/exchange_rate"
63
- require "stripe/file"
64
- require "stripe/file_link"
65
- require "stripe/invoice"
66
- require "stripe/invoice_item"
67
- require "stripe/invoice_line_item"
68
- require "stripe/issuer_fraud_record"
69
- require "stripe/issuing/authorization"
70
- require "stripe/issuing/card"
71
- require "stripe/issuing/card_details"
72
- require "stripe/issuing/cardholder"
73
- require "stripe/issuing/dispute"
74
- require "stripe/issuing/transaction"
75
- require "stripe/login_link"
76
- require "stripe/order"
77
- require "stripe/order_return"
78
- require "stripe/payment_intent"
79
- require "stripe/payment_method"
80
- require "stripe/payout"
81
- require "stripe/person"
82
- require "stripe/plan"
83
- require "stripe/product"
84
- require "stripe/radar/early_fraud_warning"
85
- require "stripe/radar/value_list"
86
- require "stripe/radar/value_list_item"
87
- require "stripe/recipient"
88
- require "stripe/recipient_transfer"
89
- require "stripe/refund"
90
- require "stripe/reporting/report_run"
91
- require "stripe/reporting/report_type"
92
- require "stripe/reversal"
93
- require "stripe/review"
94
- require "stripe/sigma/scheduled_query_run"
95
- require "stripe/sku"
96
- require "stripe/source"
97
- require "stripe/source_transaction"
98
- require "stripe/subscription"
99
- require "stripe/subscription_item"
100
- require "stripe/subscription_schedule"
101
- require "stripe/subscription_schedule_revision"
102
- require "stripe/tax_id"
103
- require "stripe/tax_rate"
104
- require "stripe/terminal/connection_token"
105
- require "stripe/terminal/location"
106
- require "stripe/terminal/reader"
107
- require "stripe/three_d_secure"
108
- require "stripe/token"
109
- require "stripe/topup"
110
- require "stripe/transfer"
111
- require "stripe/usage_record"
112
- require "stripe/usage_record_summary"
113
- require "stripe/webhook_endpoint"
40
+ require "stripe/resources"
114
41
 
115
42
  # OAuth
116
43
  require "stripe/oauth"
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ # rubocop:disable Metrics/LineLength
4
+ # rubocop:disable Metrics/MethodLength
5
+
6
+ module Stripe
7
+ module ObjectTypes
8
+ def self.object_names_to_classes
9
+ {
10
+ # data structures
11
+ ListObject::OBJECT_NAME => ListObject,
12
+
13
+ # business objects
14
+ Account::OBJECT_NAME => Account,
15
+ AccountLink::OBJECT_NAME => AccountLink,
16
+ AlipayAccount::OBJECT_NAME => AlipayAccount,
17
+ ApplePayDomain::OBJECT_NAME => ApplePayDomain,
18
+ ApplicationFee::OBJECT_NAME => ApplicationFee,
19
+ ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
20
+ Balance::OBJECT_NAME => Balance,
21
+ BalanceTransaction::OBJECT_NAME => BalanceTransaction,
22
+ BankAccount::OBJECT_NAME => BankAccount,
23
+ BitcoinReceiver::OBJECT_NAME => BitcoinReceiver,
24
+ BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
25
+ Capability::OBJECT_NAME => Capability,
26
+ Card::OBJECT_NAME => Card,
27
+ Charge::OBJECT_NAME => Charge,
28
+ Checkout::Session::OBJECT_NAME => Checkout::Session,
29
+ CountrySpec::OBJECT_NAME => CountrySpec,
30
+ Coupon::OBJECT_NAME => Coupon,
31
+ CreditNote::OBJECT_NAME => CreditNote,
32
+ Customer::OBJECT_NAME => Customer,
33
+ CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
34
+ Discount::OBJECT_NAME => Discount,
35
+ Dispute::OBJECT_NAME => Dispute,
36
+ EphemeralKey::OBJECT_NAME => EphemeralKey,
37
+ Event::OBJECT_NAME => Event,
38
+ ExchangeRate::OBJECT_NAME => ExchangeRate,
39
+ File::OBJECT_NAME => File,
40
+ File::OBJECT_NAME_ALT => File,
41
+ FileLink::OBJECT_NAME => FileLink,
42
+ Invoice::OBJECT_NAME => Invoice,
43
+ InvoiceItem::OBJECT_NAME => InvoiceItem,
44
+ InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
45
+ IssuerFraudRecord::OBJECT_NAME => IssuerFraudRecord,
46
+ Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
47
+ Issuing::Card::OBJECT_NAME => Issuing::Card,
48
+ Issuing::CardDetails::OBJECT_NAME => Issuing::CardDetails,
49
+ Issuing::Cardholder::OBJECT_NAME => Issuing::Cardholder,
50
+ Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
51
+ Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
52
+ LoginLink::OBJECT_NAME => LoginLink,
53
+ Order::OBJECT_NAME => Order,
54
+ OrderReturn::OBJECT_NAME => OrderReturn,
55
+ PaymentIntent::OBJECT_NAME => PaymentIntent,
56
+ PaymentMethod::OBJECT_NAME => PaymentMethod,
57
+ Payout::OBJECT_NAME => Payout,
58
+ Person::OBJECT_NAME => Person,
59
+ Plan::OBJECT_NAME => Plan,
60
+ Product::OBJECT_NAME => Product,
61
+ Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
62
+ Radar::ValueList::OBJECT_NAME => Radar::ValueList,
63
+ Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
64
+ Recipient::OBJECT_NAME => Recipient,
65
+ RecipientTransfer::OBJECT_NAME => RecipientTransfer,
66
+ Refund::OBJECT_NAME => Refund,
67
+ Reporting::ReportRun::OBJECT_NAME => Reporting::ReportRun,
68
+ Reporting::ReportType::OBJECT_NAME => Reporting::ReportType,
69
+ Reversal::OBJECT_NAME => Reversal,
70
+ Review::OBJECT_NAME => Review,
71
+ SKU::OBJECT_NAME => SKU,
72
+ Sigma::ScheduledQueryRun::OBJECT_NAME => Sigma::ScheduledQueryRun,
73
+ Source::OBJECT_NAME => Source,
74
+ SourceTransaction::OBJECT_NAME => SourceTransaction,
75
+ Subscription::OBJECT_NAME => Subscription,
76
+ SubscriptionItem::OBJECT_NAME => SubscriptionItem,
77
+ SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
78
+ SubscriptionScheduleRevision::OBJECT_NAME => SubscriptionScheduleRevision,
79
+ TaxId::OBJECT_NAME => TaxId,
80
+ TaxRate::OBJECT_NAME => TaxRate,
81
+ Terminal::ConnectionToken::OBJECT_NAME => Terminal::ConnectionToken,
82
+ Terminal::Location::OBJECT_NAME => Terminal::Location,
83
+ Terminal::Reader::OBJECT_NAME => Terminal::Reader,
84
+ ThreeDSecure::OBJECT_NAME => ThreeDSecure,
85
+ Token::OBJECT_NAME => Token,
86
+ Topup::OBJECT_NAME => Topup,
87
+ Transfer::OBJECT_NAME => Transfer,
88
+ UsageRecord::OBJECT_NAME => UsageRecord,
89
+ UsageRecordSummary::OBJECT_NAME => UsageRecordSummary,
90
+ WebhookEndpoint::OBJECT_NAME => WebhookEndpoint,
91
+ }
92
+ end
93
+ end
94
+ end
95
+
96
+ # rubocop:enable Metrics/LineLength
97
+ # rubocop:enable Metrics/MethodLength
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "stripe/resources/account"
4
+ require "stripe/resources/account_link"
5
+ require "stripe/resources/alipay_account"
6
+ require "stripe/resources/apple_pay_domain"
7
+ require "stripe/resources/application_fee"
8
+ require "stripe/resources/application_fee_refund"
9
+ require "stripe/resources/balance"
10
+ require "stripe/resources/balance_transaction"
11
+ require "stripe/resources/bank_account"
12
+ require "stripe/resources/bitcoin_receiver"
13
+ require "stripe/resources/bitcoin_transaction"
14
+ require "stripe/resources/capability"
15
+ require "stripe/resources/card"
16
+ require "stripe/resources/charge"
17
+ require "stripe/resources/checkout/session"
18
+ require "stripe/resources/country_spec"
19
+ require "stripe/resources/coupon"
20
+ require "stripe/resources/credit_note"
21
+ require "stripe/resources/customer"
22
+ require "stripe/resources/customer_balance_transaction"
23
+ require "stripe/resources/discount"
24
+ require "stripe/resources/dispute"
25
+ require "stripe/resources/ephemeral_key"
26
+ require "stripe/resources/event"
27
+ require "stripe/resources/exchange_rate"
28
+ require "stripe/resources/file"
29
+ require "stripe/resources/file_link"
30
+ require "stripe/resources/invoice"
31
+ require "stripe/resources/invoice_item"
32
+ require "stripe/resources/invoice_line_item"
33
+ require "stripe/resources/issuer_fraud_record"
34
+ require "stripe/resources/issuing/authorization"
35
+ require "stripe/resources/issuing/card"
36
+ require "stripe/resources/issuing/card_details"
37
+ require "stripe/resources/issuing/cardholder"
38
+ require "stripe/resources/issuing/dispute"
39
+ require "stripe/resources/issuing/transaction"
40
+ require "stripe/resources/login_link"
41
+ require "stripe/resources/order"
42
+ require "stripe/resources/order_return"
43
+ require "stripe/resources/payment_intent"
44
+ require "stripe/resources/payment_method"
45
+ require "stripe/resources/payout"
46
+ require "stripe/resources/person"
47
+ require "stripe/resources/plan"
48
+ require "stripe/resources/product"
49
+ require "stripe/resources/radar/early_fraud_warning"
50
+ require "stripe/resources/radar/value_list"
51
+ require "stripe/resources/radar/value_list_item"
52
+ require "stripe/resources/recipient"
53
+ require "stripe/resources/recipient_transfer"
54
+ require "stripe/resources/refund"
55
+ require "stripe/resources/reporting/report_run"
56
+ require "stripe/resources/reporting/report_type"
57
+ require "stripe/resources/reversal"
58
+ require "stripe/resources/review"
59
+ require "stripe/resources/sigma/scheduled_query_run"
60
+ require "stripe/resources/sku"
61
+ require "stripe/resources/source"
62
+ require "stripe/resources/source_transaction"
63
+ require "stripe/resources/subscription"
64
+ require "stripe/resources/subscription_item"
65
+ require "stripe/resources/subscription_schedule"
66
+ require "stripe/resources/subscription_schedule_revision"
67
+ require "stripe/resources/tax_id"
68
+ require "stripe/resources/tax_rate"
69
+ require "stripe/resources/terminal/connection_token"
70
+ require "stripe/resources/terminal/location"
71
+ require "stripe/resources/terminal/reader"
72
+ require "stripe/resources/three_d_secure"
73
+ require "stripe/resources/token"
74
+ require "stripe/resources/topup"
75
+ require "stripe/resources/transfer"
76
+ require "stripe/resources/usage_record"
77
+ require "stripe/resources/usage_record_summary"
78
+ require "stripe/resources/webhook_endpoint"
@@ -4,8 +4,8 @@ module Stripe
4
4
  class Account < APIResource
5
5
  extend Gem::Deprecate
6
6
  extend Stripe::APIOperations::Create
7
- extend Stripe::APIOperations::List
8
7
  include Stripe::APIOperations::Delete
8
+ extend Stripe::APIOperations::List
9
9
  include Stripe::APIOperations::Save
10
10
  extend Stripe::APIOperations::NestedResource
11
11
 
@@ -13,17 +13,23 @@ module Stripe
13
13
 
14
14
  custom_method :reject, http_verb: :post
15
15
 
16
- save_nested_resource :external_account
17
16
  nested_resource_class_methods :capability,
18
17
  operations: %i[retrieve update list],
19
18
  resource_plural: "capabilities"
19
+ nested_resource_class_methods :person,
20
+ operations: %i[create retrieve update delete list]
21
+
22
+ def reject(params = {}, opts = {})
23
+ resp, opts = request(:post, resource_url + "/reject", params, opts)
24
+ Util.convert_to_stripe_object(resp.data, opts)
25
+ end
26
+
27
+ save_nested_resource :external_account
28
+
20
29
  nested_resource_class_methods :external_account,
21
- operations: %i[create retrieve update delete
22
- list]
30
+ operations: %i[create retrieve update delete list]
31
+
23
32
  nested_resource_class_methods :login_link, operations: %i[create]
24
- nested_resource_class_methods :person,
25
- operations: %i[create retrieve update delete
26
- list]
27
33
 
28
34
  # This method is deprecated. Please use `#external_account=` instead.
29
35
  save_nested_resource :bank_account
@@ -66,11 +72,6 @@ module Stripe
66
72
  # already has a capabilities property which is a hash and not the sub-list
67
73
  # of capabilities.
68
74
 
69
- def reject(params = {}, opts = {})
70
- resp, opts = request(:post, resource_url + "/reject", params, opts)
71
- initialize_from(resp.data, opts)
72
- end
73
-
74
75
  # Somewhat unfortunately, we attempt to do a special encoding trick when
75
76
  # serializing `additional_owners` under an account: when updating a value,
76
77
  # we actually send the update parameters up as an integer-indexed hash
@@ -15,11 +15,9 @@ module Stripe
15
15
 
16
16
  def resource_url
17
17
  if respond_to?(:customer)
18
- "#{Customer.resource_url}/#{CGI.escape(customer)}/sources" \
19
- "/#{CGI.escape(id)}"
18
+ "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
20
19
  elsif respond_to?(:account)
21
- "#{Account.resource_url}/#{CGI.escape(account)}/external_accounts" \
22
- "/#{CGI.escape(id)}"
20
+ "#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}"
23
21
  end
24
22
  end
25
23
 
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
+ # Directly creating or retrieving BitcoinReceivers is deprecated. Please use
5
+ # the Sources API instead: https://stripe.com/docs/sources/bitcoin
4
6
  class BitcoinReceiver < APIResource
5
- # Directly creating or retrieving BitcoinReceivers is deprecated. Please use
6
- # the Sources API instead: https://stripe.com/docs/sources/bitcoin
7
7
  extend Stripe::APIOperations::List
8
8
 
9
9
  OBJECT_NAME = "bitcoin_receiver".freeze
@@ -14,8 +14,7 @@ module Stripe
14
14
 
15
15
  def resource_url
16
16
  if respond_to?(:customer) && !customer.nil? && customer != ""
17
- "#{Customer.resource_url}/#{CGI.escape(customer)}/sources" \
18
- "/#{CGI.escape(id)}"
17
+ "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
19
18
  else
20
19
  "#{self.class.resource_url}/#{CGI.escape(id)}"
21
20
  end