paypal-express 0.7.1 → 0.8.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: 1539da1b53882ad187f1f9e0198cf577bd2bd5f3
4
- data.tar.gz: 09f4dd7537df29ad634638ee1638dadfc5cbae80
3
+ metadata.gz: 78b9ee949ee0b587532731dfa0c52c11d514549d
4
+ data.tar.gz: c6ceeb70ec8eecbd506625624fbc0c4a0d571153
5
5
  SHA512:
6
- metadata.gz: 593cb25deab96cefbaedc09afa44d6b9b97b59018d3dd18020c5ffab4372c0ffbddea931296c105ac84f7e00f0931dbac2897aa8041558e288360e38b3117e07
7
- data.tar.gz: ac40a7d06778b13d7ef18bc46836798aa2a8982b8a512567c242891a532bac566607569a3edefee31e815810aec18a43be137f2f6cf4c21310840fe0b1dbea69
6
+ metadata.gz: 01b135b01e61b710f75d6224a6b0136c6dac30243eb571e9da5de87a5a86118c57d5b912873d39df67ac478978b0c882404bb9744a1684f585c17ad971c9ff71
7
+ data.tar.gz: 908e9b074e6492f79ec11dbe2f9ebf0ed3f1b4e4caeccbee3fdc4f83bcb599a4abd894ba981fd22ab35da0af29df61c97c55d8b10483b36e4537cf83edef8b6d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.1
1
+ 0.8.0
@@ -5,8 +5,9 @@ require 'attr_optional'
5
5
  require 'rest_client'
6
6
 
7
7
  module Paypal
8
+ cattr_accessor :api_version
9
+ self.api_version = '88.0'
8
10
 
9
- API_VERSION = '88.0'
10
11
  ENDPOINT = {
11
12
  :production => 'https://www.paypal.com/cgi-bin/webscr',
12
13
  :sandbox => 'https://www.sandbox.paypal.com/cgi-bin/webscr'
@@ -57,10 +57,10 @@ module Paypal
57
57
  Response.new response
58
58
  end
59
59
 
60
- def capture!(authorization_id, amount, currency_code)
60
+ def capture!(authorization_id, amount, currency_code, complete_type = 'Complete')
61
61
  params = {
62
62
  :AUTHORIZATIONID => authorization_id,
63
- :COMPLETETYPE => "Complete",
63
+ :COMPLETETYPE => complete_type,
64
64
  :AMT => amount,
65
65
  :CURRENCYCODE => currency_code
66
66
  }
@@ -19,7 +19,7 @@ module Paypal
19
19
  end
20
20
 
21
21
  def initialize(attributes = {})
22
- @version = API_VERSION
22
+ @version = Paypal.api_version
23
23
  super
24
24
  end
25
25
 
@@ -285,6 +285,20 @@ describe Paypal::Express::Request do
285
285
  :CURRENCYCODE => :BRL
286
286
  }
287
287
  end
288
+
289
+ it 'should call DoExpressCheckoutPayment with NotComplete capture parameter' do
290
+ expect do
291
+ instance.capture! 'authorization_id', 181.98, :BRL, 'NotComplete'
292
+ end.to request_to nvp_endpoint, :post
293
+
294
+ instance._method_.should == :DoCapture
295
+ instance._sent_params_.should == {
296
+ :AUTHORIZATIONID => 'authorization_id',
297
+ :COMPLETETYPE => 'NotComplete',
298
+ :AMT => 181.98,
299
+ :CURRENCYCODE => :BRL
300
+ }
301
+ end
288
302
  end
289
303
 
290
304
  describe "#void!" do
@@ -36,7 +36,6 @@ describe Paypal::NVP::Request do
36
36
 
37
37
  it 'should setup endpoint and version' do
38
38
  client = Paypal::NVP::Request.new attributes
39
- client.version.should == Paypal::API_VERSION
40
39
  client.class.endpoint.should == Paypal::NVP::Request::ENDPOINT[:production]
41
40
  end
42
41
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal-express
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.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: 2014-11-20 00:00:00.000000000 Z
11
+ date: 2014-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport