active_paypal_adaptive_payment 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,8 +14,9 @@ module ActiveMerchant
14
14
  test? ? test_redirect_url : live_redirect_url
15
15
  end
16
16
 
17
+ # TODO: validate the token presence
17
18
  def redirect_url_for(token)
18
- redirect_url + token
19
+ "#{redirect_url}#{token}"
19
20
  end
20
21
 
21
22
  def redirect_pre_approval_url
@@ -23,7 +24,7 @@ module ActiveMerchant
23
24
  end
24
25
 
25
26
  def redirect_pre_approval_url_for(token)
26
- redirect_pre_approval_url + token
27
+ "#{redirect_pre_approval_url}#{token}"
27
28
  end
28
29
 
29
30
  end
@@ -1,10 +1,42 @@
1
- # fix for case sensitive headers in paypal (issue #1)
2
- module Net; module HTTPHeader
3
- def []= key, val
4
- unless val
5
- @header.delete key
6
- return val
1
+ # -*- encoding: utf-8 -*-
2
+ # https://github.com/tallgreentree/rash/blob/master/lib/hashie/rash.rb
3
+
4
+ require 'hashie/mash'
5
+
6
+ module Hashie
7
+ class Rash < Mash
8
+
9
+ protected
10
+
11
+ def convert_key(key)
12
+ underscore_string(key.to_s)
13
+ end
14
+
15
+ # converts a camel_cased string to a underscore string
16
+ # subs spaces with underscores, strips whitespace
17
+ # Same way ActiveSupport does string.underscore
18
+ def underscore_string(str)
19
+ str.to_s.strip.
20
+ gsub(' ', '_').
21
+ gsub(/::/, '/').
22
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
23
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
24
+ tr("-", "_").
25
+ squeeze("_").
26
+ downcase
27
+ end
28
+
29
+ end
30
+ end
31
+
32
+ module Net
33
+ module HTTPHeader
34
+ def []= key, val
35
+ unless val
36
+ @header.delete key
37
+ return val
38
+ end
39
+ @header[key] = [val]
7
40
  end
8
- @header[key] = [val]
9
41
  end
10
- end; end
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_paypal_adaptive_payment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemerchant
16
- requirement: &13666840 !ruby/object:Gem::Requirement
16
+ requirement: &19405340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.5.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13666840
24
+ version_requirements: *19405340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: multi_json
27
- requirement: &13666260 !ruby/object:Gem::Requirement
27
+ requirement: &19404680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,21 +32,21 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *13666260
35
+ version_requirements: *19404680
36
36
  - !ruby/object:Gem::Dependency
37
- name: rash
38
- requirement: &13665520 !ruby/object:Gem::Requirement
37
+ name: hashie
38
+ requirement: &19403760 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
42
42
  - !ruby/object:Gem::Version
43
- version: 0.3.0
43
+ version: 1.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *13665520
46
+ version_requirements: *19403760
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: money
49
- requirement: &13664660 !ruby/object:Gem::Requirement
49
+ requirement: &19403100 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 3.6.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *13664660
57
+ version_requirements: *19403100
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mocha
60
- requirement: &13663900 !ruby/object:Gem::Requirement
60
+ requirement: &19402360 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 0.10.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *13663900
68
+ version_requirements: *19402360
69
69
  description: ! ' This library is meant to interface with PayPal''s Adaptive Payment
70
70
  Gateway.
71
71