astrails-paypal_adaptive 0.1.1 → 0.1.2
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.
- data/README.markdown +29 -1
- data/VERSION +1 -1
- data/astrails-paypal_adaptive.gemspec +3 -4
- data/lib/request.rb +1 -1
- metadata +6 -6
data/README.markdown
CHANGED
@@ -7,6 +7,12 @@ Before you need start, read the API manual https://www.x.com/docs/DOC-1531 and c
|
|
7
7
|
It'll be invaluable for parameters and error messages. The gem keeps the request/response as hashes so you will have to
|
8
8
|
read the manual to make the proper calls. I made a few test cases for further examples at http://github.com/tc/paypal_adaptive/tree/master/test/
|
9
9
|
|
10
|
+
## Changes to the Ross Hale Version
|
11
|
+
This branch adds support for logging paypal requests and responses.
|
12
|
+
Also "rake test" should work now.
|
13
|
+
See the example below and PreapprovalTest#test_invalid_preapproval_with_logger.
|
14
|
+
|
15
|
+
|
10
16
|
## Changes to the Lottay Version
|
11
17
|
This branch adds support for PayPal Adaptive Accounts. An Adaptive Accounts request looks very similar to the Pay Request.
|
12
18
|
You simply post a hash of signup parameters to PayPal using the "create_account" method, and receive a URL to which you redirect the user to finish signup.
|
@@ -15,7 +21,7 @@ See the unit tests in "create_account_test.rb" for a good example.
|
|
15
21
|
|
16
22
|
###Installation Instructions
|
17
23
|
Install the gem:
|
18
|
-
sudo gem install
|
24
|
+
sudo gem install astrails-paypal_adaptive --source http://gemcutter.org
|
19
25
|
In environment.rb:
|
20
26
|
require 'paypal_adaptive'
|
21
27
|
|
@@ -68,6 +74,25 @@ Make the payment request:
|
|
68
74
|
end
|
69
75
|
|
70
76
|
---
|
77
|
+
|
78
|
+
To log the request and response:
|
79
|
+
class Logger
|
80
|
+
def request(path, request_data, headers)
|
81
|
+
# TODO: save to db/file/whatever
|
82
|
+
end
|
83
|
+
|
84
|
+
def response(status, response_data)
|
85
|
+
# TODO: save to db/file/whatever
|
86
|
+
end
|
87
|
+
|
88
|
+
...
|
89
|
+
end
|
90
|
+
|
91
|
+
logger = Logger.new
|
92
|
+
pay_response = pay_request.pay(data.merge(:logger => logger))
|
93
|
+
|
94
|
+
---
|
95
|
+
|
71
96
|
Once the user goes to pay_response.approve_paypal_payment_url, they will be prompted to login to Paypal for payment.
|
72
97
|
|
73
98
|
Upon payment completion page, they will be redirected to http://testserver.com/payments/completed_payment_request.
|
@@ -83,6 +108,9 @@ Additionally, you can make calls to Paypal Adaptive's other APIs:
|
|
83
108
|
Input is just a Hash just like the pay method. Refer to the Paypal manual for more details.
|
84
109
|
|
85
110
|
## Changelog
|
111
|
+
0.1.1
|
112
|
+
Added logging support.
|
113
|
+
|
86
114
|
0.1.0
|
87
115
|
Fixed IPN rails metal template by sending the correct params back: ipn.send_back(env['rack.request.form_vars'])
|
88
116
|
Thanks to github.com/JoN1oP for fixing this.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{astrails-paypal_adaptive}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tommy Chheng", "Ross Hale", "Boris Nadion"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-03-03}
|
13
13
|
s.description = %q{Lightweight wrapper for Paypal's Adaptive Payments API.}
|
14
14
|
s.email = %q{boris@astrails.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -48,7 +48,7 @@ Gem::Specification.new do |s|
|
|
48
48
|
]
|
49
49
|
s.homepage = %q{http://github.com/astrails/paypal_adaptive}
|
50
50
|
s.require_paths = ["lib"]
|
51
|
-
s.rubygems_version = %q{1.3
|
51
|
+
s.rubygems_version = %q{1.5.3}
|
52
52
|
s.summary = %q{initial import}
|
53
53
|
s.test_files = [
|
54
54
|
"test/create_account_test.rb",
|
@@ -60,7 +60,6 @@ Gem::Specification.new do |s|
|
|
60
60
|
]
|
61
61
|
|
62
62
|
if s.respond_to? :specification_version then
|
63
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
64
63
|
s.specification_version = 3
|
65
64
|
|
66
65
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
data/lib/request.rb
CHANGED
@@ -86,7 +86,7 @@ module PaypalAdaptive
|
|
86
86
|
|
87
87
|
logger.request(path, api_request_data, @@headers) if logger
|
88
88
|
resp, response_data = http.post(path, api_request_data, @@headers)
|
89
|
-
logger.response(resp, response_data) if logger
|
89
|
+
logger.response(resp.code, response_data) if logger
|
90
90
|
|
91
91
|
JSON.parse(response_data)
|
92
92
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: astrails-paypal_adaptive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 31
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tommy Chheng
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-
|
20
|
+
date: 2011-03-03 00:00:00 +02:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
requirements: []
|
117
117
|
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 1.3
|
119
|
+
rubygems_version: 1.5.3
|
120
120
|
signing_key:
|
121
121
|
specification_version: 3
|
122
122
|
summary: initial import
|