apruve 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- apruve (0.0.1)
4
+ apruve (0.9.1)
5
5
  addressable (~> 2.3.5)
6
6
  faraday (>= 0.8.6, <= 0.9.0)
7
7
  faraday_middleware (~> 0.9.0)
data/LICENSE.txt CHANGED
@@ -1,22 +1,21 @@
1
- Copyright (c) 2014 Neal Tovsen
1
+ The MIT License (MIT)
2
2
 
3
- MIT License
3
+ Copyright (c) 2014, Apruve
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
12
11
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
15
14
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  module Apruve
2
2
  class LineItem < Apruve::ApruveObject
3
- attr_accessor :id, :title, :amount_cents, :price_ea_cents, :quantity, :description,
3
+ attr_accessor :id, :title, :amount_cents, :price_ea_cents, :quantity, :description, :merchant_notes,
4
4
  :variant_info, :sku, :vendor, :view_product_url, :plan_code, :line_item_api_url,
5
5
  :subscription_url
6
6
 
@@ -1,6 +1,6 @@
1
1
  module Apruve
2
2
  class PaymentRequest < Apruve::ApruveObject
3
- attr_accessor :id, :merchant_id, :merchant_order_id, :status, :amount_cents, :tax_cents,
3
+ attr_accessor :id, :merchant_id, :merchant_order_id, :status, :amount_cents, :currency, :tax_cents,
4
4
  :shipping_cents, :line_items, :api_url, :view_url, :created_at, :updated_at
5
5
 
6
6
  def self.find(id)
@@ -36,18 +36,17 @@ module Apruve
36
36
  end
37
37
 
38
38
  def value_string
39
- token_string = to_hash.map do |k, v|
40
- str = ''
41
- if v.kind_of?(Array)
42
- v.each do |item|
43
- str = str + item.map{|q,r| r}.join
44
- end
45
- else
46
- str = v
47
- end
48
- str
39
+ # add each field in the PR
40
+ str = "#{self.merchant_id}#{self.merchant_order_id}#{self.amount_cents}#{self.currency}#{self.tax_cents}#{self.shipping_cents}"
41
+
42
+ # add the line items
43
+ self.line_items.each do |item|
44
+ str += "#{item.title}#{item.plan_code}#{item.amount_cents}#{item.price_ea_cents}"\
45
+ "#{item.quantity}#{item.merchant_notes}#{item.description}#{item.variant_info}#{item.sku}"\
46
+ "#{item.vendor}#{item.view_product_url}"
49
47
  end
50
- token_string.join
48
+
49
+ str
51
50
  end
52
51
 
53
52
  def secure_hash
@@ -1,3 +1,3 @@
1
1
  module Apruve
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apruve
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-12 00:00:00.000000000 Z
13
+ date: 2014-05-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler