recurly 2.7.1 → 2.7.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of recurly might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/recurly.rb +1 -0
- data/lib/recurly/account.rb +1 -0
- data/lib/recurly/api.rb +1 -1
- data/lib/recurly/helper.rb +4 -1
- data/lib/recurly/invoice.rb +3 -0
- data/lib/recurly/redemption.rb +1 -0
- data/lib/recurly/resource.rb +14 -4
- data/lib/recurly/shipping_address.rb +20 -0
- data/lib/recurly/subscription.rb +4 -0
- data/lib/recurly/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7482bc37f691fb0ec0e3994eb35afdd158e6eda4
|
4
|
+
data.tar.gz: d1e17655dbc980c1b9395e0a68ffdb3affd928a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3738606dbbc8983110f80991432dda663a429c88c070a12d3bd6ce7cca40360d060b82c01d30945d331ca791e1c6be8e36b647d5a14aa41f318b4b9811120f90
|
7
|
+
data.tar.gz: 92f45cbe76ca5f3efa8b37aed9bfa1154586af2d28f7e6f2dd7ea7cc038098ccd63a97568622032db2ab5654b7e24cdf2d76504d294437a8e7a26fc056e9fa5c
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Recurly is packaged as a Ruby gem. We recommend you install it with
|
|
12
12
|
[Bundler](http://gembundler.com/) by adding the following line to your Gemfile:
|
13
13
|
|
14
14
|
``` ruby
|
15
|
-
gem 'recurly', '~> 2.7.
|
15
|
+
gem 'recurly', '~> 2.7.2'
|
16
16
|
```
|
17
17
|
|
18
18
|
Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
|
data/lib/recurly.rb
CHANGED
data/lib/recurly/account.rb
CHANGED
data/lib/recurly/api.rb
CHANGED
data/lib/recurly/helper.rb
CHANGED
@@ -17,7 +17,10 @@ module Recurly
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def singularize word
|
20
|
-
word.to_s
|
20
|
+
word = word.to_s
|
21
|
+
return "shipping_address" if word == "shipping_address"
|
22
|
+
return "shipping_address" if word == "shipping_addresses"
|
23
|
+
word.sub(/s$/, '').sub(/ie$/, 'y')
|
21
24
|
end
|
22
25
|
|
23
26
|
def underscore camel_cased_word
|
data/lib/recurly/invoice.rb
CHANGED
data/lib/recurly/redemption.rb
CHANGED
data/lib/recurly/resource.rb
CHANGED
@@ -485,7 +485,7 @@ module Recurly
|
|
485
485
|
# @param collection_name [Symbol] Association name.
|
486
486
|
# @param options [Hash] A hash of association options.
|
487
487
|
# @option options [true, false] :readonly Don't define a setter.
|
488
|
-
# [String] :
|
488
|
+
# [String] :resource_class Actual associated resource class name
|
489
489
|
# if not same as collection_name.
|
490
490
|
def has_many collection_name, options = {}
|
491
491
|
associations << Association.new(:has_many, collection_name.to_s, options)
|
@@ -511,7 +511,7 @@ module Recurly
|
|
511
511
|
# @param member_name [Symbol] Association name.
|
512
512
|
# @param options [Hash] A hash of association options.
|
513
513
|
# @option options [true, false] :readonly Don't define a setter.
|
514
|
-
# [String] :
|
514
|
+
# [String] :resource_class Actual associated resource class name
|
515
515
|
# if not same as member_name.
|
516
516
|
def has_one member_name, options = {}
|
517
517
|
associations << Association.new(:has_one, member_name.to_s, options)
|
@@ -549,7 +549,7 @@ module Recurly
|
|
549
549
|
# @param parent_name [Symbol] Association name.
|
550
550
|
# @param options [Hash] A hash of association options.
|
551
551
|
# @option options [true, false] :readonly Don't define a setter.
|
552
|
-
# [String] :
|
552
|
+
# [String] :resource_class Actual associated resource class name
|
553
553
|
# if not same as parent_name.
|
554
554
|
def belongs_to parent_name, options = {}
|
555
555
|
associations << Association.new(:belongs_to, parent_name.to_s, options)
|
@@ -783,7 +783,17 @@ module Recurly
|
|
783
783
|
when Resource, Subscription::AddOns
|
784
784
|
value.to_xml options.merge(:builder => node)
|
785
785
|
when Array
|
786
|
-
value.each
|
786
|
+
value.each do |e|
|
787
|
+
if e.is_a? Recurly::Resource
|
788
|
+
# create a node to hold this resource
|
789
|
+
e_node = node.add_element Helper.singularize(key)
|
790
|
+
# serialize the resource into this node
|
791
|
+
e.to_xml(options.merge(builder: e_node))
|
792
|
+
else
|
793
|
+
# it's just a primitive value
|
794
|
+
node.add_element(Helper.singularize(key), e)
|
795
|
+
end
|
796
|
+
end
|
787
797
|
when Hash, Recurly::Money
|
788
798
|
value.each_pair { |k, v| node.add_element k.to_s, v }
|
789
799
|
else
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Recurly
|
2
|
+
class ShippingAddress < Resource
|
3
|
+
define_attribute_methods %w(
|
4
|
+
id
|
5
|
+
address1
|
6
|
+
address2
|
7
|
+
first_name
|
8
|
+
last_name
|
9
|
+
city
|
10
|
+
state
|
11
|
+
zip
|
12
|
+
country
|
13
|
+
phone
|
14
|
+
nickname
|
15
|
+
company
|
16
|
+
email
|
17
|
+
)
|
18
|
+
alias to_param address1
|
19
|
+
end
|
20
|
+
end
|
data/lib/recurly/subscription.rb
CHANGED
@@ -28,6 +28,9 @@ module Recurly
|
|
28
28
|
# @return [Redemption]
|
29
29
|
has_many :redemptions
|
30
30
|
|
31
|
+
# return [ShippingAddress]
|
32
|
+
has_one :shipping_address, resource_class: :ShippingAddress, readonly: false
|
33
|
+
|
31
34
|
define_attribute_methods %w(
|
32
35
|
uuid
|
33
36
|
state
|
@@ -63,6 +66,7 @@ module Recurly
|
|
63
66
|
vat_reverse_charge_notes
|
64
67
|
address
|
65
68
|
revenue_schedule_type
|
69
|
+
shipping_address_id
|
66
70
|
)
|
67
71
|
alias to_param uuid
|
68
72
|
|
data/lib/recurly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recurly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recurly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- lib/recurly/resource/errors.rb
|
87
87
|
- lib/recurly/resource/pager.rb
|
88
88
|
- lib/recurly/resource.rb
|
89
|
+
- lib/recurly/shipping_address.rb
|
89
90
|
- lib/recurly/subscription/add_ons.rb
|
90
91
|
- lib/recurly/subscription.rb
|
91
92
|
- lib/recurly/subscription_add_on.rb
|