recurly 3.0.0.beta.3 → 3.0.0.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -0
  3. data/.travis.yml +3 -1
  4. data/README.md +9 -2
  5. data/lib/recurly/client.rb +42 -13
  6. data/lib/recurly/client/adapter.rb +9 -18
  7. data/lib/recurly/client/operations.rb +1179 -78
  8. data/lib/recurly/errors/api_errors.rb +4 -0
  9. data/lib/recurly/errors/network_errors.rb +1 -1
  10. data/lib/recurly/pager.rb +5 -1
  11. data/lib/recurly/requests/account_acquisition_cost.rb +18 -0
  12. data/lib/recurly/requests/account_acquisition_updatable.rb +5 -1
  13. data/lib/recurly/requests/account_create.rb +23 -3
  14. data/lib/recurly/requests/account_update.rb +22 -2
  15. data/lib/recurly/requests/add_on_create.rb +7 -3
  16. data/lib/recurly/requests/add_on_pricing.rb +18 -0
  17. data/lib/recurly/requests/add_on_update.rb +7 -3
  18. data/lib/recurly/requests/address.rb +4 -0
  19. data/lib/recurly/requests/billing_info_create.rb +4 -0
  20. data/lib/recurly/requests/coupon_bulk_create.rb +4 -0
  21. data/lib/recurly/requests/coupon_create.rb +13 -9
  22. data/lib/recurly/requests/coupon_pricing.rb +18 -0
  23. data/lib/recurly/requests/coupon_redemption_create.rb +4 -0
  24. data/lib/recurly/requests/coupon_update.rb +4 -0
  25. data/lib/recurly/requests/external_refund.rb +22 -0
  26. data/lib/recurly/requests/invoice_address.rb +54 -0
  27. data/lib/recurly/requests/invoice_create.rb +6 -2
  28. data/lib/recurly/requests/invoice_refund.rb +7 -3
  29. data/lib/recurly/requests/invoice_updatable.rb +34 -0
  30. data/lib/recurly/requests/line_item_create.rb +6 -2
  31. data/lib/recurly/requests/line_item_refund.rb +4 -0
  32. data/lib/recurly/requests/plan_create.rb +11 -7
  33. data/lib/recurly/requests/plan_hosted_pages.rb +26 -0
  34. data/lib/recurly/requests/plan_pricing.rb +22 -0
  35. data/lib/recurly/requests/plan_update.rb +11 -7
  36. data/lib/recurly/requests/shipping_address_create.rb +4 -0
  37. data/lib/recurly/requests/shipping_address_update.rb +5 -1
  38. data/lib/recurly/requests/subscription_add_on_create.rb +8 -0
  39. data/lib/recurly/requests/subscription_change_create.rb +13 -5
  40. data/lib/recurly/requests/subscription_create.rb +11 -7
  41. data/lib/recurly/requests/subscription_pause.rb +4 -0
  42. data/lib/recurly/requests/subscription_update.rb +8 -4
  43. data/lib/recurly/resource.rb +6 -6
  44. data/lib/recurly/resources/account.rb +27 -11
  45. data/lib/recurly/resources/account_acquisition.rb +9 -5
  46. data/lib/recurly/resources/account_acquisition_cost.rb +18 -0
  47. data/lib/recurly/resources/account_balance.rb +7 -3
  48. data/lib/recurly/resources/account_balance_amount.rb +18 -0
  49. data/lib/recurly/resources/account_mini.rb +18 -2
  50. data/lib/recurly/resources/account_note.rb +7 -3
  51. data/lib/recurly/resources/add_on.rb +13 -9
  52. data/lib/recurly/resources/add_on_mini.rb +6 -2
  53. data/lib/recurly/resources/add_on_pricing.rb +18 -0
  54. data/lib/recurly/resources/address.rb +4 -0
  55. data/lib/recurly/resources/billing_info.rb +12 -8
  56. data/lib/recurly/resources/billing_info_payment_method.rb +34 -0
  57. data/lib/recurly/resources/billing_info_updated_by.rb +18 -0
  58. data/lib/recurly/resources/coupon.rb +21 -13
  59. data/lib/recurly/resources/coupon_discount.rb +7 -3
  60. data/lib/recurly/resources/coupon_discount_pricing.rb +18 -0
  61. data/lib/recurly/resources/coupon_discount_trial.rb +18 -0
  62. data/lib/recurly/resources/coupon_mini.rb +8 -4
  63. data/lib/recurly/resources/coupon_redemption.rb +9 -5
  64. data/lib/recurly/resources/coupon_redemption_mini.rb +8 -4
  65. data/lib/recurly/resources/credit_payment.rb +8 -4
  66. data/lib/recurly/resources/custom_field.rb +4 -0
  67. data/lib/recurly/resources/custom_field_definition.rb +11 -7
  68. data/lib/recurly/resources/error.rb +6 -2
  69. data/lib/recurly/resources/error_may_have_transaction.rb +6 -2
  70. data/lib/recurly/resources/fraud_info.rb +22 -0
  71. data/lib/recurly/resources/invoice.rb +17 -13
  72. data/lib/recurly/resources/invoice_address.rb +54 -0
  73. data/lib/recurly/resources/invoice_collection.rb +5 -1
  74. data/lib/recurly/resources/invoice_mini.rb +6 -2
  75. data/lib/recurly/resources/line_item.rb +13 -5
  76. data/lib/recurly/resources/line_item_list.rb +5 -1
  77. data/lib/recurly/resources/plan.rb +16 -12
  78. data/lib/recurly/resources/plan_hosted_pages.rb +26 -0
  79. data/lib/recurly/resources/plan_mini.rb +6 -2
  80. data/lib/recurly/resources/plan_pricing.rb +22 -0
  81. data/lib/recurly/resources/settings.rb +7 -3
  82. data/lib/recurly/resources/shipping_address.rb +8 -4
  83. data/lib/recurly/resources/site.rb +16 -8
  84. data/lib/recurly/resources/subscription.rb +9 -5
  85. data/lib/recurly/resources/subscription_add_on.rb +4 -0
  86. data/lib/recurly/resources/subscription_change.rb +9 -5
  87. data/lib/recurly/resources/tax_info.rb +4 -0
  88. data/lib/recurly/resources/transaction.rb +16 -8
  89. data/lib/recurly/resources/transaction_payment_gateway.rb +26 -0
  90. data/lib/recurly/resources/transaction_payment_method.rb +34 -0
  91. data/lib/recurly/resources/unique_coupon_code.rb +10 -6
  92. data/lib/recurly/resources/user.rb +8 -4
  93. data/lib/recurly/schema/json_deserializer.rb +18 -20
  94. data/lib/recurly/schema/request_caster.rb +1 -1
  95. data/lib/recurly/schema/schema_validator.rb +31 -8
  96. data/lib/recurly/version.rb +1 -1
  97. data/recurly.gemspec +1 -1
  98. data/scripts/check-deps +28 -0
  99. data/scripts/install-deps +44 -0
  100. metadata +37 -7
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class InvoiceCreate < Request
@@ -8,7 +12,7 @@ module Recurly
8
12
 
9
13
  # @!attribute collection_method
10
14
  # @return [String] An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment.
11
- define_attribute :collection_method, String, {:enum => ["automatic", "manual"]}
15
+ define_attribute :collection_method, String, { :enum => ["automatic", "manual"] }
12
16
 
13
17
  # @!attribute credit_customer_notes
14
18
  # @return [String] This will default to the Customer Notes text specified on the Invoice Settings for credit invoices. Specify customer notes to add or override Customer Notes on credit invoices.
@@ -32,7 +36,7 @@ module Recurly
32
36
 
33
37
  # @!attribute type
34
38
  # @return [String] Specify a type to limit the type of line items that will be invoiced.
35
- define_attribute :type, String, {:enum => ["charge", "credit"]}
39
+ define_attribute :type, String, { :enum => ["charge", "credit"] }
36
40
 
37
41
  # @!attribute vat_reverse_charge_notes
38
42
  # @return [String] VAT Reverse Charge Notes only appear if you have EU VAT enabled or are using your own Avalara AvaTax account and the customer is in the EU, has a VAT number, and is in a different country than your own. This will default to the VAT Reverse Charge Notes text specified on the Tax Settings page in your Recurly admin, unless custom notes were created with the original subscription.
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class InvoiceRefund < Request
@@ -16,15 +20,15 @@ module Recurly
16
20
 
17
21
  # @!attribute line_items
18
22
  # @return [Array[LineItemRefund]] The line items to be refunded. This is required when `type=line_items`.
19
- define_attribute :line_items, Array, {:item_type => :LineItemRefund}
23
+ define_attribute :line_items, Array, { :item_type => :LineItemRefund }
20
24
 
21
25
  # @!attribute refund_method
22
26
  # @return [String] Indicates how the invoice should be refunded when both a credit and transaction are present on the invoice: - `transaction_first` – Refunds the transaction first, then any amount is issued as credit back to the account. Default value when Credit Invoices feature is enabled. - `credit_first` – Issues credit back to the account first, then refunds any remaining amount back to the transaction. Default value when Credit Invoices feature is not enabled. - `all_credit` – Issues credit to the account for the entire amount of the refund. Only available when the Credit Invoices feature is enabled. - `all_transaction` – Refunds the entire amount back to transactions, using transactions from previous invoices if necessary. Only available when the Credit Invoices feature is enabled.
23
- define_attribute :refund_method, String, {:enum => ["transaction_first", "credit_first", "all_credit", "all_transaction"]}
27
+ define_attribute :refund_method, String, { :enum => ["transaction_first", "credit_first", "all_credit", "all_transaction"] }
24
28
 
25
29
  # @!attribute type
26
30
  # @return [String] The type of refund. Amount and line items cannot both be specified in the request.
27
- define_attribute :type, String, {:enum => ["amount", "line_items"]}
31
+ define_attribute :type, String, { :enum => ["amount", "line_items"] }
28
32
  end
29
33
  end
30
34
  end
@@ -0,0 +1,34 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Requests
7
+ class InvoiceUpdatable < Request
8
+
9
+ # @!attribute address
10
+ # @return [InvoiceAddress]
11
+ define_attribute :address, :InvoiceAddress
12
+
13
+ # @!attribute customer_notes
14
+ # @return [String] Customer notes are an optional note field.
15
+ define_attribute :customer_notes, String
16
+
17
+ # @!attribute net_terms
18
+ # @return [Integer] Integer representing the number of days after an invoice's creation that the invoice will become past due. Changing Net terms changes due_on, and the invoice could move between past due and pending.
19
+ define_attribute :net_terms, Integer
20
+
21
+ # @!attribute po_number
22
+ # @return [String] This identifies the PO number associated with the invoice. Not editable for credit invoices.
23
+ define_attribute :po_number, String
24
+
25
+ # @!attribute terms_and_conditions
26
+ # @return [String] Terms and conditions are an optional note field. Not editable for credit invoices.
27
+ define_attribute :terms_and_conditions, String
28
+
29
+ # @!attribute vat_reverse_charge_notes
30
+ # @return [String] VAT Reverse Charge Notes are editable only if there was a VAT reverse charge applied to the invoice.
31
+ define_attribute :vat_reverse_charge_notes, String
32
+ end
33
+ end
34
+ end
@@ -1,10 +1,14 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class LineItemCreate < Request
4
8
 
5
9
  # @!attribute credit_reason_code
6
10
  # @return [String] The reason the credit was given when line item is `type=credit`. When the Credit Invoices feature is enabled, the value can be set and will default to `general`. When the Credit Invoices feature is not enabled, the value will always be `null`.
7
- define_attribute :credit_reason_code, String, {:enum => ["general", "service", "promotional"]}
11
+ define_attribute :credit_reason_code, String, { :enum => ["general", "service", "promotional"] }
8
12
 
9
13
  # @!attribute currency
10
14
  # @return [String] 3-letter ISO 4217 currency code.
@@ -36,7 +40,7 @@ module Recurly
36
40
 
37
41
  # @!attribute type
38
42
  # @return [String] Line item type.
39
- define_attribute :type, String, {:enum => ["charge", "credit"]}
43
+ define_attribute :type, String, { :enum => ["charge", "credit"] }
40
44
 
41
45
  # @!attribute unit_amount
42
46
  # @return [Float] A positive or negative amount with `type=charge` will result in a positive `unit_amount`. A positive or negative amount with `type=credit` will result in a negative `unit_amount`.
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class LineItemRefund < Request
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class PlanCreate < Request
@@ -8,7 +12,7 @@ module Recurly
8
12
 
9
13
  # @!attribute add_ons
10
14
  # @return [Array[AddOnCreate]] Add Ons
11
- define_attribute :add_ons, Array, {:item_type => :AddOnCreate}
15
+ define_attribute :add_ons, Array, { :item_type => :AddOnCreate }
12
16
 
13
17
  # @!attribute auto_renew
14
18
  # @return [Boolean] Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
@@ -19,16 +23,16 @@ module Recurly
19
23
  define_attribute :code, String
20
24
 
21
25
  # @!attribute currencies
22
- # @return [Array[Hash]] Pricing
23
- define_attribute :currencies, Array, {:item_type => Hash}
26
+ # @return [Array[PlanPricing]] Pricing
27
+ define_attribute :currencies, Array, { :item_type => :PlanPricing }
24
28
 
25
29
  # @!attribute description
26
30
  # @return [String] Optional description, not displayed.
27
31
  define_attribute :description, String
28
32
 
29
33
  # @!attribute hosted_pages
30
- # @return [Hash] Hosted pages settings
31
- define_attribute :hosted_pages, Hash
34
+ # @return [PlanHostedPages] Hosted pages settings
35
+ define_attribute :hosted_pages, :PlanHostedPages
32
36
 
33
37
  # @!attribute interval_length
34
38
  # @return [Integer] Length of the plan's billing interval in `interval_unit`.
@@ -36,7 +40,7 @@ module Recurly
36
40
 
37
41
  # @!attribute interval_unit
38
42
  # @return [String] Unit for the plan's billing interval.
39
- define_attribute :interval_unit, String, {:enum => ["days", "months"]}
43
+ define_attribute :interval_unit, String, { :enum => ["days", "months"] }
40
44
 
41
45
  # @!attribute name
42
46
  # @return [String] This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
@@ -64,7 +68,7 @@ module Recurly
64
68
 
65
69
  # @!attribute trial_unit
66
70
  # @return [String] Units for the plan's trial period.
67
- define_attribute :trial_unit, String, {:enum => ["days", "months"]}
71
+ define_attribute :trial_unit, String, { :enum => ["days", "months"] }
68
72
  end
69
73
  end
70
74
  end
@@ -0,0 +1,26 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Requests
7
+ class PlanHostedPages < Request
8
+
9
+ # @!attribute bypass_confirmation
10
+ # @return [Boolean] If `true`, the customer will be sent directly to your `success_url` after a successful signup, bypassing Recurly's hosted confirmation page.
11
+ define_attribute :bypass_confirmation, :Boolean
12
+
13
+ # @!attribute cancel_url
14
+ # @return [String] URL to redirect to on canceled signup on the hosted payment pages.
15
+ define_attribute :cancel_url, String
16
+
17
+ # @!attribute display_quantity
18
+ # @return [Boolean] Determines if the quantity field is displayed on the hosted pages for the plan.
19
+ define_attribute :display_quantity, :Boolean
20
+
21
+ # @!attribute success_url
22
+ # @return [String] URL to redirect to after signup on the hosted payment pages.
23
+ define_attribute :success_url, String
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Requests
7
+ class PlanPricing < Request
8
+
9
+ # @!attribute currency
10
+ # @return [String] 3-letter ISO 4217 currency code.
11
+ define_attribute :currency, String
12
+
13
+ # @!attribute setup_fee
14
+ # @return [Float] Amount of one-time setup fee automatically charged at the beginning of a subscription billing cycle. For subscription plans with a trial, the setup fee will be charged at the time of signup. Setup fees do not increase with the quantity of a subscription plan.
15
+ define_attribute :setup_fee, Float
16
+
17
+ # @!attribute unit_amount
18
+ # @return [Float] Unit price
19
+ define_attribute :unit_amount, Float
20
+ end
21
+ end
22
+ end
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class PlanUpdate < Request
@@ -8,7 +12,7 @@ module Recurly
8
12
 
9
13
  # @!attribute add_ons
10
14
  # @return [Array[AddOnCreate]] Add Ons
11
- define_attribute :add_ons, Array, {:item_type => :AddOnCreate}
15
+ define_attribute :add_ons, Array, { :item_type => :AddOnCreate }
12
16
 
13
17
  # @!attribute auto_renew
14
18
  # @return [Boolean] Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
@@ -19,20 +23,20 @@ module Recurly
19
23
  define_attribute :code, String
20
24
 
21
25
  # @!attribute currencies
22
- # @return [Array[Hash]] Pricing
23
- define_attribute :currencies, Array, {:item_type => Hash}
26
+ # @return [Array[PlanPricing]] Pricing
27
+ define_attribute :currencies, Array, { :item_type => :PlanPricing }
24
28
 
25
29
  # @!attribute description
26
30
  # @return [String] Optional description, not displayed.
27
31
  define_attribute :description, String
28
32
 
29
33
  # @!attribute hosted_pages
30
- # @return [Hash] Hosted pages settings
31
- define_attribute :hosted_pages, Hash
34
+ # @return [PlanHostedPages] Hosted pages settings
35
+ define_attribute :hosted_pages, :PlanHostedPages
32
36
 
33
37
  # @!attribute [r] id
34
38
  # @return [String] Plan ID
35
- define_attribute :id, String, {:read_only => true}
39
+ define_attribute :id, String, { :read_only => true }
36
40
 
37
41
  # @!attribute name
38
42
  # @return [String] This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
@@ -60,7 +64,7 @@ module Recurly
60
64
 
61
65
  # @!attribute trial_unit
62
66
  # @return [String] Units for the plan's trial period.
63
- define_attribute :trial_unit, String, {:enum => ["days", "months"]}
67
+ define_attribute :trial_unit, String, { :enum => ["days", "months"] }
64
68
  end
65
69
  end
66
70
  end
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class ShippingAddressCreate < Request
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class ShippingAddressUpdate < Request
@@ -24,7 +28,7 @@ module Recurly
24
28
 
25
29
  # @!attribute [r] id
26
30
  # @return [String] Shipping Address ID
27
- define_attribute :id, String, {:read_only => true}
31
+ define_attribute :id, String, { :read_only => true }
28
32
 
29
33
  # @!attribute last_name
30
34
  # @return [String]
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class SubscriptionAddOnCreate < Request
@@ -6,6 +10,10 @@ module Recurly
6
10
  # @return [String] Add-on code
7
11
  define_attribute :code, String
8
12
 
13
+ # @!attribute id
14
+ # @return [String] Setting this field allows you to reference an existing add-on.
15
+ define_attribute :id, String
16
+
9
17
  # @!attribute quantity
10
18
  # @return [Integer] Optionally override the default quantity.
11
19
  define_attribute :quantity, Integer
@@ -1,27 +1,35 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class SubscriptionChangeCreate < Request
4
8
 
5
9
  # @!attribute add_ons
6
10
  # @return [Array[SubscriptionAddOnCreate]] If you set this value you include all the add-ons and their quantities and amounts. The values you include will replace the previous values entirely.
7
- define_attribute :add_ons, Array, {:item_type => :SubscriptionAddOnCreate}
11
+ define_attribute :add_ons, Array, { :item_type => :SubscriptionAddOnCreate }
8
12
 
9
13
  # @!attribute collection_method
10
14
  # @return [String] Collection method
11
- define_attribute :collection_method, String, {:enum => ["automatic", "manual"]}
15
+ define_attribute :collection_method, String, { :enum => ["automatic", "manual"] }
12
16
 
13
17
  # @!attribute coupon_codes
14
18
  # @return [Array[String]] A list of coupon_codes to be redeemed on the subscription during the change. Only allowed if timeframe is now and you change something about the subscription that creates an invoice.
15
- define_attribute :coupon_codes, Array, {:item_type => String}
19
+ define_attribute :coupon_codes, Array, { :item_type => String }
16
20
 
17
21
  # @!attribute net_terms
18
22
  # @return [Integer] Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
19
23
  define_attribute :net_terms, Integer
20
24
 
21
25
  # @!attribute plan_code
22
- # @return [String] The plan code.
26
+ # @return [String] If you want to change to a new plan, you can provide the plan's code or id. If both are provided the `plan_id` will be used.
23
27
  define_attribute :plan_code, String
24
28
 
29
+ # @!attribute plan_id
30
+ # @return [String] If you want to change to a new plan, you can provide the plan's code or id. If both are provided the `plan_id` will be used.
31
+ define_attribute :plan_id, String
32
+
25
33
  # @!attribute po_number
26
34
  # @return [String] For manual invoicing, this identifies the PO number associated with the subscription.
27
35
  define_attribute :po_number, String
@@ -32,7 +40,7 @@ module Recurly
32
40
 
33
41
  # @!attribute timeframe
34
42
  # @return [String] The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now or when the subscription renews. Generally, if you're performing an upgrade, you will want the change to occur immediately (now). If you're performing a downgrade, you should set the timeframe to "renewal" so the change takes affect at the end of the current billing cycle.
35
- define_attribute :timeframe, String, {:enum => ["now", "renewal"]}
43
+ define_attribute :timeframe, String, { :enum => ["now", "renewal"] }
36
44
 
37
45
  # @!attribute unit_amount
38
46
  # @return [Float] Optionally, sets custom pricing for the subscription, overriding the plan's default unit amount. The subscription's current currency will be used.
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class SubscriptionCreate < Request
@@ -8,7 +12,7 @@ module Recurly
8
12
 
9
13
  # @!attribute add_ons
10
14
  # @return [Array[SubscriptionAddOnCreate]] Add-ons
11
- define_attribute :add_ons, Array, {:item_type => :SubscriptionAddOnCreate}
15
+ define_attribute :add_ons, Array, { :item_type => :SubscriptionAddOnCreate }
12
16
 
13
17
  # @!attribute auto_renew
14
18
  # @return [Boolean] Whether the subscription renews at the end of its term.
@@ -16,7 +20,7 @@ module Recurly
16
20
 
17
21
  # @!attribute collection_method
18
22
  # @return [String] Collection method
19
- define_attribute :collection_method, String, {:enum => ["automatic", "manual"]}
23
+ define_attribute :collection_method, String, { :enum => ["automatic", "manual"] }
20
24
 
21
25
  # @!attribute coupon_code
22
26
  # @return [String] Optional coupon code to redeem on the account and discount the subscription. Please note, the subscription request will fail if the coupon is invalid.
@@ -32,7 +36,7 @@ module Recurly
32
36
 
33
37
  # @!attribute custom_fields
34
38
  # @return [Array[CustomField]]
35
- define_attribute :custom_fields, Array, {:item_type => :CustomField}
39
+ define_attribute :custom_fields, Array, { :item_type => :CustomField }
36
40
 
37
41
  # @!attribute customer_notes
38
42
  # @return [String] This will default to the Customer Notes text specified on the Invoice Settings. Specify custom notes to add or override Customer Notes. Custom notes will stay with a subscription on all renewals.
@@ -47,11 +51,11 @@ module Recurly
47
51
  define_attribute :next_bill_date, DateTime
48
52
 
49
53
  # @!attribute plan_code
50
- # @return [String] Plan code
54
+ # @return [String] You must provide either a `plan_code` or `plan_id`. If both are provided the `plan_id` will be used.
51
55
  define_attribute :plan_code, String
52
56
 
53
57
  # @!attribute plan_id
54
- # @return [String] Plan ID
58
+ # @return [String] You must provide either a `plan_code` or `plan_id`. If both are provided the `plan_id` will be used.
55
59
  define_attribute :plan_id, String
56
60
 
57
61
  # @!attribute po_number
@@ -67,8 +71,8 @@ module Recurly
67
71
  define_attribute :renewal_billing_cycles, Integer
68
72
 
69
73
  # @!attribute shipping_address
70
- # @return [Hash] Create a shipping address on the account and assign it to the subscription.
71
- define_attribute :shipping_address, Hash
74
+ # @return [ShippingAddressCreate] Create a shipping address on the account and assign it to the subscription.
75
+ define_attribute :shipping_address, :ShippingAddressCreate
72
76
 
73
77
  # @!attribute shipping_address_id
74
78
  # @return [String] Assign a shipping address from the account's existing shipping addresses. If this and `shipping_address` are both present, `shipping_address` will take precedence.
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class SubscriptionPause < Request
@@ -1,3 +1,7 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
1
5
  module Recurly
2
6
  module Requests
3
7
  class SubscriptionUpdate < Request
@@ -8,11 +12,11 @@ module Recurly
8
12
 
9
13
  # @!attribute collection_method
10
14
  # @return [String] Change collection method
11
- define_attribute :collection_method, String, {:enum => ["automatic", "manual"]}
15
+ define_attribute :collection_method, String, { :enum => ["automatic", "manual"] }
12
16
 
13
17
  # @!attribute custom_fields
14
18
  # @return [Array[CustomField]]
15
- define_attribute :custom_fields, Array, {:item_type => :CustomField}
19
+ define_attribute :custom_fields, Array, { :item_type => :CustomField }
16
20
 
17
21
  # @!attribute customer_notes
18
22
  # @return [String] Specify custom notes to add or override Customer Notes. Custom notes will stay with a subscription on all renewals.
@@ -39,8 +43,8 @@ module Recurly
39
43
  define_attribute :renewal_billing_cycles, Integer
40
44
 
41
45
  # @!attribute shipping_address
42
- # @return [Hash] Create a shipping address on the account and assign it to the subscription. If this and `shipping_address_id` are both present, `shipping_address_id` will take precedence."
43
- define_attribute :shipping_address, Hash
46
+ # @return [ShippingAddressCreate] Create a shipping address on the account and assign it to the subscription. If this and `shipping_address_id` are both present, `shipping_address_id` will take precedence."
47
+ define_attribute :shipping_address, :ShippingAddressCreate
44
48
 
45
49
  # @!attribute shipping_address_id
46
50
  # @return [String] Assign a shipping address from the account's existing shipping addresses.