paypal-express 0.5.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/Rakefile +9 -15
- data/VERSION +1 -1
- data/lib/paypal/express/request.rb +7 -1
- data/lib/paypal/express/response.rb +5 -3
- data/paypal-express.gemspec +2 -6
- data/spec/paypal/express/request_spec.rb +20 -1
- data/spec/paypal/express/response_spec.rb +12 -0
- data/spec/spec_helper.rb +4 -2
- metadata +29 -30
- data/Gemfile.lock +0 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8bdf6de40dccab7020f6aec90598360e9ef5a4c
|
4
|
+
data.tar.gz: 58a4ab67ab38a81f6ca04c806c0771657b9b6455
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a0cc3dd83e0d42ac61b0ed5cef08a700b17b1b30fa45605645ef7a45e1b0dcffd81487ca62398dc99bdeb680b6e5771b4cf3f0029bfa74ba1f5803673884ff0
|
7
|
+
data.tar.gz: b2b16f82df3015e6c2e807c53a9e0b14d6c4019ab75db0cfc780379f8f63dd0ec0caae38f0983789b4cd6610e74472272bb7b2ed7e560a33cda0e6761612e819
|
data/.travis.yml
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
rvm:
|
2
|
-
-
|
3
|
-
- 2.
|
2
|
+
- 2.0.0
|
3
|
+
- 2.1.2
|
data/Rakefile
CHANGED
@@ -4,22 +4,16 @@ Bundler::GemHelper.install_tasks
|
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
RSpec::Core::RakeTask.new(:spec)
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
CoverMe.complete!
|
13
|
-
end
|
14
|
-
end
|
15
|
-
task :spec do
|
16
|
-
Rake::Task['cover_me:report'].invoke unless ENV['TRAVIS_RUBY_VERSION']
|
17
|
-
end
|
18
|
-
else
|
19
|
-
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
20
|
-
spec.rcov = true
|
21
|
-
spec.rcov_opts = ['-Ilib -Ispec --exclude spec,gems']
|
7
|
+
namespace :coverage do
|
8
|
+
desc "Open coverage report"
|
9
|
+
task :report do
|
10
|
+
require 'simplecov'
|
11
|
+
`open "#{File.join SimpleCov.coverage_path, 'index.html'}"`
|
22
12
|
end
|
23
13
|
end
|
24
14
|
|
15
|
+
task :spec do
|
16
|
+
Rake::Task[:'coverage:report'].invoke unless ENV['TRAVIS_RUBY_VERSION']
|
17
|
+
end
|
18
|
+
|
25
19
|
task :default => :spec
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
@@ -13,12 +13,18 @@ module Paypal
|
|
13
13
|
params[:REQCONFIRMSHIPPING] = 0
|
14
14
|
params[:NOSHIPPING] = 1
|
15
15
|
end
|
16
|
+
|
17
|
+
params[:ALLOWNOTE] = 0 if options[:allow_note] == false
|
18
|
+
|
16
19
|
{
|
17
20
|
:solution_type => :SOLUTIONTYPE,
|
18
21
|
:landing_page => :LANDINGPAGE,
|
19
22
|
:email => :EMAIL,
|
20
23
|
:brand => :BRANDNAME,
|
21
|
-
:locale => :LOCALECODE
|
24
|
+
:locale => :LOCALECODE,
|
25
|
+
:logo => :LOGOIMG,
|
26
|
+
:cart_border_color => :CARTBORDERCOLOR,
|
27
|
+
:payflow_color => :PAYFLOWCOLOR
|
22
28
|
}.each do |option_key, param_key|
|
23
29
|
params[param_key] = options[option_key] if options[option_key]
|
24
30
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module Paypal
|
2
2
|
module Express
|
3
3
|
class Response < NVP::Response
|
4
|
-
attr_accessor :pay_on_paypal
|
4
|
+
attr_accessor :pay_on_paypal, :mobile
|
5
5
|
|
6
6
|
def initialize(response, options = {})
|
7
7
|
super response
|
8
8
|
@pay_on_paypal = options[:pay_on_paypal]
|
9
|
+
@mobile = options[:mobile]
|
9
10
|
end
|
10
11
|
|
11
12
|
def redirect_uri
|
@@ -24,8 +25,9 @@ module Paypal
|
|
24
25
|
|
25
26
|
def query(with_cmd = false)
|
26
27
|
_query_ = {:token => self.token}
|
27
|
-
_query_.merge!(:cmd => '_express-checkout')
|
28
|
-
_query_.merge!(:
|
28
|
+
_query_.merge!(:cmd => '_express-checkout') if with_cmd
|
29
|
+
_query_.merge!(:cmd => '_express-checkout-mobile') if mobile
|
30
|
+
_query_.merge!(:useraction => 'commit') if pay_on_paypal
|
29
31
|
_query_
|
30
32
|
end
|
31
33
|
end
|
data/paypal-express.gemspec
CHANGED
@@ -17,11 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_dependency "restclient_with_cert"
|
18
18
|
s.add_dependency "attr_required", ">= 0.0.5"
|
19
19
|
s.add_development_dependency "rake", ">= 0.8"
|
20
|
-
|
21
|
-
|
22
|
-
else
|
23
|
-
s.add_development_dependency "rcov", ">= 0.9"
|
24
|
-
end
|
25
|
-
s.add_development_dependency "rspec", ">= 2"
|
20
|
+
s.add_development_dependency "simplecov"
|
21
|
+
s.add_development_dependency "rspec", "< 2.99"
|
26
22
|
s.add_development_dependency "fakeweb", ">= 1.3.0"
|
27
23
|
end
|
@@ -126,12 +126,31 @@ describe Paypal::Express::Request do
|
|
126
126
|
}
|
127
127
|
end
|
128
128
|
|
129
|
+
it 'should support allow_note=false option' do
|
130
|
+
expect do
|
131
|
+
instance.setup instant_payment_request, return_url, cancel_url, :allow_note => false
|
132
|
+
end.to request_to nvp_endpoint, :post
|
133
|
+
instance._method_.should == :SetExpressCheckout
|
134
|
+
instance._sent_params_.should == {
|
135
|
+
:PAYMENTREQUEST_0_DESC => 'Instant Payment Request',
|
136
|
+
:RETURNURL => return_url,
|
137
|
+
:CANCELURL => cancel_url,
|
138
|
+
:PAYMENTREQUEST_0_AMT => '1000.00',
|
139
|
+
:PAYMENTREQUEST_0_TAXAMT => "0.00",
|
140
|
+
:PAYMENTREQUEST_0_SHIPPINGAMT => "0.00",
|
141
|
+
:ALLOWNOTE => 0
|
142
|
+
}
|
143
|
+
end
|
144
|
+
|
129
145
|
{
|
130
146
|
:solution_type => :SOLUTIONTYPE,
|
131
147
|
:landing_page => :LANDINGPAGE,
|
132
148
|
:email => :EMAIL,
|
133
149
|
:brand => :BRANDNAME,
|
134
|
-
:locale => :LOCALECODE
|
150
|
+
:locale => :LOCALECODE,
|
151
|
+
:logo => :LOGOIMG,
|
152
|
+
:cart_border_color => :CARTBORDERCOLOR,
|
153
|
+
:payflow_color => :PAYFLOWCOLOR
|
135
154
|
}.each do |option_key, param_key|
|
136
155
|
it "should support #{option_key} option" do
|
137
156
|
expect do
|
@@ -65,4 +65,16 @@ describe Paypal::Express::Response do
|
|
65
65
|
it { should include 'https://www.sandbox.paypal.com/incontext?token=' }
|
66
66
|
end
|
67
67
|
end
|
68
|
+
|
69
|
+
context 'when mobile option is given' do
|
70
|
+
let(:response) { request.setup payment_request, return_url, cancel_url, :mobile => true }
|
71
|
+
|
72
|
+
subject { response }
|
73
|
+
|
74
|
+
describe '#redirect_uri' do
|
75
|
+
subject { response.redirect_uri }
|
76
|
+
it { should include 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout-mobile&token=' }
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
68
80
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal-express
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: restclient_with_cert
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: attr_required
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 0.0.5
|
48
48
|
type: :runtime
|
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.0.5
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0.8'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.8'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
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
|
-
version:
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - "<"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '2'
|
89
|
+
version: '2.99'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - "<"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '2'
|
96
|
+
version: '2.99'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: fakeweb
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 1.3.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 1.3.0
|
111
111
|
description: PayPal Express Checkout API Client for Instance, Recurring and Digital
|
@@ -117,12 +117,11 @@ extra_rdoc_files:
|
|
117
117
|
- LICENSE
|
118
118
|
- README.rdoc
|
119
119
|
files:
|
120
|
-
- .document
|
121
|
-
- .gitignore
|
122
|
-
- .rspec
|
123
|
-
- .travis.yml
|
120
|
+
- ".document"
|
121
|
+
- ".gitignore"
|
122
|
+
- ".rspec"
|
123
|
+
- ".travis.yml"
|
124
124
|
- Gemfile
|
125
|
-
- Gemfile.lock
|
126
125
|
- LICENSE
|
127
126
|
- README.rdoc
|
128
127
|
- Rakefile
|
@@ -206,22 +205,22 @@ licenses: []
|
|
206
205
|
metadata: {}
|
207
206
|
post_install_message:
|
208
207
|
rdoc_options:
|
209
|
-
- --charset=UTF-8
|
208
|
+
- "--charset=UTF-8"
|
210
209
|
require_paths:
|
211
210
|
- lib
|
212
211
|
required_ruby_version: !ruby/object:Gem::Requirement
|
213
212
|
requirements:
|
214
|
-
- -
|
213
|
+
- - ">="
|
215
214
|
- !ruby/object:Gem::Version
|
216
215
|
version: '0'
|
217
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
218
217
|
requirements:
|
219
|
-
- -
|
218
|
+
- - ">="
|
220
219
|
- !ruby/object:Gem::Version
|
221
220
|
version: 1.3.6
|
222
221
|
requirements: []
|
223
222
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.
|
223
|
+
rubygems_version: 2.2.2
|
225
224
|
signing_key:
|
226
225
|
specification_version: 4
|
227
226
|
summary: PayPal Express Checkout API Client for Instance, Recurring and Digital Goods
|
data/Gemfile.lock
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
paypal-express (0.5.4)
|
5
|
-
activesupport (>= 2.3)
|
6
|
-
attr_required (>= 0.0.5)
|
7
|
-
restclient_with_cert
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: http://rubygems.org/
|
11
|
-
specs:
|
12
|
-
activesupport (4.0.2)
|
13
|
-
i18n (~> 0.6, >= 0.6.4)
|
14
|
-
minitest (~> 4.2)
|
15
|
-
multi_json (~> 1.3)
|
16
|
-
thread_safe (~> 0.1)
|
17
|
-
tzinfo (~> 0.3.37)
|
18
|
-
atomic (1.1.14)
|
19
|
-
attr_required (0.0.5)
|
20
|
-
configatron (2.13.0)
|
21
|
-
yamler (>= 0.1.0)
|
22
|
-
cover_me (1.2.0)
|
23
|
-
configatron
|
24
|
-
hashie
|
25
|
-
diff-lcs (1.2.5)
|
26
|
-
fakeweb (1.3.0)
|
27
|
-
hashie (2.0.5)
|
28
|
-
i18n (0.6.9)
|
29
|
-
mime-types (2.0)
|
30
|
-
minitest (4.7.5)
|
31
|
-
multi_json (1.8.2)
|
32
|
-
rake (10.1.0)
|
33
|
-
rest-client (1.6.7)
|
34
|
-
mime-types (>= 1.16)
|
35
|
-
restclient_with_cert (0.0.8)
|
36
|
-
rest-client (>= 1.6)
|
37
|
-
rspec (2.14.1)
|
38
|
-
rspec-core (~> 2.14.0)
|
39
|
-
rspec-expectations (~> 2.14.0)
|
40
|
-
rspec-mocks (~> 2.14.0)
|
41
|
-
rspec-core (2.14.7)
|
42
|
-
rspec-expectations (2.14.4)
|
43
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
44
|
-
rspec-mocks (2.14.4)
|
45
|
-
thread_safe (0.1.3)
|
46
|
-
atomic
|
47
|
-
tzinfo (0.3.38)
|
48
|
-
yamler (0.1.0)
|
49
|
-
|
50
|
-
PLATFORMS
|
51
|
-
ruby
|
52
|
-
|
53
|
-
DEPENDENCIES
|
54
|
-
cover_me (>= 1.2.0)
|
55
|
-
fakeweb (>= 1.3.0)
|
56
|
-
jruby-openssl (>= 0.7)
|
57
|
-
paypal-express!
|
58
|
-
rake (>= 0.8)
|
59
|
-
rspec (>= 2)
|