paypal-express 0.5.5 → 0.6.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a1efbcece6ca156968e202296852124d5671a31
4
- data.tar.gz: 93d1c16722894988ab929e949a6feda827fd6c92
3
+ metadata.gz: a8bdf6de40dccab7020f6aec90598360e9ef5a4c
4
+ data.tar.gz: 58a4ab67ab38a81f6ca04c806c0771657b9b6455
5
5
  SHA512:
6
- metadata.gz: 746fa1cd4af53dc83389e1cafb365efaa6e54ca8bb9a360cab880252caccc2721018aaa4f1f8c9e2159b8c7acf55cacdbb10de7189331ef3b6f07a9726fccda9
7
- data.tar.gz: f68a8061a47c18598fbde8958ff71a8ce30705a15ea6ea919a8f90dfa1758532482702cce005910c127f14c6bfa638c63a21f9751a4336dfa3ff5dc449c0589c
6
+ metadata.gz: 5a0cc3dd83e0d42ac61b0ed5cef08a700b17b1b30fa45605645ef7a45e1b0dcffd81487ca62398dc99bdeb680b6e5771b4cf3f0029bfa74ba1f5803673884ff0
7
+ data.tar.gz: b2b16f82df3015e6c2e807c53a9e0b14d6c4019ab75db0cfc780379f8f63dd0ec0caae38f0983789b4cd6610e74472272bb7b2ed7e560a33cda0e6761612e819
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  rvm:
2
- - 1.9.3
3
- - 2.0.0
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
- if RUBY_VERSION >= '1.9'
8
- namespace :cover_me do
9
- desc "Generates and opens code coverage report."
10
- task :report do
11
- require 'cover_me'
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.5.5
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') if with_cmd
28
- _query_.merge!(:useraction => 'commit') if pay_on_paypal
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
@@ -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
- if RUBY_VERSION >= '1.9'
21
- s.add_development_dependency "cover_me", ">= 1.2.0"
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
@@ -1,5 +1,7 @@
1
- if RUBY_VERSION >= '1.9'
2
- require 'cover_me'
1
+ require 'simplecov'
2
+
3
+ SimpleCov.start do
4
+ add_filter 'spec'
3
5
  end
4
6
 
5
7
  require 'paypal'
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.5.5
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: 2013-12-11 00:00:00.000000000 Z
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: cover_me
70
+ name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.2.0
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: 1.2.0
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.0.3
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)