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 Resources
3
7
  class Error < Resource
@@ -8,11 +12,11 @@ module Recurly
8
12
 
9
13
  # @!attribute params
10
14
  # @return [Array[Hash]] Parameter specific errors
11
- define_attribute :params, Array, {:item_type => Hash}
15
+ define_attribute :params, Array, { :item_type => Hash }
12
16
 
13
17
  # @!attribute type
14
18
  # @return [String] Type
15
- define_attribute :type, String, {:enum => ["bad_request", "internal_server_error", "immutable_subscription", "invalid_api_key", "invalid_api_version", "invalid_content_type", "invalid_permissions", "invalid_token", "not_found", "simultaneous_request", "transaction", "unauthorized", "unavailable_in_api_version", "unknown_api_version", "validation", "missing_feature"]}
19
+ define_attribute :type, String, { :enum => ["bad_request", "internal_server_error", "immutable_subscription", "invalid_api_key", "invalid_api_version", "invalid_content_type", "invalid_permissions", "invalid_token", "not_found", "simultaneous_request", "transaction", "unauthorized", "unavailable_in_api_version", "unknown_api_version", "validation", "missing_feature"] }
16
20
  end
17
21
  end
18
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 Resources
3
7
  class ErrorMayHaveTransaction < Resource
@@ -8,7 +12,7 @@ module Recurly
8
12
 
9
13
  # @!attribute params
10
14
  # @return [Array[Hash]] Parameter specific errors
11
- define_attribute :params, Array, {:item_type => Hash}
15
+ define_attribute :params, Array, { :item_type => Hash }
12
16
 
13
17
  # @!attribute transaction_error
14
18
  # @return [Hash] This is only included on errors with `type=transaction`.
@@ -16,7 +20,7 @@ module Recurly
16
20
 
17
21
  # @!attribute type
18
22
  # @return [String] Type
19
- define_attribute :type, String, {:enum => ["bad_request", "internal_server_error", "immutable_subscription", "invalid_api_key", "invalid_api_version", "invalid_content_type", "invalid_permissions", "invalid_token", "not_found", "simultaneous_request", "transaction", "unauthorized", "unavailable_in_api_version", "unknown_api_version", "validation", "missing_feature"]}
23
+ define_attribute :type, String, { :enum => ["bad_request", "internal_server_error", "immutable_subscription", "invalid_api_key", "invalid_api_version", "invalid_content_type", "invalid_permissions", "invalid_token", "not_found", "simultaneous_request", "transaction", "unauthorized", "unavailable_in_api_version", "unknown_api_version", "validation", "missing_feature"] }
20
24
  end
21
25
  end
22
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 Resources
7
+ class FraudInfo < Resource
8
+
9
+ # @!attribute decision
10
+ # @return [String] Kount decision
11
+ define_attribute :decision, String, { :enum => ["approve", "review", "decline", "escalate"] }
12
+
13
+ # @!attribute risk_rules_triggered
14
+ # @return [Hash] Kount rules
15
+ define_attribute :risk_rules_triggered, Hash
16
+
17
+ # @!attribute score
18
+ # @return [Integer] Kount score
19
+ define_attribute :score, Integer
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 Resources
3
7
  class Invoice < Resource
@@ -7,8 +11,8 @@ module Recurly
7
11
  define_attribute :account, :AccountMini
8
12
 
9
13
  # @!attribute address
10
- # @return [Address]
11
- define_attribute :address, :Address
14
+ # @return [InvoiceAddress]
15
+ define_attribute :address, :InvoiceAddress
12
16
 
13
17
  # @!attribute balance
14
18
  # @return [Float] The outstanding balance remaining on this invoice.
@@ -20,15 +24,15 @@ module Recurly
20
24
 
21
25
  # @!attribute collection_method
22
26
  # @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.
23
- define_attribute :collection_method, String, {:enum => ["automatic", "manual"]}
27
+ define_attribute :collection_method, String, { :enum => ["automatic", "manual"] }
24
28
 
25
29
  # @!attribute [r] created_at
26
30
  # @return [DateTime] Created at
27
- define_attribute :created_at, DateTime, {:read_only => true}
31
+ define_attribute :created_at, DateTime, { :read_only => true }
28
32
 
29
33
  # @!attribute credit_payments
30
34
  # @return [Array[CreditPayment]] Credit payments
31
- define_attribute :credit_payments, Array, {:item_type => :CreditPayment}
35
+ define_attribute :credit_payments, Array, { :item_type => :CreditPayment }
32
36
 
33
37
  # @!attribute currency
34
38
  # @return [String] 3-letter ISO 4217 currency code.
@@ -48,7 +52,7 @@ module Recurly
48
52
 
49
53
  # @!attribute [r] id
50
54
  # @return [String] Invoice ID
51
- define_attribute :id, String, {:read_only => true}
55
+ define_attribute :id, String, { :read_only => true }
52
56
 
53
57
  # @!attribute line_items
54
58
  # @return [LineItemList]
@@ -64,11 +68,11 @@ module Recurly
64
68
 
65
69
  # @!attribute [r] object
66
70
  # @return [String] Object type
67
- define_attribute :object, String, {:read_only => true}
71
+ define_attribute :object, String, { :read_only => true }
68
72
 
69
73
  # @!attribute origin
70
74
  # @return [String] The event that created the invoice.
71
- define_attribute :origin, String, {:enum => ["purchase", "line_item_refund", "open_amount_refund", "renewal", "immediate_change", "termination", "credit", "gift_card", "write_off"]}
75
+ define_attribute :origin, String, { :enum => ["purchase", "line_item_refund", "open_amount_refund", "renewal", "immediate_change", "termination", "credit", "gift_card", "write_off"] }
72
76
 
73
77
  # @!attribute paid
74
78
  # @return [Float] The total amount of successful payments transaction on this invoice.
@@ -88,11 +92,11 @@ module Recurly
88
92
 
89
93
  # @!attribute state
90
94
  # @return [String] Invoice state
91
- define_attribute :state, String, {:enum => ["pending", "processing", "past_due", "paid", "failed"]}
95
+ define_attribute :state, String, { :enum => ["pending", "processing", "past_due", "paid", "failed"] }
92
96
 
93
97
  # @!attribute subscription_ids
94
98
  # @return [Array[String]] If the invoice is charging or refunding for one or more subscriptions, these are their IDs.
95
- define_attribute :subscription_ids, Array, {:item_type => String}
99
+ define_attribute :subscription_ids, Array, { :item_type => String }
96
100
 
97
101
  # @!attribute subtotal
98
102
  # @return [Float] The summation of charges, discounts, and credits, before tax.
@@ -116,15 +120,15 @@ module Recurly
116
120
 
117
121
  # @!attribute transactions
118
122
  # @return [Array[Transaction]] Transactions
119
- define_attribute :transactions, Array, {:item_type => :Transaction}
123
+ define_attribute :transactions, Array, { :item_type => :Transaction }
120
124
 
121
125
  # @!attribute type
122
126
  # @return [String] Invoices are either charge, credit, or legacy invoices.
123
- define_attribute :type, String, {:enum => ["charge", "credit", "legacy"]}
127
+ define_attribute :type, String, { :enum => ["charge", "credit", "legacy"] }
124
128
 
125
129
  # @!attribute [r] updated_at
126
130
  # @return [DateTime] Last updated at
127
- define_attribute :updated_at, DateTime, {:read_only => true}
131
+ define_attribute :updated_at, DateTime, { :read_only => true }
128
132
 
129
133
  # @!attribute vat_number
130
134
  # @return [String] VAT registration number for the customer on this invoice. This will come from the VAT Number field in the Billing Info or the Account Info depending on your tax settings and the invoice collection method.
@@ -0,0 +1,54 @@
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 Resources
7
+ class InvoiceAddress < Resource
8
+
9
+ # @!attribute city
10
+ # @return [String] City
11
+ define_attribute :city, String
12
+
13
+ # @!attribute company
14
+ # @return [String] Company
15
+ define_attribute :company, String
16
+
17
+ # @!attribute country
18
+ # @return [String] Country, 2-letter ISO code.
19
+ define_attribute :country, String
20
+
21
+ # @!attribute first_name
22
+ # @return [String] First name
23
+ define_attribute :first_name, String
24
+
25
+ # @!attribute last_name
26
+ # @return [String] Last name
27
+ define_attribute :last_name, String
28
+
29
+ # @!attribute name_on_account
30
+ # @return [String] Name on account
31
+ define_attribute :name_on_account, String
32
+
33
+ # @!attribute phone
34
+ # @return [String] Phone number
35
+ define_attribute :phone, String
36
+
37
+ # @!attribute postal_code
38
+ # @return [String] Zip or postal code.
39
+ define_attribute :postal_code, String
40
+
41
+ # @!attribute region
42
+ # @return [String] State or province.
43
+ define_attribute :region, String
44
+
45
+ # @!attribute street1
46
+ # @return [String] Street 1
47
+ define_attribute :street1, String
48
+
49
+ # @!attribute street2
50
+ # @return [String] Street 2
51
+ define_attribute :street2, String
52
+ end
53
+ end
54
+ 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 Resources
3
7
  class InvoiceCollection < Resource
@@ -8,7 +12,7 @@ module Recurly
8
12
 
9
13
  # @!attribute credit_invoices
10
14
  # @return [Array[Invoice]] Credit invoices
11
- define_attribute :credit_invoices, Array, {:item_type => :Invoice}
15
+ define_attribute :credit_invoices, Array, { :item_type => :Invoice }
12
16
 
13
17
  # @!attribute object
14
18
  # @return [String] Object type
@@ -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 Resources
3
7
  class InvoiceMini < Resource
@@ -16,11 +20,11 @@ module Recurly
16
20
 
17
21
  # @!attribute state
18
22
  # @return [String] Invoice state
19
- define_attribute :state, String, {:enum => ["pending", "processing", "past_due", "paid", "failed"]}
23
+ define_attribute :state, String, { :enum => ["pending", "processing", "past_due", "paid", "failed"] }
20
24
 
21
25
  # @!attribute type
22
26
  # @return [String] Invoice type
23
- define_attribute :type, String, {:enum => ["charge", "credit", "legacy"]}
27
+ define_attribute :type, String, { :enum => ["charge", "credit", "legacy"] }
24
28
  end
25
29
  end
26
30
  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 Resources
3
7
  class LineItem < Resource
@@ -32,7 +36,7 @@ module Recurly
32
36
 
33
37
  # @!attribute credit_reason_code
34
38
  # @return [String] The reason the credit was given when line item is `type=credit`.
35
- define_attribute :credit_reason_code, String, {:enum => ["general", "service", "promotional", "refund", "gift_card", "write_off"]}
39
+ define_attribute :credit_reason_code, String, { :enum => ["general", "service", "promotional", "refund", "gift_card", "write_off"] }
36
40
 
37
41
  # @!attribute currency
38
42
  # @return [String] 3-letter ISO 4217 currency code.
@@ -64,7 +68,7 @@ module Recurly
64
68
 
65
69
  # @!attribute legacy_category
66
70
  # @return [String] Category to describe the role of a line item on a legacy invoice: - "charges" refers to charges being billed for on this invoice. - "credits" refers to refund or proration credits. This portion of the invoice can be considered a credit memo. - "applied_credits" refers to previous credits applied to this invoice. See their original_line_item_id to determine where the credit first originated. - "carryforwards" can be ignored. They exist to consume any remaining credit balance. A new credit with the same amount will be created and placed back on the account.
67
- define_attribute :legacy_category, String, {:enum => ["charge", "credit", "applied_credit", "carryforward"]}
71
+ define_attribute :legacy_category, String, { :enum => ["charge", "credit", "applied_credit", "carryforward"] }
68
72
 
69
73
  # @!attribute object
70
74
  # @return [String] Object type
@@ -72,7 +76,7 @@ module Recurly
72
76
 
73
77
  # @!attribute origin
74
78
  # @return [String] A credit created from an original charge will have the value of the charge's origin.
75
- define_attribute :origin, String, {:enum => ["plan", "plan_trial", "setup_fee", "add_on_trial", "add_on", "debit", "one_time", "credit", "coupon", "carryforward"]}
79
+ define_attribute :origin, String, { :enum => ["plan", "plan_trial", "setup_fee", "add_on_trial", "add_on", "debit", "one_time", "credit", "coupon", "carryforward"] }
76
80
 
77
81
  # @!attribute original_line_item_invoice_id
78
82
  # @return [String] The invoice where the credit originated. Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund.
@@ -110,13 +114,17 @@ module Recurly
110
114
  # @return [Integer] For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds).
111
115
  define_attribute :refunded_quantity, Integer
112
116
 
117
+ # @!attribute shipping_address
118
+ # @return [ShippingAddress]
119
+ define_attribute :shipping_address, :ShippingAddress
120
+
113
121
  # @!attribute start_date
114
122
  # @return [DateTime] If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date.
115
123
  define_attribute :start_date, DateTime
116
124
 
117
125
  # @!attribute state
118
126
  # @return [String] Pending line items are charges or credits on an account that have not been applied to an invoice yet. Invoiced line items will always have an `invoice_id` value.
119
- define_attribute :state, String, {:enum => ["pending", "invoiced"]}
127
+ define_attribute :state, String, { :enum => ["pending", "invoiced"] }
120
128
 
121
129
  # @!attribute subscription_id
122
130
  # @return [String] If the line item is a charge or credit for a subscription, this is its ID.
@@ -148,7 +156,7 @@ module Recurly
148
156
 
149
157
  # @!attribute type
150
158
  # @return [String] Charges are positive line items that debit the account. Credits are negative line items that credit the account.
151
- define_attribute :type, String, {:enum => ["charge", "credit"]}
159
+ define_attribute :type, String, { :enum => ["charge", "credit"] }
152
160
 
153
161
  # @!attribute unit_amount
154
162
  # @return [Float] Positive amount for a charge, negative amount for a credit.
@@ -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 Resources
3
7
  class LineItemList < Resource
4
8
 
5
9
  # @!attribute data
6
10
  # @return [Array[LineItem]]
7
- define_attribute :data, Array, {:item_type => :LineItem}
11
+ define_attribute :data, Array, { :item_type => :LineItem }
8
12
 
9
13
  # @!attribute has_more
10
14
  # @return [Boolean] Indicates there are more results on subsequent pages.
@@ -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 Resources
3
7
  class Plan < Resource
@@ -16,27 +20,27 @@ module Recurly
16
20
 
17
21
  # @!attribute [r] created_at
18
22
  # @return [DateTime] Created at
19
- define_attribute :created_at, DateTime, {:read_only => true}
23
+ define_attribute :created_at, DateTime, { :read_only => true }
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 [r] deleted_at
26
30
  # @return [DateTime] Deleted at
27
- define_attribute :deleted_at, DateTime, {:read_only => true}
31
+ define_attribute :deleted_at, DateTime, { :read_only => true }
28
32
 
29
33
  # @!attribute description
30
34
  # @return [String] Optional description, not displayed.
31
35
  define_attribute :description, String
32
36
 
33
37
  # @!attribute hosted_pages
34
- # @return [Hash] Hosted pages settings
35
- define_attribute :hosted_pages, Hash
38
+ # @return [PlanHostedPages] Hosted pages settings
39
+ define_attribute :hosted_pages, :PlanHostedPages
36
40
 
37
41
  # @!attribute [r] id
38
42
  # @return [String] Plan ID
39
- define_attribute :id, String, {:read_only => true}
43
+ define_attribute :id, String, { :read_only => true }
40
44
 
41
45
  # @!attribute interval_length
42
46
  # @return [Integer] Length of the plan's billing interval in `interval_unit`.
@@ -44,7 +48,7 @@ module Recurly
44
48
 
45
49
  # @!attribute interval_unit
46
50
  # @return [String] Unit for the plan's billing interval.
47
- define_attribute :interval_unit, String, {:enum => ["days", "months"]}
51
+ define_attribute :interval_unit, String, { :enum => ["days", "months"] }
48
52
 
49
53
  # @!attribute name
50
54
  # @return [String] This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
@@ -52,7 +56,7 @@ module Recurly
52
56
 
53
57
  # @!attribute [r] object
54
58
  # @return [String] Object type
55
- define_attribute :object, String, {:read_only => true}
59
+ define_attribute :object, String, { :read_only => true }
56
60
 
57
61
  # @!attribute setup_fee_accounting_code
58
62
  # @return [String] Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code.
@@ -60,7 +64,7 @@ module Recurly
60
64
 
61
65
  # @!attribute [r] state
62
66
  # @return [String] The current state of the plan.
63
- define_attribute :state, String, {:read_only => true, :enum => ["active", "inactive"]}
67
+ define_attribute :state, String, { :read_only => true, :enum => ["active", "inactive"] }
64
68
 
65
69
  # @!attribute tax_code
66
70
  # @return [String] Optional field for EU VAT merchants and Avalara AvaTax Pro merchants. If you are using Recurly's EU VAT feature, you can use values of 'unknown', 'physical', or 'digital'. If you have your own AvaTax account configured, you can use Avalara tax codes to assign custom tax rules.
@@ -80,11 +84,11 @@ module Recurly
80
84
 
81
85
  # @!attribute trial_unit
82
86
  # @return [String] Units for the plan's trial period.
83
- define_attribute :trial_unit, String, {:enum => ["days", "months"]}
87
+ define_attribute :trial_unit, String, { :enum => ["days", "months"] }
84
88
 
85
89
  # @!attribute [r] updated_at
86
90
  # @return [DateTime] Last updated at
87
- define_attribute :updated_at, DateTime, {:read_only => true}
91
+ define_attribute :updated_at, DateTime, { :read_only => true }
88
92
  end
89
93
  end
90
94
  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 Resources
7
+ class PlanHostedPages < Resource
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