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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 615971adab741e3ada83a3ab5d5dc00552a651eb
4
- data.tar.gz: 7c25904c92d18fcd7b4ec580c02b7e03e6a5803c
3
+ metadata.gz: 3fab7cd65c0fd2456296451577b84c9d5d3764c1
4
+ data.tar.gz: 422ff98f05b53e9eaab0de391c13508f27398ad9
5
5
  SHA512:
6
- metadata.gz: 8be25bb57334058861bfa5ca01f2049cc311f7bc5e39545679214eb1c33fabe8484219cd6378c8978fec260befd6625e46ee766c88d579c66ca0c828f40ca3dc
7
- data.tar.gz: 6cf9096016733377b9fb59ba7041945cdd763638add7827924a74904a82f94ffbda1887fafb5bb83a244856b16a61ff998698bd8326b731f324fa9a3901f1995
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.6'
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
@@ -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
@@ -9,6 +9,7 @@ module Recurly
9
9
  default_quantity
10
10
  unit_amount_in_cents
11
11
  display_quantity_on_hosted_page
12
+ tax_code
12
13
  created_at
13
14
  )
14
15
  alias to_param add_on_code
@@ -29,6 +29,7 @@ module Recurly
29
29
  total_in_cents
30
30
  currency
31
31
  tax_exempt
32
+ tax_code
32
33
  tax_details
33
34
  product_code
34
35
  start_date
@@ -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
@@ -25,6 +25,7 @@ module Recurly
25
25
  total_billing_cycles
26
26
  accounting_code
27
27
  tax_exempt
28
+ tax_code
28
29
  created_at
29
30
  )
30
31
  alias to_param plan_code
@@ -51,6 +51,8 @@ module Recurly
51
51
  tax_type
52
52
  tax_rate
53
53
  bulk
54
+ terms_and_conditions
55
+ customer_notes
54
56
  )
55
57
  alias to_param uuid
56
58
 
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 3
5
- PATCH = 6
5
+ PATCH = 7
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
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.6
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-06 00:00:00.000000000 Z
11
+ date: 2014-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake