paypal-express 0.5.3 → 0.5.4
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 +7 -0
- data/.travis.yml +2 -3
- data/README.rdoc +0 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/paypal/express/request.rb +11 -0
- data/paypal-express.gemspec +0 -1
- data/spec/fake_response/DoCapture/failure.txt +1 -0
- data/spec/fake_response/DoCapture/success.txt +1 -0
- data/spec/paypal/express/request_spec.rb +26 -4
- metadata +25 -57
- data/Gemfile.lock +0 -56
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3ac817d3cb8d282bb9ecc3d8a64e62e9976d2135
|
4
|
+
data.tar.gz: 463777d1aa12e5717ab57d4cd6b4d40912fb7b0e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ccc1b0fd9724526454f80e0c931bbe55574ee2685eadfd54bab567036c86ade49957b2055e27a74ad1f42811bf490162ce21b07340750b5611778a7d6ec178a6
|
7
|
+
data.tar.gz: 83646fdb5830786793849dc3ff12086c125371ac18fac44ea61540c1a22cb372136340e070d3b657e42fe092bc49ae1120362f47dbeb0a7485977de2dff92151
|
data/.travis.yml
CHANGED
data/README.rdoc
CHANGED
@@ -5,7 +5,6 @@ Both Instance Payment and Recurring Payment are supported.
|
|
5
5
|
Express Checkout for Digital Goods is also supported.
|
6
6
|
|
7
7
|
{<img src="https://secure.travis-ci.org/nov/paypal-express.png" />}[http://travis-ci.org/nov/paypal-express]
|
8
|
-
{<img src="http://www.pledgie.com/campaigns/19045.png?skin_name=chrome" />}[http://pledgie.com/campaigns/19045]
|
9
8
|
|
10
9
|
== Installation
|
11
10
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.4
|
@@ -51,6 +51,17 @@ module Paypal
|
|
51
51
|
Response.new response
|
52
52
|
end
|
53
53
|
|
54
|
+
def capture!(authorization_id, amount, currency_code)
|
55
|
+
params = {
|
56
|
+
:AUTHORIZATIONID => authorization_id,
|
57
|
+
:COMPLETETYPE => "Complete",
|
58
|
+
:AMT => amount,
|
59
|
+
:CURRENCYCODE => currency_code
|
60
|
+
}
|
61
|
+
|
62
|
+
response = self.request :DoCapture, params
|
63
|
+
Response.new response
|
64
|
+
end
|
54
65
|
|
55
66
|
# Recurring Payment Specific
|
56
67
|
|
data/paypal-express.gemspec
CHANGED
@@ -14,7 +14,6 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.files = `git ls-files`.split("\n")
|
15
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
16
|
s.add_dependency "activesupport", ">= 2.3"
|
17
|
-
s.add_dependency "i18n"
|
18
17
|
s.add_dependency "restclient_with_cert"
|
19
18
|
s.add_dependency "attr_required", ">= 0.0.5"
|
20
19
|
s.add_development_dependency "rake", ">= 0.8"
|
@@ -0,0 +1 @@
|
|
1
|
+
ACK=Failure&BUILD=8334781&CORRELATIONID=dd9e16358819b&L_ERRORCODE0=10609&L_LONGMESSAGE0=Transaction+id+is+invalid.&L_SEVERITYCODE0=Error&L_SHORTMESSAGE0=Invalid+transactionID.&TIMESTAMP=2013-11-05T17%3A43%3A56Z&VERSION=88.0
|
@@ -0,0 +1 @@
|
|
1
|
+
ACK=Success&AMT=440.00&AUTHORIZATIONID=2RG78938NK8989844&BUILD=8334781&CORRELATIONID=311611c111b48&CURRENCYCODE=BRL&EXCHANGERATE=0.426354&FEEAMT=13.16&ORDERTIME=2013-11-05T17%3A34%3A56Z&PARENTTRANSACTIONID=2RG78938NK8989844&PAYMENTSTATUS=Completed&PAYMENTTYPE=instant&PENDINGREASON=None&PROTECTIONELIGIBILITY=Ineligible&PROTECTIONELIGIBILITYTYPE=None&REASONCODE=None&SETTLEAMT=181.98&TAXAMT=0.00&TIMESTAMP=2013-11-05T17%3A34%3A56Z&TRANSACTIONID=9VW4495267708531S&TRANSACTIONTYPE=expresscheckout&VERSION=88.0
|
@@ -221,7 +221,7 @@ describe Paypal::Express::Request do
|
|
221
221
|
response = instance.transaction_details 'transaction_id'
|
222
222
|
response.should be_instance_of Paypal::Express::Response
|
223
223
|
end
|
224
|
-
|
224
|
+
|
225
225
|
it 'should call GetTransactionDetails' do
|
226
226
|
expect do
|
227
227
|
instance.transaction_details 'transaction_id'
|
@@ -231,21 +231,43 @@ describe Paypal::Express::Request do
|
|
231
231
|
:TRANSACTIONID=> 'transaction_id'
|
232
232
|
}
|
233
233
|
end
|
234
|
-
|
234
|
+
|
235
235
|
it 'should fail with bad transaction id' do
|
236
236
|
expect do
|
237
237
|
fake_response 'GetTransactionDetails/failure'
|
238
238
|
response = instance.transaction_details 'bad_transaction_id'
|
239
239
|
end.to raise_error(Paypal::Exception::APIError)
|
240
240
|
end
|
241
|
-
|
241
|
+
|
242
242
|
it 'should handle all attributes' do
|
243
243
|
Paypal.logger.should_not_receive(:warn)
|
244
244
|
fake_response 'GetTransactionDetails/success'
|
245
245
|
response = instance.transaction_details 'transaction_id'
|
246
246
|
end
|
247
247
|
end
|
248
|
-
|
248
|
+
|
249
|
+
describe "#capture!" do
|
250
|
+
it 'should return Paypal::Express::Response' do
|
251
|
+
fake_response 'DoCapture/success'
|
252
|
+
response = instance.capture! 'authorization_id', 181.98, :BRL
|
253
|
+
response.should be_instance_of Paypal::Express::Response
|
254
|
+
end
|
255
|
+
|
256
|
+
it 'should call DoExpressCheckoutPayment' do
|
257
|
+
expect do
|
258
|
+
instance.capture! 'authorization_id', 181.98, :BRL
|
259
|
+
end.to request_to nvp_endpoint, :post
|
260
|
+
|
261
|
+
instance._method_.should == :DoCapture
|
262
|
+
instance._sent_params_.should == {
|
263
|
+
:AUTHORIZATIONID => 'authorization_id',
|
264
|
+
:COMPLETETYPE => 'Complete',
|
265
|
+
:AMT => 181.98,
|
266
|
+
:CURRENCYCODE => :BRL
|
267
|
+
}
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
249
271
|
describe '#checkout!' do
|
250
272
|
it 'should return Paypal::Express::Response' do
|
251
273
|
fake_response 'DoExpressCheckoutPayment/success'
|
metadata
CHANGED
@@ -1,142 +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
|
-
prerelease:
|
4
|
+
version: 0.5.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- nov matake
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-11-30 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activesupport
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '2.3'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '2.3'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: i18n
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :runtime
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
27
|
- !ruby/object:Gem::Dependency
|
47
28
|
name: restclient_with_cert
|
48
29
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
30
|
requirements:
|
51
|
-
- -
|
31
|
+
- - '>='
|
52
32
|
- !ruby/object:Gem::Version
|
53
33
|
version: '0'
|
54
34
|
type: :runtime
|
55
35
|
prerelease: false
|
56
36
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
37
|
requirements:
|
59
|
-
- -
|
38
|
+
- - '>='
|
60
39
|
- !ruby/object:Gem::Version
|
61
40
|
version: '0'
|
62
41
|
- !ruby/object:Gem::Dependency
|
63
42
|
name: attr_required
|
64
43
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
44
|
requirements:
|
67
|
-
- -
|
45
|
+
- - '>='
|
68
46
|
- !ruby/object:Gem::Version
|
69
47
|
version: 0.0.5
|
70
48
|
type: :runtime
|
71
49
|
prerelease: false
|
72
50
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
51
|
requirements:
|
75
|
-
- -
|
52
|
+
- - '>='
|
76
53
|
- !ruby/object:Gem::Version
|
77
54
|
version: 0.0.5
|
78
55
|
- !ruby/object:Gem::Dependency
|
79
56
|
name: rake
|
80
57
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
58
|
requirements:
|
83
|
-
- -
|
59
|
+
- - '>='
|
84
60
|
- !ruby/object:Gem::Version
|
85
61
|
version: '0.8'
|
86
62
|
type: :development
|
87
63
|
prerelease: false
|
88
64
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
65
|
requirements:
|
91
|
-
- -
|
66
|
+
- - '>='
|
92
67
|
- !ruby/object:Gem::Version
|
93
68
|
version: '0.8'
|
94
69
|
- !ruby/object:Gem::Dependency
|
95
70
|
name: cover_me
|
96
71
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
72
|
requirements:
|
99
|
-
- -
|
73
|
+
- - '>='
|
100
74
|
- !ruby/object:Gem::Version
|
101
75
|
version: 1.2.0
|
102
76
|
type: :development
|
103
77
|
prerelease: false
|
104
78
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
79
|
requirements:
|
107
|
-
- -
|
80
|
+
- - '>='
|
108
81
|
- !ruby/object:Gem::Version
|
109
82
|
version: 1.2.0
|
110
83
|
- !ruby/object:Gem::Dependency
|
111
84
|
name: rspec
|
112
85
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
86
|
requirements:
|
115
|
-
- -
|
87
|
+
- - '>='
|
116
88
|
- !ruby/object:Gem::Version
|
117
89
|
version: '2'
|
118
90
|
type: :development
|
119
91
|
prerelease: false
|
120
92
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
93
|
requirements:
|
123
|
-
- -
|
94
|
+
- - '>='
|
124
95
|
- !ruby/object:Gem::Version
|
125
96
|
version: '2'
|
126
97
|
- !ruby/object:Gem::Dependency
|
127
98
|
name: fakeweb
|
128
99
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
100
|
requirements:
|
131
|
-
- -
|
101
|
+
- - '>='
|
132
102
|
- !ruby/object:Gem::Version
|
133
103
|
version: 1.3.0
|
134
104
|
type: :development
|
135
105
|
prerelease: false
|
136
106
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
107
|
requirements:
|
139
|
-
- -
|
108
|
+
- - '>='
|
140
109
|
- !ruby/object:Gem::Version
|
141
110
|
version: 1.3.0
|
142
111
|
description: PayPal Express Checkout API Client for Instance, Recurring and Digital
|
@@ -153,7 +122,6 @@ files:
|
|
153
122
|
- .rspec
|
154
123
|
- .travis.yml
|
155
124
|
- Gemfile
|
156
|
-
- Gemfile.lock
|
157
125
|
- LICENSE
|
158
126
|
- README.rdoc
|
159
127
|
- Rakefile
|
@@ -190,6 +158,8 @@ files:
|
|
190
158
|
- spec/fake_response/CreateBillingAgreement/success.txt
|
191
159
|
- spec/fake_response/CreateRecurringPaymentsProfile/failure.txt
|
192
160
|
- spec/fake_response/CreateRecurringPaymentsProfile/success.txt
|
161
|
+
- spec/fake_response/DoCapture/failure.txt
|
162
|
+
- spec/fake_response/DoCapture/success.txt
|
193
163
|
- spec/fake_response/DoExpressCheckoutPayment/failure.txt
|
194
164
|
- spec/fake_response/DoExpressCheckoutPayment/success.txt
|
195
165
|
- spec/fake_response/DoExpressCheckoutPayment/success_with_billing_agreement.txt
|
@@ -232,31 +202,27 @@ files:
|
|
232
202
|
- spec/spec_helper.rb
|
233
203
|
homepage: http://github.com/nov/paypal-express
|
234
204
|
licenses: []
|
205
|
+
metadata: {}
|
235
206
|
post_install_message:
|
236
207
|
rdoc_options:
|
237
208
|
- --charset=UTF-8
|
238
209
|
require_paths:
|
239
210
|
- lib
|
240
211
|
required_ruby_version: !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
212
|
requirements:
|
243
|
-
- -
|
213
|
+
- - '>='
|
244
214
|
- !ruby/object:Gem::Version
|
245
215
|
version: '0'
|
246
|
-
segments:
|
247
|
-
- 0
|
248
|
-
hash: 2957452685464048552
|
249
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
250
|
-
none: false
|
251
217
|
requirements:
|
252
|
-
- -
|
218
|
+
- - '>='
|
253
219
|
- !ruby/object:Gem::Version
|
254
220
|
version: 1.3.6
|
255
221
|
requirements: []
|
256
222
|
rubyforge_project:
|
257
|
-
rubygems_version:
|
223
|
+
rubygems_version: 2.0.3
|
258
224
|
signing_key:
|
259
|
-
specification_version:
|
225
|
+
specification_version: 4
|
260
226
|
summary: PayPal Express Checkout API Client for Instance, Recurring and Digital Goods
|
261
227
|
Payment.
|
262
228
|
test_files:
|
@@ -265,6 +231,8 @@ test_files:
|
|
265
231
|
- spec/fake_response/CreateBillingAgreement/success.txt
|
266
232
|
- spec/fake_response/CreateRecurringPaymentsProfile/failure.txt
|
267
233
|
- spec/fake_response/CreateRecurringPaymentsProfile/success.txt
|
234
|
+
- spec/fake_response/DoCapture/failure.txt
|
235
|
+
- spec/fake_response/DoCapture/success.txt
|
268
236
|
- spec/fake_response/DoExpressCheckoutPayment/failure.txt
|
269
237
|
- spec/fake_response/DoExpressCheckoutPayment/success.txt
|
270
238
|
- spec/fake_response/DoExpressCheckoutPayment/success_with_billing_agreement.txt
|
data/Gemfile.lock
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
paypal-express (0.5.3)
|
5
|
-
activesupport (>= 2.3)
|
6
|
-
attr_required (>= 0.0.5)
|
7
|
-
i18n
|
8
|
-
restclient_with_cert
|
9
|
-
|
10
|
-
GEM
|
11
|
-
remote: http://rubygems.org/
|
12
|
-
specs:
|
13
|
-
activesupport (3.2.11)
|
14
|
-
i18n (~> 0.6)
|
15
|
-
multi_json (~> 1.0)
|
16
|
-
attr_required (0.0.5)
|
17
|
-
bouncy-castle-java (1.5.0146.1)
|
18
|
-
configatron (2.9.1)
|
19
|
-
yamler (>= 0.1.0)
|
20
|
-
cover_me (1.2.0)
|
21
|
-
configatron
|
22
|
-
hashie
|
23
|
-
diff-lcs (1.1.3)
|
24
|
-
fakeweb (1.3.0)
|
25
|
-
hashie (1.2.0)
|
26
|
-
i18n (0.6.1)
|
27
|
-
jruby-openssl (0.8.2)
|
28
|
-
bouncy-castle-java (>= 1.5.0146.1)
|
29
|
-
mime-types (1.19)
|
30
|
-
multi_json (1.5.0)
|
31
|
-
rake (10.0.3)
|
32
|
-
rest-client (1.6.7)
|
33
|
-
mime-types (>= 1.16)
|
34
|
-
restclient_with_cert (0.0.8)
|
35
|
-
rest-client (>= 1.6)
|
36
|
-
rspec (2.12.0)
|
37
|
-
rspec-core (~> 2.12.0)
|
38
|
-
rspec-expectations (~> 2.12.0)
|
39
|
-
rspec-mocks (~> 2.12.0)
|
40
|
-
rspec-core (2.12.2)
|
41
|
-
rspec-expectations (2.12.1)
|
42
|
-
diff-lcs (~> 1.1.3)
|
43
|
-
rspec-mocks (2.12.2)
|
44
|
-
yamler (0.1.0)
|
45
|
-
|
46
|
-
PLATFORMS
|
47
|
-
java
|
48
|
-
ruby
|
49
|
-
|
50
|
-
DEPENDENCIES
|
51
|
-
cover_me (>= 1.2.0)
|
52
|
-
fakeweb (>= 1.3.0)
|
53
|
-
jruby-openssl (>= 0.7)
|
54
|
-
paypal-express!
|
55
|
-
rake (>= 0.8)
|
56
|
-
rspec (>= 2)
|