recurly 2.18.15 → 3.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +14 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +158 -110
  8. data/Rakefile +6 -0
  9. data/bin/bundle +105 -0
  10. data/bin/coderay +29 -0
  11. data/bin/console +14 -0
  12. data/bin/htmldiff +29 -0
  13. data/bin/ldiff +29 -0
  14. data/bin/pry +29 -0
  15. data/bin/rake +29 -0
  16. data/bin/rspec +29 -0
  17. data/bin/setup +8 -0
  18. data/bin/yard +29 -0
  19. data/bin/yardoc +29 -0
  20. data/bin/yri +29 -0
  21. data/lib/data/ca-certificates.crt +31 -0
  22. data/lib/recurly.rb +14 -145
  23. data/lib/recurly/client.rb +198 -0
  24. data/lib/recurly/client/operations.rb +935 -0
  25. data/lib/recurly/errors.rb +34 -0
  26. data/lib/recurly/errors/api_errors.rb +35 -0
  27. data/lib/recurly/errors/network_errors.rb +8 -0
  28. data/lib/recurly/pager.rb +119 -0
  29. data/lib/recurly/request.rb +30 -0
  30. data/lib/recurly/requests/account_acquisition_updatable.rb +22 -0
  31. data/lib/recurly/requests/account_create_only.rb +18 -0
  32. data/lib/recurly/requests/account_updatable.rb +50 -0
  33. data/lib/recurly/requests/add_on_create.rb +38 -0
  34. data/lib/recurly/requests/add_on_update.rb +38 -0
  35. data/lib/recurly/requests/address.rb +42 -0
  36. data/lib/recurly/requests/billing_info_create.rb +58 -0
  37. data/lib/recurly/requests/coupon_create_only.rb +66 -0
  38. data/lib/recurly/requests/coupon_updatable.rb +30 -0
  39. data/lib/recurly/requests/create_account.rb +62 -0
  40. data/lib/recurly/requests/create_coupon.rb +90 -0
  41. data/lib/recurly/requests/invoice_create.rb +42 -0
  42. data/lib/recurly/requests/invoice_refund.rb +30 -0
  43. data/lib/recurly/requests/line_item_create.rb +46 -0
  44. data/lib/recurly/requests/plan_create.rb +66 -0
  45. data/lib/recurly/requests/plan_update.rb +70 -0
  46. data/lib/recurly/requests/shipping_address_create.rb +58 -0
  47. data/lib/recurly/requests/shipping_address_update.rb +62 -0
  48. data/lib/recurly/requests/subscription_add_on_create.rb +22 -0
  49. data/lib/recurly/requests/subscription_change_create.rb +42 -0
  50. data/lib/recurly/requests/subscription_create.rb +86 -0
  51. data/lib/recurly/requests/subscription_update.rb +42 -0
  52. data/lib/recurly/requests/update_coupon.rb +30 -0
  53. data/lib/recurly/resource.rb +16 -1103
  54. data/lib/recurly/resources/account.rb +86 -0
  55. data/lib/recurly/resources/account_acquisition.rb +42 -0
  56. data/lib/recurly/resources/account_balance.rb +22 -0
  57. data/lib/recurly/resources/account_note.rb +30 -0
  58. data/lib/recurly/resources/add_on.rb +62 -0
  59. data/lib/recurly/resources/address.rb +42 -0
  60. data/lib/recurly/resources/billing_info.rb +62 -0
  61. data/lib/recurly/resources/coupon.rb +110 -0
  62. data/lib/recurly/resources/coupon_discount.rb +22 -0
  63. data/lib/recurly/resources/coupon_redemption.rb +46 -0
  64. data/lib/recurly/resources/credit_payment.rb +62 -0
  65. data/lib/recurly/resources/error.rb +18 -0
  66. data/lib/recurly/resources/error_may_have_transaction.rb +22 -0
  67. data/lib/recurly/resources/invoice.rb +138 -0
  68. data/lib/recurly/resources/invoice_collection.rb +18 -0
  69. data/lib/recurly/resources/line_item.rb +166 -0
  70. data/lib/recurly/resources/plan.rb +86 -0
  71. data/lib/recurly/resources/settings.rb +18 -0
  72. data/lib/recurly/resources/shipping_address.rb +74 -0
  73. data/lib/recurly/resources/site.rb +46 -0
  74. data/lib/recurly/resources/subscription.rb +134 -0
  75. data/lib/recurly/resources/subscription_add_on.rb +42 -0
  76. data/lib/recurly/resources/subscription_change.rb +54 -0
  77. data/lib/recurly/resources/tax_info.rb +18 -0
  78. data/lib/recurly/resources/transaction.rb +146 -0
  79. data/lib/recurly/resources/unique_coupon_code.rb +38 -0
  80. data/lib/recurly/resources/user.rb +38 -0
  81. data/lib/recurly/schema.rb +114 -0
  82. data/lib/recurly/schema/json_deserializer.rb +53 -0
  83. data/lib/recurly/schema/json_parser.rb +71 -0
  84. data/lib/recurly/schema/request_caster.rb +66 -0
  85. data/lib/recurly/schema/schema_factory.rb +50 -0
  86. data/lib/recurly/schema/schema_validator.rb +125 -0
  87. data/lib/recurly/version.rb +1 -10
  88. data/recurly.gemspec +32 -0
  89. data/scripts/build +4 -0
  90. data/scripts/clean +6 -0
  91. data/scripts/test +3 -0
  92. metadata +121 -245
  93. data/lib/recurly/account.rb +0 -190
  94. data/lib/recurly/account_acquisition.rb +0 -27
  95. data/lib/recurly/account_balance.rb +0 -21
  96. data/lib/recurly/add_on.rb +0 -44
  97. data/lib/recurly/address.rb +0 -25
  98. data/lib/recurly/adjustment.rb +0 -81
  99. data/lib/recurly/api.rb +0 -110
  100. data/lib/recurly/api/errors.rb +0 -208
  101. data/lib/recurly/api/net_http_adapter.rb +0 -111
  102. data/lib/recurly/billing_info.rb +0 -109
  103. data/lib/recurly/coupon.rb +0 -134
  104. data/lib/recurly/credit_payment.rb +0 -32
  105. data/lib/recurly/custom_field.rb +0 -15
  106. data/lib/recurly/delivery.rb +0 -19
  107. data/lib/recurly/error.rb +0 -13
  108. data/lib/recurly/gift_card.rb +0 -85
  109. data/lib/recurly/helper.rb +0 -51
  110. data/lib/recurly/invoice.rb +0 -297
  111. data/lib/recurly/invoice_collection.rb +0 -14
  112. data/lib/recurly/item.rb +0 -36
  113. data/lib/recurly/js.rb +0 -14
  114. data/lib/recurly/juris_detail.rb +0 -15
  115. data/lib/recurly/measured_unit.rb +0 -16
  116. data/lib/recurly/money.rb +0 -120
  117. data/lib/recurly/note.rb +0 -14
  118. data/lib/recurly/plan.rb +0 -43
  119. data/lib/recurly/purchase.rb +0 -234
  120. data/lib/recurly/redemption.rb +0 -46
  121. data/lib/recurly/resource/association.rb +0 -16
  122. data/lib/recurly/resource/errors.rb +0 -20
  123. data/lib/recurly/resource/pager.rb +0 -313
  124. data/lib/recurly/shipping_address.rb +0 -26
  125. data/lib/recurly/shipping_fee.rb +0 -17
  126. data/lib/recurly/shipping_method.rb +0 -13
  127. data/lib/recurly/subscription.rb +0 -365
  128. data/lib/recurly/subscription/add_ons.rb +0 -82
  129. data/lib/recurly/subscription_add_on.rb +0 -58
  130. data/lib/recurly/tax_detail.rb +0 -16
  131. data/lib/recurly/tax_type.rb +0 -13
  132. data/lib/recurly/tier.rb +0 -18
  133. data/lib/recurly/transaction.rb +0 -131
  134. data/lib/recurly/transaction/errors.rb +0 -115
  135. data/lib/recurly/usage.rb +0 -28
  136. data/lib/recurly/verify.rb +0 -12
  137. data/lib/recurly/webhook.rb +0 -111
  138. data/lib/recurly/webhook/account_notification.rb +0 -13
  139. data/lib/recurly/webhook/billing_info_update_failed_notification.rb +0 -6
  140. data/lib/recurly/webhook/billing_info_updated_notification.rb +0 -6
  141. data/lib/recurly/webhook/canceled_account_notification.rb +0 -6
  142. data/lib/recurly/webhook/canceled_gift_card_notification.rb +0 -6
  143. data/lib/recurly/webhook/canceled_subscription_notification.rb +0 -6
  144. data/lib/recurly/webhook/closed_credit_invoice_notification.rb +0 -6
  145. data/lib/recurly/webhook/closed_invoice_notification.rb +0 -6
  146. data/lib/recurly/webhook/credit_payment_notification.rb +0 -12
  147. data/lib/recurly/webhook/deactivated_item_notification.rb +0 -6
  148. data/lib/recurly/webhook/deleted_shipping_address_notification.rb +0 -6
  149. data/lib/recurly/webhook/dunning_notification.rb +0 -14
  150. data/lib/recurly/webhook/expired_subscription_notification.rb +0 -6
  151. data/lib/recurly/webhook/failed_charge_invoice_notification.rb +0 -6
  152. data/lib/recurly/webhook/failed_payment_notification.rb +0 -6
  153. data/lib/recurly/webhook/fraud_info_updated_notification.rb +0 -6
  154. data/lib/recurly/webhook/gift_card_notification.rb +0 -8
  155. data/lib/recurly/webhook/invoice_notification.rb +0 -12
  156. data/lib/recurly/webhook/item_notification.rb +0 -7
  157. data/lib/recurly/webhook/low_balance_gift_card_notification.rb +0 -6
  158. data/lib/recurly/webhook/new_account_notification.rb +0 -6
  159. data/lib/recurly/webhook/new_charge_invoice_notification.rb +0 -6
  160. data/lib/recurly/webhook/new_credit_invoice_notification.rb +0 -6
  161. data/lib/recurly/webhook/new_credit_payment_notification.rb +0 -6
  162. data/lib/recurly/webhook/new_dunning_event_notification.rb +0 -6
  163. data/lib/recurly/webhook/new_invoice_notification.rb +0 -6
  164. data/lib/recurly/webhook/new_item_notification.rb +0 -6
  165. data/lib/recurly/webhook/new_shipping_address_notification.rb +0 -6
  166. data/lib/recurly/webhook/new_subscription_notification.rb +0 -6
  167. data/lib/recurly/webhook/new_usage_notification.rb +0 -8
  168. data/lib/recurly/webhook/notification.rb +0 -18
  169. data/lib/recurly/webhook/paid_charge_invoice_notification.rb +0 -6
  170. data/lib/recurly/webhook/past_due_charge_invoice_notification.rb +0 -6
  171. data/lib/recurly/webhook/past_due_invoice_notification.rb +0 -6
  172. data/lib/recurly/webhook/paused_subscription_renewal_notification.rb +0 -6
  173. data/lib/recurly/webhook/processing_charge_invoice_notification.rb +0 -6
  174. data/lib/recurly/webhook/processing_credit_invoice_notification.rb +0 -6
  175. data/lib/recurly/webhook/processing_invoice_notification.rb +0 -6
  176. data/lib/recurly/webhook/processing_payment_notification.rb +0 -6
  177. data/lib/recurly/webhook/purchased_gift_card_notification.rb +0 -7
  178. data/lib/recurly/webhook/reactivated_account_notification.rb +0 -6
  179. data/lib/recurly/webhook/reactivated_item_notification.rb +0 -6
  180. data/lib/recurly/webhook/redeemed_gift_card_notification.rb +0 -7
  181. data/lib/recurly/webhook/regenerated_gift_card_notification.rb +0 -6
  182. data/lib/recurly/webhook/renewed_subscription_notification.rb +0 -6
  183. data/lib/recurly/webhook/reopened_charge_invoice_notification.rb +0 -6
  184. data/lib/recurly/webhook/reopened_credit_invoice_notification.rb +0 -6
  185. data/lib/recurly/webhook/scheduled_payment_notification.rb +0 -6
  186. data/lib/recurly/webhook/scheduled_subscription_pause_notification.rb +0 -6
  187. data/lib/recurly/webhook/subscription_notification.rb +0 -12
  188. data/lib/recurly/webhook/subscription_pause_canceled_notification.rb +0 -6
  189. data/lib/recurly/webhook/subscription_pause_modified_notification.rb +0 -6
  190. data/lib/recurly/webhook/subscription_paused_notification.rb +0 -6
  191. data/lib/recurly/webhook/subscription_resumed_notification.rb +0 -6
  192. data/lib/recurly/webhook/successful_payment_notification.rb +0 -6
  193. data/lib/recurly/webhook/successful_refund_notification.rb +0 -6
  194. data/lib/recurly/webhook/transaction_authorized_notification.rb +0 -6
  195. data/lib/recurly/webhook/transaction_notification.rb +0 -12
  196. data/lib/recurly/webhook/transaction_status_updated_notification.rb +0 -6
  197. data/lib/recurly/webhook/updated_account_notification.rb +0 -6
  198. data/lib/recurly/webhook/updated_balance_gift_card_notification.rb +0 -7
  199. data/lib/recurly/webhook/updated_gift_card_notification.rb +0 -6
  200. data/lib/recurly/webhook/updated_invoice_notification.rb +0 -6
  201. data/lib/recurly/webhook/updated_item_notification.rb +0 -6
  202. data/lib/recurly/webhook/updated_shipping_address_notification.rb +0 -6
  203. data/lib/recurly/webhook/updated_subscription_notification.rb +0 -6
  204. data/lib/recurly/webhook/void_payment_notification.rb +0 -6
  205. data/lib/recurly/webhook/voided_credit_invoice_notification.rb +0 -6
  206. data/lib/recurly/webhook/voided_credit_payment_notification.rb +0 -6
  207. data/lib/recurly/xml.rb +0 -122
  208. data/lib/recurly/xml/nokogiri.rb +0 -60
  209. data/lib/recurly/xml/rexml.rb +0 -52
@@ -0,0 +1,66 @@
1
+ require 'date'
2
+
3
+ module Recurly
4
+ class Schema
5
+ # *Note*: This class is for internal use.
6
+ # The RequestCaster turns mixed data into a pure Hash
7
+ # so it can be serialized into JSON and used as the body of a request.
8
+ # This module is to be extended by the Request class.
9
+ module RequestCaster
10
+ # This method casts the data object (of mixed types) into a Hash ready for JSON
11
+ # serialization. The *schema* will default to the self's schema.
12
+ # You should pass in the schema where possible. This is because objects are serialized
13
+ # differently depending on the context in which they are being written.
14
+ #
15
+ # @example
16
+ # Recurly::Requests::AccountUpdatable.cast(account_code: 'benjamin')
17
+ # #=> {:account_code=>"benjamin"}
18
+ # @example
19
+ # # If you have some mixed data, like passing in an Address, it should cast that
20
+ # # address into a Hash based on the Schema defined in AccountUpdatable
21
+ # address = Recurly::Resources::Address.new(city: 'New Orleans')
22
+ # Recurly::Requests::AccountUpdatable.cast(account_code: 'benjamin', address: address)
23
+ # #=> {:account_code=>"benjamin", :address=>{:city=>"New Orleans"}}
24
+ #
25
+ # @param data [Hash,Resource,Request] The data to transform into a JSON Hash.
26
+ # @param schema [Schema] The schema to use to transform the data into a JSON Hash.
27
+ # @return [Hash] The pure Hash ready to be serialized into JSON.
28
+ def cast(data, schema=self.schema)
29
+ casted = {}
30
+ if data.is_a?(Resource) || data.is_a?(Request)
31
+ data = as_json(data, schema)
32
+ end
33
+
34
+ data.each do |k,v|
35
+ schema_attr = schema.get_attribute(k)
36
+ norm_val = if v.respond_to?(:attributes)
37
+ cast(v, schema_attr.recurly_class.schema)
38
+ elsif v.is_a?(Array)
39
+ v.map do |elem|
40
+ if elem.respond_to?(:attributes)
41
+ cast(elem, schema_attr.recurly_class.schema)
42
+ else
43
+ elem
44
+ end
45
+ end
46
+ elsif v.is_a?(Hash) && schema_attr.type.is_a?(Symbol)
47
+ cast(v, schema_attr.recurly_class.schema)
48
+ else
49
+ v
50
+ end
51
+
52
+ casted[k] = norm_val
53
+ end
54
+
55
+ casted
56
+ end
57
+
58
+ private
59
+
60
+ def as_json(resource, schema)
61
+ writeable_attributes = schema.attributes.reject(&:read_only?).map(&:name)
62
+ resource.attributes.select { |k,_| writeable_attributes.include?(k) }
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,50 @@
1
+ module Recurly
2
+ class Schema
3
+ # A mixin that allows a class to be treated like a recurly
4
+ # object. This gives the class the power to describe
5
+ # it's schema. It adds the *define_attribute* method
6
+ # and a *schema* reader.
7
+ module SchemaFactory
8
+
9
+ # Gets the schema for this class
10
+ # @return [Schema]
11
+ def schema
12
+ @schema ||= ::Recurly::Schema.new
13
+ end
14
+
15
+ protected
16
+
17
+ # Macro that allows this class to define it's schema and associated
18
+ # attribute getters and setters.
19
+ #
20
+ # @example
21
+ # class Account
22
+ # extend Schema::SchemaFactory
23
+ # define_attribute :code, String, {:read_only=>true}
24
+ # end
25
+ # account = Account.new(code: "mycode")
26
+ # account.schema
27
+ # #=> Recurly::Schema
28
+ # acount.code = "newcode" # this method protected since read_only = true
29
+ # account.code
30
+ # #=> "mycode"
31
+ def define_attribute(name, type, options={})
32
+ attribute = schema.add_attribute(name, type, options)
33
+
34
+ # Define the reader
35
+ define_method(name) do
36
+ self.attributes[name]
37
+ end
38
+
39
+ # Define the writer
40
+ define_method("#{name}=") do |val|
41
+ self.attributes[name] = val
42
+ end
43
+
44
+ protected "#{name}=" if attribute.read_only?
45
+
46
+ self
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,125 @@
1
+ module Recurly
2
+ class Schema
3
+ # This module is responsible for validating that the raw data
4
+ # passed in to *attributes* matches the schema belonging to this class.
5
+ # It should be mixed in to the Request class.
6
+ module SchemaValidator
7
+ # Validates the attributes and throws an error if something is wrong.
8
+ #
9
+ # @example
10
+ # Recurly::Requests::PlanCreate.new(code: 'plan123').validate!
11
+ # #=> {:code=>"plan123"}
12
+ # @example
13
+ # Recurly::Requests::PlanCreate.new(code: 3.14).validate!
14
+ # #=> ArgumentError: Attribute 'code' on the resource Recurly::Requests::PlanCreate is type Float but should be a String.
15
+ # @example
16
+ # Recurly::Requests::PlanCreate.new(kode: 'plan123').validate!
17
+ # #=> ArgumentError: Attribute 'kode' does not exist on request Recurly::Requests::PlanCreate. Did you mean 'code'?
18
+ #
19
+ # @raise [ArgumentError] if the attribute data does not match the schema.
20
+ def validate!
21
+ attributes.each do |attr_name, val|
22
+ schema_attr = schema.get_attribute(attr_name)
23
+ if schema_attr.nil?
24
+ err_msg = "Attribute '#{attr_name}' does not exist on request #{self.class.name}."
25
+ if did_you_mean = get_did_you_mean(schema, attr_name)
26
+ err_msg << " Did you mean '#{did_you_mean}'?"
27
+ raise ArgumentError, err_msg
28
+ end
29
+ elsif schema_attr.read_only?
30
+ raise ArgumentError, "Attribute '#{attr_name}' on resource #{self.class.name} is not writeable"
31
+ else
32
+ validate_attribute!(schema_attr, val)
33
+ end
34
+ end
35
+ end
36
+
37
+ # Validates an individual attribute
38
+ def validate_attribute!(schema_attr, val)
39
+ if !schema_attr.type.is_a?(Symbol) && val.class != schema_attr.type
40
+ expected = case schema_attr.type
41
+ when Array
42
+ "Array of #{schema_attr.type.item_type}s"
43
+ else
44
+ schema_attr.type
45
+ end
46
+
47
+ raise ArgumentError, "Attribute '#{schema_attr.name}' on the resource #{self.class.name} is type #{val.class} but should be a #{expected}"
48
+ end
49
+
50
+ # This is the convention for a recurly object
51
+ if schema_attr.type.is_a?(Symbol) && val.is_a?(Hash)
52
+ klazz = Schema.get_recurly_class(schema_attr.type)
53
+ # Using send because the initializer may be private
54
+ instance = klazz.send(:new, val)
55
+ instance.validate!
56
+ end
57
+ end
58
+
59
+ # Gets the closest term to the misspelled attribute
60
+ def get_did_you_mean(schema, misspelled_attr)
61
+ closest = schema.attributes.map(&:name).sort_by do |v|
62
+ levenshtein_distance(v, misspelled_attr)
63
+ end.first
64
+
65
+ if closest && levenshtein_distance(closest, misspelled_attr) <= 4
66
+ closest
67
+ end
68
+ end
69
+
70
+ private
71
+
72
+ # This code is copied directly from the did_you mean gem which is based
73
+ # directly on the Text gem implementation.
74
+ #
75
+ # did_you_mean: Copyright (c) 2014-2016 Yuki Nishijima.
76
+ # Text: Copyright (c) 2006-2013 Paul Battley, Michael Neumann, Tim Fletcher.
77
+ #
78
+ # Returns a value representing the "cost" of transforming str1 into str2
79
+ def levenshtein_distance(str1, str2)
80
+ str1 = str1.to_s unless str1.is_a? String
81
+ str2 = str2.to_s unless str2.is_a? String
82
+ n = str1.length
83
+ m = str2.length
84
+ return m if n.zero?
85
+ return n if m.zero?
86
+
87
+ d = (0..m).to_a
88
+ x = nil
89
+
90
+ # to avoid duplicating an enumerable object, create it outside of the loop
91
+ str2_codepoints = str2.codepoints
92
+
93
+ str1.each_codepoint.with_index(1) do |char1, i|
94
+ j = 0
95
+ while j < m
96
+ cost = (char1 == str2_codepoints[j]) ? 0 : 1
97
+ x = min3(
98
+ d[j+1] + 1, # insertion
99
+ i + 1, # deletion
100
+ d[j] + cost # substitution
101
+ )
102
+ d[j] = i
103
+ i = x
104
+
105
+ j += 1
106
+ end
107
+ d[m] = x
108
+ end
109
+
110
+ x
111
+ end
112
+
113
+ def min3(a, b, c)
114
+ if a < b && a < c
115
+ a
116
+ elsif b < c
117
+ b
118
+ else
119
+ c
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+
@@ -1,12 +1,3 @@
1
1
  module Recurly
2
- module Version
3
- VERSION = "2.18.15"
4
-
5
- class << self
6
- def inspect
7
- VERSION.dup
8
- end
9
- alias to_s inspect
10
- end
11
- end
2
+ VERSION = "3.0.0.beta.1"
12
3
  end
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'recurly/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "recurly"
8
+ spec.version = Recurly::VERSION
9
+ spec.authors = ["Recurly"]
10
+ spec.email = ["support@recurly.com"]
11
+
12
+ spec.summary = "The ruby client for Recurly's Partner API"
13
+ spec.description = "The ruby client for Recurly's Partner API"
14
+ spec.homepage = "https://partner-docs.recurly.com"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ # spec.bindir = "exe"
21
+ # spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_dependency "faraday", "~> 0.13"
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.14"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rspec", "~> 3.0"
29
+ spec.add_development_dependency "yard", "~> 0.9"
30
+ spec.add_development_dependency "pry", "~> 0.10"
31
+ spec.add_development_dependency "simplecov", "~> 0.16"
32
+ end
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+
3
+ bundle install --binstubs --quiet
4
+ ./bin/yard --quiet
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+
3
+ rm -f ./lib/recurly/resources/*
4
+ rm -f ./lib/recurly/requests/*
5
+ rm -f ./lib/recurly/errors/api_errors.rb
6
+ rm -f ./lib/recurly/client/operations.rb
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ./bin/rspec
metadata CHANGED
@@ -1,356 +1,232 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.15
4
+ version: 3.0.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-17 00:00:00.000000000 Z
11
+ date: 2018-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: nokogiri
14
+ name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 1.8.2
23
- type: :development
19
+ version: '0.13'
20
+ type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '1.8'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 1.8.2
26
+ version: '0.13'
33
27
  - !ruby/object:Gem::Dependency
34
- name: rake
28
+ name: bundler
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
31
  - - "~>"
38
32
  - !ruby/object:Gem::Version
39
- version: '11.3'
33
+ version: '1.14'
40
34
  type: :development
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
38
  - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: '11.3'
47
- - !ruby/object:Gem::Dependency
48
- name: minitest
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: 5.8.0
54
- - - "~>"
55
- - !ruby/object:Gem::Version
56
- version: '5.8'
57
- type: :development
58
- prerelease: false
59
- version_requirements: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: 5.8.0
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '5.8'
40
+ version: '1.14'
67
41
  - !ruby/object:Gem::Dependency
68
- name: addressable
69
- requirement: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- version: 2.4.0
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '2.4'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: 2.4.0
84
- - - "~>"
85
- - !ruby/object:Gem::Version
86
- version: '2.4'
87
- - !ruby/object:Gem::Dependency
88
- name: webmock
42
+ name: rake
89
43
  requirement: !ruby/object:Gem::Requirement
90
44
  requirements:
91
45
  - - "~>"
92
46
  - !ruby/object:Gem::Version
93
- version: '2.3'
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: 2.3.2
47
+ version: '10.0'
97
48
  type: :development
98
49
  prerelease: false
99
50
  version_requirements: !ruby/object:Gem::Requirement
100
51
  requirements:
101
52
  - - "~>"
102
53
  - !ruby/object:Gem::Version
103
- version: '2.3'
104
- - - ">="
105
- - !ruby/object:Gem::Version
106
- version: 2.3.2
54
+ version: '10.0'
107
55
  - !ruby/object:Gem::Dependency
108
- name: simplecov
56
+ name: rspec
109
57
  requirement: !ruby/object:Gem::Requirement
110
58
  requirements:
111
59
  - - "~>"
112
60
  - !ruby/object:Gem::Version
113
- version: '0'
61
+ version: '3.0'
114
62
  type: :development
115
63
  prerelease: false
116
64
  version_requirements: !ruby/object:Gem::Requirement
117
65
  requirements:
118
66
  - - "~>"
119
67
  - !ruby/object:Gem::Version
120
- version: '0'
68
+ version: '3.0'
121
69
  - !ruby/object:Gem::Dependency
122
70
  name: yard
123
71
  requirement: !ruby/object:Gem::Requirement
124
72
  requirements:
125
73
  - - "~>"
126
74
  - !ruby/object:Gem::Version
127
- version: 0.9.9
75
+ version: '0.9'
128
76
  type: :development
129
77
  prerelease: false
130
78
  version_requirements: !ruby/object:Gem::Requirement
131
79
  requirements:
132
80
  - - "~>"
133
81
  - !ruby/object:Gem::Version
134
- version: 0.9.9
82
+ version: '0.9'
135
83
  - !ruby/object:Gem::Dependency
136
- name: redcarpet
137
- requirement: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- version: 3.4.0
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: '3.4'
145
- type: :development
146
- prerelease: false
147
- version_requirements: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - ">="
150
- - !ruby/object:Gem::Version
151
- version: 3.4.0
152
- - - "~>"
153
- - !ruby/object:Gem::Version
154
- version: '3.4'
155
- - !ruby/object:Gem::Dependency
156
- name: racc
84
+ name: pry
157
85
  requirement: !ruby/object:Gem::Requirement
158
86
  requirements:
159
87
  - - "~>"
160
88
  - !ruby/object:Gem::Version
161
- version: '1'
89
+ version: '0.10'
162
90
  type: :development
163
91
  prerelease: false
164
92
  version_requirements: !ruby/object:Gem::Requirement
165
93
  requirements:
166
94
  - - "~>"
167
95
  - !ruby/object:Gem::Version
168
- version: '1'
96
+ version: '0.10'
169
97
  - !ruby/object:Gem::Dependency
170
- name: pry
171
- requirement: !ruby/object:Gem::Requirement
172
- requirements:
173
- - - ">="
174
- - !ruby/object:Gem::Version
175
- version: 0.9.10
176
- - - "<"
177
- - !ruby/object:Gem::Version
178
- version: 0.11.0
179
- type: :development
180
- prerelease: false
181
- version_requirements: !ruby/object:Gem::Requirement
182
- requirements:
183
- - - ">="
184
- - !ruby/object:Gem::Version
185
- version: 0.9.10
186
- - - "<"
187
- - !ruby/object:Gem::Version
188
- version: 0.11.0
189
- - !ruby/object:Gem::Dependency
190
- name: pry-nav
98
+ name: simplecov
191
99
  requirement: !ruby/object:Gem::Requirement
192
100
  requirements:
193
101
  - - "~>"
194
102
  - !ruby/object:Gem::Version
195
- version: 0.2.4
103
+ version: '0.16'
196
104
  type: :development
197
105
  prerelease: false
198
106
  version_requirements: !ruby/object:Gem::Requirement
199
107
  requirements:
200
108
  - - "~>"
201
109
  - !ruby/object:Gem::Version
202
- version: 0.2.4
203
- description: 'An API client library for Recurly: https://recurly.com'
204
- email: support@recurly.com
110
+ version: '0.16'
111
+ description: The ruby client for Recurly's Partner API
112
+ email:
113
+ - support@recurly.com
205
114
  executables: []
206
115
  extensions: []
207
- extra_rdoc_files:
208
- - README.md
116
+ extra_rdoc_files: []
209
117
  files:
118
+ - ".gitignore"
119
+ - ".rspec"
120
+ - ".travis.yml"
121
+ - Gemfile
122
+ - LICENSE.txt
210
123
  - README.md
124
+ - Rakefile
125
+ - bin/bundle
126
+ - bin/coderay
127
+ - bin/console
128
+ - bin/htmldiff
129
+ - bin/ldiff
130
+ - bin/pry
131
+ - bin/rake
132
+ - bin/rspec
133
+ - bin/setup
134
+ - bin/yard
135
+ - bin/yardoc
136
+ - bin/yri
137
+ - lib/data/ca-certificates.crt
211
138
  - lib/recurly.rb
212
- - lib/recurly/account.rb
213
- - lib/recurly/account_acquisition.rb
214
- - lib/recurly/account_balance.rb
215
- - lib/recurly/add_on.rb
216
- - lib/recurly/address.rb
217
- - lib/recurly/adjustment.rb
218
- - lib/recurly/api.rb
219
- - lib/recurly/api/errors.rb
220
- - lib/recurly/api/net_http_adapter.rb
221
- - lib/recurly/billing_info.rb
222
- - lib/recurly/coupon.rb
223
- - lib/recurly/credit_payment.rb
224
- - lib/recurly/custom_field.rb
225
- - lib/recurly/delivery.rb
226
- - lib/recurly/error.rb
227
- - lib/recurly/gift_card.rb
228
- - lib/recurly/helper.rb
229
- - lib/recurly/invoice.rb
230
- - lib/recurly/invoice_collection.rb
231
- - lib/recurly/item.rb
232
- - lib/recurly/js.rb
233
- - lib/recurly/juris_detail.rb
234
- - lib/recurly/measured_unit.rb
235
- - lib/recurly/money.rb
236
- - lib/recurly/note.rb
237
- - lib/recurly/plan.rb
238
- - lib/recurly/purchase.rb
239
- - lib/recurly/redemption.rb
139
+ - lib/recurly/client.rb
140
+ - lib/recurly/client/operations.rb
141
+ - lib/recurly/errors.rb
142
+ - lib/recurly/errors/api_errors.rb
143
+ - lib/recurly/errors/network_errors.rb
144
+ - lib/recurly/pager.rb
145
+ - lib/recurly/request.rb
146
+ - lib/recurly/requests/account_acquisition_updatable.rb
147
+ - lib/recurly/requests/account_create_only.rb
148
+ - lib/recurly/requests/account_updatable.rb
149
+ - lib/recurly/requests/add_on_create.rb
150
+ - lib/recurly/requests/add_on_update.rb
151
+ - lib/recurly/requests/address.rb
152
+ - lib/recurly/requests/billing_info_create.rb
153
+ - lib/recurly/requests/coupon_create_only.rb
154
+ - lib/recurly/requests/coupon_updatable.rb
155
+ - lib/recurly/requests/create_account.rb
156
+ - lib/recurly/requests/create_coupon.rb
157
+ - lib/recurly/requests/invoice_create.rb
158
+ - lib/recurly/requests/invoice_refund.rb
159
+ - lib/recurly/requests/line_item_create.rb
160
+ - lib/recurly/requests/plan_create.rb
161
+ - lib/recurly/requests/plan_update.rb
162
+ - lib/recurly/requests/shipping_address_create.rb
163
+ - lib/recurly/requests/shipping_address_update.rb
164
+ - lib/recurly/requests/subscription_add_on_create.rb
165
+ - lib/recurly/requests/subscription_change_create.rb
166
+ - lib/recurly/requests/subscription_create.rb
167
+ - lib/recurly/requests/subscription_update.rb
168
+ - lib/recurly/requests/update_coupon.rb
240
169
  - lib/recurly/resource.rb
241
- - lib/recurly/resource/association.rb
242
- - lib/recurly/resource/errors.rb
243
- - lib/recurly/resource/pager.rb
244
- - lib/recurly/shipping_address.rb
245
- - lib/recurly/shipping_fee.rb
246
- - lib/recurly/shipping_method.rb
247
- - lib/recurly/subscription.rb
248
- - lib/recurly/subscription/add_ons.rb
249
- - lib/recurly/subscription_add_on.rb
250
- - lib/recurly/tax_detail.rb
251
- - lib/recurly/tax_type.rb
252
- - lib/recurly/tier.rb
253
- - lib/recurly/transaction.rb
254
- - lib/recurly/transaction/errors.rb
255
- - lib/recurly/usage.rb
256
- - lib/recurly/verify.rb
170
+ - lib/recurly/resources/account.rb
171
+ - lib/recurly/resources/account_acquisition.rb
172
+ - lib/recurly/resources/account_balance.rb
173
+ - lib/recurly/resources/account_note.rb
174
+ - lib/recurly/resources/add_on.rb
175
+ - lib/recurly/resources/address.rb
176
+ - lib/recurly/resources/billing_info.rb
177
+ - lib/recurly/resources/coupon.rb
178
+ - lib/recurly/resources/coupon_discount.rb
179
+ - lib/recurly/resources/coupon_redemption.rb
180
+ - lib/recurly/resources/credit_payment.rb
181
+ - lib/recurly/resources/error.rb
182
+ - lib/recurly/resources/error_may_have_transaction.rb
183
+ - lib/recurly/resources/invoice.rb
184
+ - lib/recurly/resources/invoice_collection.rb
185
+ - lib/recurly/resources/line_item.rb
186
+ - lib/recurly/resources/plan.rb
187
+ - lib/recurly/resources/settings.rb
188
+ - lib/recurly/resources/shipping_address.rb
189
+ - lib/recurly/resources/site.rb
190
+ - lib/recurly/resources/subscription.rb
191
+ - lib/recurly/resources/subscription_add_on.rb
192
+ - lib/recurly/resources/subscription_change.rb
193
+ - lib/recurly/resources/tax_info.rb
194
+ - lib/recurly/resources/transaction.rb
195
+ - lib/recurly/resources/unique_coupon_code.rb
196
+ - lib/recurly/resources/user.rb
197
+ - lib/recurly/schema.rb
198
+ - lib/recurly/schema/json_deserializer.rb
199
+ - lib/recurly/schema/json_parser.rb
200
+ - lib/recurly/schema/request_caster.rb
201
+ - lib/recurly/schema/schema_factory.rb
202
+ - lib/recurly/schema/schema_validator.rb
257
203
  - lib/recurly/version.rb
258
- - lib/recurly/webhook.rb
259
- - lib/recurly/webhook/account_notification.rb
260
- - lib/recurly/webhook/billing_info_update_failed_notification.rb
261
- - lib/recurly/webhook/billing_info_updated_notification.rb
262
- - lib/recurly/webhook/canceled_account_notification.rb
263
- - lib/recurly/webhook/canceled_gift_card_notification.rb
264
- - lib/recurly/webhook/canceled_subscription_notification.rb
265
- - lib/recurly/webhook/closed_credit_invoice_notification.rb
266
- - lib/recurly/webhook/closed_invoice_notification.rb
267
- - lib/recurly/webhook/credit_payment_notification.rb
268
- - lib/recurly/webhook/deactivated_item_notification.rb
269
- - lib/recurly/webhook/deleted_shipping_address_notification.rb
270
- - lib/recurly/webhook/dunning_notification.rb
271
- - lib/recurly/webhook/expired_subscription_notification.rb
272
- - lib/recurly/webhook/failed_charge_invoice_notification.rb
273
- - lib/recurly/webhook/failed_payment_notification.rb
274
- - lib/recurly/webhook/fraud_info_updated_notification.rb
275
- - lib/recurly/webhook/gift_card_notification.rb
276
- - lib/recurly/webhook/invoice_notification.rb
277
- - lib/recurly/webhook/item_notification.rb
278
- - lib/recurly/webhook/low_balance_gift_card_notification.rb
279
- - lib/recurly/webhook/new_account_notification.rb
280
- - lib/recurly/webhook/new_charge_invoice_notification.rb
281
- - lib/recurly/webhook/new_credit_invoice_notification.rb
282
- - lib/recurly/webhook/new_credit_payment_notification.rb
283
- - lib/recurly/webhook/new_dunning_event_notification.rb
284
- - lib/recurly/webhook/new_invoice_notification.rb
285
- - lib/recurly/webhook/new_item_notification.rb
286
- - lib/recurly/webhook/new_shipping_address_notification.rb
287
- - lib/recurly/webhook/new_subscription_notification.rb
288
- - lib/recurly/webhook/new_usage_notification.rb
289
- - lib/recurly/webhook/notification.rb
290
- - lib/recurly/webhook/paid_charge_invoice_notification.rb
291
- - lib/recurly/webhook/past_due_charge_invoice_notification.rb
292
- - lib/recurly/webhook/past_due_invoice_notification.rb
293
- - lib/recurly/webhook/paused_subscription_renewal_notification.rb
294
- - lib/recurly/webhook/processing_charge_invoice_notification.rb
295
- - lib/recurly/webhook/processing_credit_invoice_notification.rb
296
- - lib/recurly/webhook/processing_invoice_notification.rb
297
- - lib/recurly/webhook/processing_payment_notification.rb
298
- - lib/recurly/webhook/purchased_gift_card_notification.rb
299
- - lib/recurly/webhook/reactivated_account_notification.rb
300
- - lib/recurly/webhook/reactivated_item_notification.rb
301
- - lib/recurly/webhook/redeemed_gift_card_notification.rb
302
- - lib/recurly/webhook/regenerated_gift_card_notification.rb
303
- - lib/recurly/webhook/renewed_subscription_notification.rb
304
- - lib/recurly/webhook/reopened_charge_invoice_notification.rb
305
- - lib/recurly/webhook/reopened_credit_invoice_notification.rb
306
- - lib/recurly/webhook/scheduled_payment_notification.rb
307
- - lib/recurly/webhook/scheduled_subscription_pause_notification.rb
308
- - lib/recurly/webhook/subscription_notification.rb
309
- - lib/recurly/webhook/subscription_pause_canceled_notification.rb
310
- - lib/recurly/webhook/subscription_pause_modified_notification.rb
311
- - lib/recurly/webhook/subscription_paused_notification.rb
312
- - lib/recurly/webhook/subscription_resumed_notification.rb
313
- - lib/recurly/webhook/successful_payment_notification.rb
314
- - lib/recurly/webhook/successful_refund_notification.rb
315
- - lib/recurly/webhook/transaction_authorized_notification.rb
316
- - lib/recurly/webhook/transaction_notification.rb
317
- - lib/recurly/webhook/transaction_status_updated_notification.rb
318
- - lib/recurly/webhook/updated_account_notification.rb
319
- - lib/recurly/webhook/updated_balance_gift_card_notification.rb
320
- - lib/recurly/webhook/updated_gift_card_notification.rb
321
- - lib/recurly/webhook/updated_invoice_notification.rb
322
- - lib/recurly/webhook/updated_item_notification.rb
323
- - lib/recurly/webhook/updated_shipping_address_notification.rb
324
- - lib/recurly/webhook/updated_subscription_notification.rb
325
- - lib/recurly/webhook/void_payment_notification.rb
326
- - lib/recurly/webhook/voided_credit_invoice_notification.rb
327
- - lib/recurly/webhook/voided_credit_payment_notification.rb
328
- - lib/recurly/xml.rb
329
- - lib/recurly/xml/nokogiri.rb
330
- - lib/recurly/xml/rexml.rb
331
- homepage: https://github.com/recurly/recurly-client-ruby
204
+ - recurly.gemspec
205
+ - scripts/build
206
+ - scripts/clean
207
+ - scripts/test
208
+ homepage: https://partner-docs.recurly.com
332
209
  licenses:
333
210
  - MIT
334
211
  metadata: {}
335
212
  post_install_message:
336
- rdoc_options:
337
- - "--main"
338
- - README.md
213
+ rdoc_options: []
339
214
  require_paths:
340
215
  - lib
341
216
  required_ruby_version: !ruby/object:Gem::Requirement
342
217
  requirements:
343
218
  - - ">="
344
219
  - !ruby/object:Gem::Version
345
- version: 1.9.3
220
+ version: '0'
346
221
  required_rubygems_version: !ruby/object:Gem::Requirement
347
222
  requirements:
348
- - - ">="
223
+ - - ">"
349
224
  - !ruby/object:Gem::Version
350
- version: '0'
225
+ version: 1.3.1
351
226
  requirements: []
352
- rubygems_version: 3.0.3
227
+ rubyforge_project:
228
+ rubygems_version: 2.7.6
353
229
  signing_key:
354
230
  specification_version: 4
355
- summary: Recurly API Client
231
+ summary: The ruby client for Recurly's Partner API
356
232
  test_files: []