paypal_adaptive 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YWQ2Y2UzMTAzNWQzZmRjYWZjOGE0MTIwNjNlMzc0ZjYzNWVmMGU1MA==
5
- data.tar.gz: !binary |-
6
- MzM5YTU4ZjMxMmVhYjYwMjk4NzUyYjJmMzdiYTM4MTc0YjRkYjY1Zg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OTRhZDRkN2FjOWJmNjY1YTAyMjk1Yzg3ZmY5ODljYjAwMWIzZDk1ZjQwMzkw
10
- NDBiNWIxOTNhZTdkODcxZTJmNDllZTAxOTA2MTY3OTNmMWIzNDFmMzdjYTg0
11
- NWRhZWU3N2U3OGYyMGJiNWQ0MTI5MGFiYzVjMWU0NzBmMjkxMzg=
12
- data.tar.gz: !binary |-
13
- ZDM3ODVmMmUzZjMxZmQ5NGIxOTllODI4MGY5MGI5MTEwM2EzYjVlZjk3NzVk
14
- ZDBkOWUwZjA1NGQ1NzU5N2EyZjIwMWY5OWM0MWY3MWU3MDRmYjJhMzYwNWFm
15
- MTc5ZDVmM2ViOWYyM2IzYzlmYjIwMmRkZjNhOTdkNjAyOTViYWE=
2
+ SHA1:
3
+ metadata.gz: 8be795a9bda43b0b00f0930915b83bb46093b8e3
4
+ data.tar.gz: e2abd17fe117914c901d42c88a23b166c696c2f4
5
+ SHA512:
6
+ metadata.gz: 389ad935ed21184ad7f4f4d103dbe071330cfcbde4f4a1b2b8ddde982ac767a26d0bf9f1a346d042d82acb92a0d7b39fc509fe479c78c6d150532098c3a9634f
7
+ data.tar.gz: 11a2d869ecb05b441960575eba5e3eaa4e1054b74523b7141e43d6211708a898b2676cf9f82a4fba573c417a150c4da1e026360eb3c2e4b95e1247dbfe66598b
@@ -96,6 +96,9 @@ for each environment, e.g.:
96
96
  The api_cert_file should point to your cert_key_pem.txt that is downloaded through the paypal developer interface. It will contain a section that specifies the RSA private key and another section that specifies a certificate. If this is left empty, paypal_adaptive will attempt to use the signature method of validation with PayPal, so your signature config must not be nil.
97
97
 
98
98
  ## Changelog
99
+ 0.3.7
100
+ Fix IPN under Ruby 2.0. thanks @rchekaluk
101
+
99
102
  0.3.6
100
103
  Include more details in error in case the HTTP request doesn't return. thanks mreinsch
101
104
 
@@ -1,6 +1,7 @@
1
1
  require 'net/http'
2
2
  require 'net/https'
3
3
  require 'json'
4
+ require 'rack/utils'
4
5
 
5
6
  module PaypalAdaptive
6
7
  class IpnNotification
@@ -16,7 +17,8 @@ module PaypalAdaptive
16
17
 
17
18
  def send_back(data)
18
19
  data = "cmd=_notify-validate&#{data}"
19
- url = URI.parse @paypal_base_url
20
+ path = "#{@paypal_base_url}/cgi-bin/webscr"
21
+ url = URI.parse path
20
22
  http = Net::HTTP.new(url.host, 443)
21
23
  http.use_ssl = true
22
24
  http.verify_mode = @verify_mode
@@ -30,8 +32,10 @@ module PaypalAdaptive
30
32
  http.ca_path = @ssl_cert_path unless @ssl_cert_path.blank?
31
33
  http.ca_file = @ssl_cert_file unless @ssl_cert_file.blank?
32
34
 
33
- path = "#{@paypal_base_url}/cgi-bin/webscr"
34
- response_data = http.post(path, data).body
35
+ req = Net::HTTP::Post.new(url.request_uri)
36
+ req.set_form_data(Rack::Utils.parse_nested_query(data))
37
+ req['Accept-Encoding'] = 'identity'
38
+ response_data = http.request(req).body
35
39
 
36
40
  @verified = response_data == "VERIFIED"
37
41
  end
@@ -74,6 +74,10 @@ module PaypalAdaptive
74
74
  def get_verified_status(data)
75
75
  wrap_post(data, "/AdaptiveAccounts/GetVerifiedStatus")
76
76
  end
77
+
78
+ def get_funding_plans(data)
79
+ wrap_post(data, "/AdaptivePayments/GetFundingPlans")
80
+ end
77
81
 
78
82
  def wrap_post(data, path)
79
83
  raise NoDataError unless data
@@ -1,4 +1,4 @@
1
1
  module PaypalAdaptive
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal_adaptive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy Chheng
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-05 00:00:00.000000000 Z
11
+ date: 2014-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
@@ -70,14 +70,14 @@ dependencies:
70
70
  name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Lightweight wrapper for Paypal's Adaptive Payments API
@@ -137,12 +137,12 @@ require_paths:
137
137
  - lib
138
138
  required_ruby_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - ! '>='
140
+ - - '>='
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ! '>='
145
+ - - '>='
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
@@ -151,30 +151,4 @@ rubygems_version: 2.0.3
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Lightweight wrapper for Paypal's Adaptive Payments API
154
- test_files:
155
- - test/data/invalid_chain_pay_request.json
156
- - test/data/invalid_parallel_pay_request.json
157
- - test/data/invalid_preapproval.json
158
- - test/data/invalid_preapproval_error_execstatus.json
159
- - test/data/invalid_preapproval_payment.json
160
- - test/data/invalid_simple_pay_request_1.json
161
- - test/data/valid_chain_pay_request.json
162
- - test/data/valid_get_payment_options_request.json
163
- - test/data/valid_get_shipping_addresses_request.json
164
- - test/data/valid_parallel_pay_request.json
165
- - test/data/valid_payment_details_request.json
166
- - test/data/valid_preapproval.json
167
- - test/data/valid_set_payment_options_request.json
168
- - test/data/valid_simple_pay_request_1.json
169
- - test/data/verified_get_verified_status_request.json
170
- - test/test_helper.rb
171
- - test/unit/config_test.rb
172
- - test/unit/get_shipping_addresses_test.rb
173
- - test/unit/get_verified_status_test.rb
174
- - test/unit/pay_request_schema_test.rb
175
- - test/unit/pay_request_test.rb
176
- - test/unit/payment_details_test.rb
177
- - test/unit/payment_options_test.rb
178
- - test/unit/preapproval_test.rb
179
- - test/unit/request_test.rb
180
- has_rdoc:
154
+ test_files: []