recurly 2.3.6 → 2.3.7
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 +13 -1
- data/lib/rails/generators/recurly/config_generator.rb +3 -0
- data/lib/recurly/account.rb +2 -2
- data/lib/recurly/add_on.rb +1 -0
- data/lib/recurly/adjustment.rb +1 -0
- data/lib/recurly/invoice.rb +11 -0
- data/lib/recurly/js.rb +9 -0
- data/lib/recurly/plan.rb +1 -0
- data/lib/recurly/subscription.rb +2 -0
- data/lib/recurly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fab7cd65c0fd2456296451577b84c9d5d3764c1
|
4
|
+
data.tar.gz: 422ff98f05b53e9eaab0de391c13508f27398ad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dc46eadbd249450bd184304bc2c772d0a7485258a4f45f4f569da014abda53c058a596110861eea9502ca4bb390f607df92a0697c24013bee6623957e9b8558
|
7
|
+
data.tar.gz: 73795704534874b8a4295ac6588e1e0b1295ad3f6e8c540fa7e755107edd164aa7512583d0f9b434977a6ec98a0ec89ea41c540231cac6137f335a656edf8d11
|
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.3.
|
15
|
+
gem 'recurly', '~> 2.3.7'
|
16
16
|
```
|
17
17
|
|
18
18
|
Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
|
@@ -47,6 +47,18 @@ The default currency is USD. To override with a different code:
|
|
47
47
|
Recurly.default_currency = 'EUR' # Assign nil to disable the default entirely.
|
48
48
|
```
|
49
49
|
|
50
|
+
If you are using [Recurly.js](https://js.recurly.com) you can store "Public API Key" (which can be found under "API Credentials" on the `api_access` admin page):
|
51
|
+
|
52
|
+
``` ruby
|
53
|
+
Recurly.js.public_key = ENV['RECURLY_PUBLIC_API_KEY']
|
54
|
+
```
|
55
|
+
|
56
|
+
Then, in your Rails project you can create `recurly_service.js.erb` file and [configure](https://docs.recurly.com/js/#configure) recurly.js with public key this way:
|
57
|
+
|
58
|
+
``` js
|
59
|
+
recurly.configure({ publicKey: '<%= Recurly.js.public_key %>'});
|
60
|
+
```
|
61
|
+
|
50
62
|
The client library currently uses a Net::HTTP adapter. If you need to
|
51
63
|
configure the settings passed to Net::HTTP (e.g., an SSL certificates path),
|
52
64
|
make sure you assign them before you make any requests:
|
@@ -16,6 +16,9 @@ Recurly.api_key = ENV['RECURLY_API_KEY']
|
|
16
16
|
# Optional (if you want to change the default currency from USD)
|
17
17
|
# Recurly.default_currency = 'USD'
|
18
18
|
|
19
|
+
# Optional (if you want to use Recurly.js you can store public_key here)
|
20
|
+
# Recurly.js.public_key = ENV['RECURLY_PUBLIC_API_KEY']
|
21
|
+
|
19
22
|
EOF
|
20
23
|
end
|
21
24
|
end
|
data/lib/recurly/account.rb
CHANGED
@@ -43,8 +43,8 @@ module Recurly
|
|
43
43
|
|
44
44
|
# @return [Invoice] A newly-created invoice.
|
45
45
|
# @raise [Invalid] Raised if the account cannot be invoiced.
|
46
|
-
def invoice!
|
47
|
-
Invoice.from_response API.post(invoices.uri)
|
46
|
+
def invoice!(attrs={})
|
47
|
+
Invoice.from_response API.post(invoices.uri, attrs.empty? ? nil : Invoice.to_xml(attrs))
|
48
48
|
rescue Recurly::API::UnprocessableEntity => e
|
49
49
|
raise Invalid, e.message
|
50
50
|
end
|
data/lib/recurly/add_on.rb
CHANGED
data/lib/recurly/adjustment.rb
CHANGED
data/lib/recurly/invoice.rb
CHANGED
@@ -38,9 +38,16 @@ module Recurly
|
|
38
38
|
amount_remaining_in_cents
|
39
39
|
line_items
|
40
40
|
transactions
|
41
|
+
terms_and_conditions
|
42
|
+
customer_notes
|
41
43
|
)
|
42
44
|
alias to_param invoice_number
|
43
45
|
|
46
|
+
def self.to_xml(attrs)
|
47
|
+
invoice = new attrs
|
48
|
+
invoice.to_xml
|
49
|
+
end
|
50
|
+
|
44
51
|
# Marks an invoice as paid successfully.
|
45
52
|
#
|
46
53
|
# @return [true, false] +true+ when successful, +false+ when unable to
|
@@ -93,6 +100,10 @@ module Recurly
|
|
93
100
|
refund
|
94
101
|
end
|
95
102
|
|
103
|
+
def xml_keys
|
104
|
+
super - ['currency']
|
105
|
+
end
|
106
|
+
|
96
107
|
private
|
97
108
|
|
98
109
|
def initialize attributes = {}
|
data/lib/recurly/js.rb
CHANGED
@@ -24,6 +24,15 @@ module Recurly
|
|
24
24
|
end
|
25
25
|
attr_writer :private_key
|
26
26
|
|
27
|
+
# @return [String] A public key for Recurly.js.
|
28
|
+
# @raise [ConfigurationError] No public key has been set.
|
29
|
+
def public_key
|
30
|
+
defined? @public_key and @public_key or raise(
|
31
|
+
ConfigurationError, "public_key not configured"
|
32
|
+
)
|
33
|
+
end
|
34
|
+
attr_writer :public_key
|
35
|
+
|
27
36
|
# Create a signature for a given hash for Recurly.js
|
28
37
|
# @param Array of objects and hash of data to sign
|
29
38
|
def sign *records
|
data/lib/recurly/plan.rb
CHANGED
data/lib/recurly/subscription.rb
CHANGED
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.3.
|
4
|
+
version: 2.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recurly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|