killbill-paypal-express 1.8.1 → 2.0.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 +4 -4
- data/.gitignore +4 -5
- data/.travis.yml +22 -3
- data/Gemfile +1 -1
- data/Gemfile.head +5 -0
- data/Gemfile.lock +129 -0
- data/Jarfile +9 -8
- data/Jarfile.lock +56 -0
- data/LICENSE +2 -2
- data/NEWS +12 -0
- data/README.md +51 -52
- data/VERSION +1 -1
- data/db/ddl.sql +4 -4
- data/db/schema.rb +9 -9
- data/killbill-paypal-express.gemspec +18 -15
- data/lib/paypal_express.rb +0 -1
- data/lib/paypal_express/api.rb +17 -7
- data/lib/paypal_express/application.rb +6 -3
- data/lib/paypal_express/models/payment_method.rb +3 -3
- data/lib/paypal_express/private_api.rb +4 -3
- data/paypal_express.yml +19 -11
- data/pom.xml +2 -2
- data/release.sh +34 -14
- data/spec/paypal_express/base_plugin_spec.rb +4 -5
- data/spec/paypal_express/remote/integration_spec.rb +16 -27
- metadata +71 -43
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5af51e13f074f343ec5bbec150017c219b205c5e
|
|
4
|
+
data.tar.gz: eebeef735fd827fd3c44edc05eb835e75bc8de22
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 313e4504a3838a0638a32a0c0bd2bda6b49fb159d999da340f55bb444eb0f82411ca007434488aeda798cc971ffed8c6bcb1541c33c11fde822f2d630b037b22
|
|
7
|
+
data.tar.gz: bcea073642667b65dea60dc5aecc5fd3de317001640a423d704ecc31fc09c3e24d9daf31454ad57280c7d6ca1b79ff8e99549fb15d9aae81432f54d382da9947
|
data/.gitignore
CHANGED
|
@@ -19,18 +19,17 @@ _yardoc
|
|
|
19
19
|
doc/
|
|
20
20
|
|
|
21
21
|
.jbundler
|
|
22
|
-
Jarfile.lock
|
|
23
|
-
Gemfile.lock
|
|
24
22
|
|
|
25
23
|
.DS_Store
|
|
26
24
|
|
|
27
|
-
# Build directory
|
|
28
|
-
killbill-paypal-express/
|
|
29
|
-
|
|
30
25
|
# Testing database
|
|
31
26
|
test.db
|
|
32
27
|
|
|
28
|
+
paypal_express.log
|
|
29
|
+
|
|
33
30
|
target
|
|
34
31
|
pom.xml.asc
|
|
35
32
|
|
|
36
33
|
.idea/
|
|
34
|
+
|
|
35
|
+
Gemfile.head.lock
|
data/.travis.yml
CHANGED
|
@@ -1,19 +1,38 @@
|
|
|
1
1
|
language: ruby
|
|
2
2
|
|
|
3
|
+
sudo: false
|
|
4
|
+
cache: bundler
|
|
5
|
+
|
|
6
|
+
script: 'bundle exec rake test:spec test:remote:spec'
|
|
7
|
+
|
|
3
8
|
notifications:
|
|
4
9
|
email:
|
|
5
10
|
- kill-bill-commits@googlegroups.com
|
|
6
11
|
|
|
12
|
+
env:
|
|
13
|
+
global:
|
|
14
|
+
- JRUBY_OPTS='-J-Xmx1024M'
|
|
15
|
+
|
|
7
16
|
rvm:
|
|
8
|
-
- jruby-
|
|
9
|
-
- jruby-20mode
|
|
17
|
+
- jruby-1.7.20
|
|
18
|
+
- jruby-20mode # latest 1.7.x
|
|
10
19
|
- jruby-head
|
|
11
20
|
|
|
21
|
+
gemfile:
|
|
22
|
+
- Gemfile
|
|
23
|
+
- Gemfile.head
|
|
24
|
+
|
|
12
25
|
jdk:
|
|
13
|
-
- openjdk6
|
|
14
26
|
- openjdk7
|
|
15
27
|
- oraclejdk7
|
|
28
|
+
- oraclejdk8
|
|
16
29
|
|
|
17
30
|
matrix:
|
|
18
31
|
allow_failures:
|
|
19
32
|
- rvm: jruby-head
|
|
33
|
+
- jdk: oraclejdk8
|
|
34
|
+
- gemfile: Gemfile.head
|
|
35
|
+
fast_finish: true
|
|
36
|
+
|
|
37
|
+
after_success:
|
|
38
|
+
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && echo "<settings><servers><server><id>sonatype-nexus-snapshots</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASS}</password></server></servers></settings>" > ~/settings.xml && MVN="mvn --settings $HOME/settings.xml" NO_RELEASE=1 travis_retry travis_wait bash release.sh | egrep -v "Download|Install|Upload" ; rm -f ~/settings.xml'
|
data/Gemfile
CHANGED
data/Gemfile.head
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
killbill-paypal-express (2.0.0)
|
|
5
|
+
actionpack (~> 4.1.0)
|
|
6
|
+
actionview (~> 4.1.0)
|
|
7
|
+
activemerchant (~> 1.48.0)
|
|
8
|
+
activerecord (~> 4.1.0)
|
|
9
|
+
activerecord-bogacs (~> 0.3)
|
|
10
|
+
activerecord-jdbc-adapter (~> 1.3)
|
|
11
|
+
jruby-openssl (~> 0.9.6)
|
|
12
|
+
killbill (~> 4.0.0)
|
|
13
|
+
monetize (~> 1.1.0)
|
|
14
|
+
money (~> 6.5.1)
|
|
15
|
+
offsite_payments (~> 2.1.0)
|
|
16
|
+
sinatra (~> 1.3.4)
|
|
17
|
+
thread_safe (~> 0.3.4)
|
|
18
|
+
|
|
19
|
+
GEM
|
|
20
|
+
remote: https://rubygems.org/
|
|
21
|
+
specs:
|
|
22
|
+
actionpack (4.1.10)
|
|
23
|
+
actionview (= 4.1.10)
|
|
24
|
+
activesupport (= 4.1.10)
|
|
25
|
+
rack (~> 1.5.2)
|
|
26
|
+
rack-test (~> 0.6.2)
|
|
27
|
+
actionview (4.1.10)
|
|
28
|
+
activesupport (= 4.1.10)
|
|
29
|
+
builder (~> 3.1)
|
|
30
|
+
erubis (~> 2.7.0)
|
|
31
|
+
active_utils (3.0.0)
|
|
32
|
+
activesupport (>= 3.2)
|
|
33
|
+
i18n
|
|
34
|
+
activemerchant (1.48.0)
|
|
35
|
+
activesupport (>= 3.2.14, < 5.0.0)
|
|
36
|
+
builder (>= 2.1.2, < 4.0.0)
|
|
37
|
+
i18n (>= 0.6.9)
|
|
38
|
+
nokogiri (~> 1.4)
|
|
39
|
+
activemodel (4.1.10)
|
|
40
|
+
activesupport (= 4.1.10)
|
|
41
|
+
builder (~> 3.1)
|
|
42
|
+
activerecord (4.1.10)
|
|
43
|
+
activemodel (= 4.1.10)
|
|
44
|
+
activesupport (= 4.1.10)
|
|
45
|
+
arel (~> 5.0.0)
|
|
46
|
+
activerecord-bogacs (0.3.0)
|
|
47
|
+
thread_safe (~> 0.3)
|
|
48
|
+
activerecord-jdbc-adapter (1.3.16)
|
|
49
|
+
activerecord (>= 2.2)
|
|
50
|
+
activesupport (4.1.10)
|
|
51
|
+
i18n (~> 0.6, >= 0.6.9)
|
|
52
|
+
json (~> 1.7, >= 1.7.7)
|
|
53
|
+
minitest (~> 5.1)
|
|
54
|
+
thread_safe (~> 0.1)
|
|
55
|
+
tzinfo (~> 1.1)
|
|
56
|
+
arel (5.0.1.20140414130214)
|
|
57
|
+
builder (3.2.2)
|
|
58
|
+
diff-lcs (1.1.3)
|
|
59
|
+
erubis (2.7.0)
|
|
60
|
+
ethon (0.7.3)
|
|
61
|
+
ffi (>= 1.3.0)
|
|
62
|
+
ffi (1.9.8-java)
|
|
63
|
+
i18n (0.7.0)
|
|
64
|
+
jbundler (0.4.3)
|
|
65
|
+
maven-tools (~> 0.32.1)
|
|
66
|
+
ruby-maven (~> 3.0.4)
|
|
67
|
+
jdbc-mariadb (1.1.8)
|
|
68
|
+
jdbc-sqlite3 (3.8.7)
|
|
69
|
+
jruby-openssl (0.9.7-java)
|
|
70
|
+
json (1.8.2-java)
|
|
71
|
+
killbill (4.0.0)
|
|
72
|
+
rack (>= 1.5.2)
|
|
73
|
+
sinatra (~> 1.3.4)
|
|
74
|
+
typhoeus (~> 0.6.9)
|
|
75
|
+
tzinfo (~> 1.2.0)
|
|
76
|
+
maven-tools (0.32.5)
|
|
77
|
+
minitest (5.6.1)
|
|
78
|
+
monetize (1.1.0)
|
|
79
|
+
money (~> 6.5.0)
|
|
80
|
+
money (6.5.1)
|
|
81
|
+
i18n (>= 0.6.4, <= 0.7.0)
|
|
82
|
+
nokogiri (1.6.6.2-java)
|
|
83
|
+
offsite_payments (2.1.0)
|
|
84
|
+
actionpack (>= 3.2.20, < 5.0.0)
|
|
85
|
+
active_utils (~> 3.0.0)
|
|
86
|
+
activesupport (>= 3.2.14, < 5.0.0)
|
|
87
|
+
builder (>= 2.1.2, < 4.0.0)
|
|
88
|
+
i18n (~> 0.5)
|
|
89
|
+
money (>= 5.0.0, < 7.0.0)
|
|
90
|
+
nokogiri (~> 1.4)
|
|
91
|
+
rack (1.5.3)
|
|
92
|
+
rack-protection (1.5.3)
|
|
93
|
+
rack
|
|
94
|
+
rack-test (0.6.3)
|
|
95
|
+
rack (>= 1.0)
|
|
96
|
+
rake (10.4.2)
|
|
97
|
+
rspec (2.12.0)
|
|
98
|
+
rspec-core (~> 2.12.0)
|
|
99
|
+
rspec-expectations (~> 2.12.0)
|
|
100
|
+
rspec-mocks (~> 2.12.0)
|
|
101
|
+
rspec-core (2.12.2)
|
|
102
|
+
rspec-expectations (2.12.1)
|
|
103
|
+
diff-lcs (~> 1.1.3)
|
|
104
|
+
rspec-mocks (2.12.2)
|
|
105
|
+
ruby-maven (3.0.4.1.4)
|
|
106
|
+
maven-tools (~> 0.32.3)
|
|
107
|
+
thor (>= 0.14.6, < 2.0)
|
|
108
|
+
sinatra (1.3.6)
|
|
109
|
+
rack (~> 1.4)
|
|
110
|
+
rack-protection (~> 1.3)
|
|
111
|
+
tilt (~> 1.3, >= 1.3.3)
|
|
112
|
+
thor (0.19.1)
|
|
113
|
+
thread_safe (0.3.5-java)
|
|
114
|
+
tilt (1.4.1)
|
|
115
|
+
typhoeus (0.6.9)
|
|
116
|
+
ethon (>= 0.7.1)
|
|
117
|
+
tzinfo (1.2.2)
|
|
118
|
+
thread_safe (~> 0.1)
|
|
119
|
+
|
|
120
|
+
PLATFORMS
|
|
121
|
+
java
|
|
122
|
+
|
|
123
|
+
DEPENDENCIES
|
|
124
|
+
jbundler (~> 0.4.3)
|
|
125
|
+
jdbc-mariadb (~> 1.1)
|
|
126
|
+
jdbc-sqlite3 (~> 3.7)
|
|
127
|
+
killbill-paypal-express!
|
|
128
|
+
rake (>= 10.0.0)
|
|
129
|
+
rspec (~> 2.12.0)
|
data/Jarfile
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
jar 'org.kill-bill.billing:killbill-api', '0.
|
|
2
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-
|
|
3
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-
|
|
4
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-
|
|
5
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-
|
|
6
|
-
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-
|
|
7
|
-
jar 'org.kill-bill.billing:killbill-util:tests', '0.
|
|
8
|
-
jar '
|
|
1
|
+
jar 'org.kill-bill.billing:killbill-api', '0.14'
|
|
2
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-currency', '0.9'
|
|
3
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-invoice', '0.9'
|
|
4
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-notification', '0.9'
|
|
5
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-payment', '0.9'
|
|
6
|
+
jar 'org.kill-bill.billing.plugin:killbill-plugin-api-routing', '0.9'
|
|
7
|
+
jar 'org.kill-bill.billing:killbill-util:tests', '0.13.7'
|
|
8
|
+
jar 'org.mockito:mockito-all', '1.10.19'
|
|
9
|
+
jar 'javax.servlet:javax.servlet-api', '3.1.0'
|
data/Jarfile.lock
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
org.kill-bill.billing:killbill-api:jar:0.14
|
|
2
|
+
com.fasterxml.jackson.core:jackson-annotations:jar:2.4.3
|
|
3
|
+
joda-time:joda-time:jar:2.3
|
|
4
|
+
org.kill-bill.billing.plugin:killbill-plugin-api-currency:jar:0.9
|
|
5
|
+
org.kill-bill.billing.plugin:killbill-plugin-api-invoice:jar:0.9
|
|
6
|
+
org.kill-bill.billing.plugin:killbill-plugin-api-notification:jar:0.9
|
|
7
|
+
org.kill-bill.billing.plugin:killbill-plugin-api-payment:jar:0.9
|
|
8
|
+
org.kill-bill.billing.plugin:killbill-plugin-api-routing:jar:0.9
|
|
9
|
+
org.kill-bill.billing:killbill-util:jar:tests:0.13.7
|
|
10
|
+
com.fasterxml.jackson.core:jackson-databind:jar:2.4.3
|
|
11
|
+
com.fasterxml.jackson.core:jackson-core:jar:2.4.3
|
|
12
|
+
com.fasterxml.jackson.dataformat:jackson-dataformat-csv:jar:2.4.3
|
|
13
|
+
com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.4.3
|
|
14
|
+
com.samskivert:jmustache:jar:1.5
|
|
15
|
+
io.dropwizard.metrics:metrics-core:jar:3.1.1
|
|
16
|
+
io.dropwizard.metrics:metrics-ehcache:jar:3.1.1
|
|
17
|
+
net.sf.ehcache:ehcache:jar:2.9.1
|
|
18
|
+
org.antlr:stringtemplate:jar:3.2.1
|
|
19
|
+
antlr:antlr:jar:2.7.7
|
|
20
|
+
org.apache.commons:commons-email:jar:1.2
|
|
21
|
+
javax.mail:mail:jar:1.4.1
|
|
22
|
+
javax.activation:activation:jar:1.1
|
|
23
|
+
org.apache.shiro:shiro-core:jar:1.2.3
|
|
24
|
+
commons-beanutils:commons-beanutils:jar:1.8.3
|
|
25
|
+
org.apache.shiro:shiro-ehcache:jar:1.2.3
|
|
26
|
+
org.apache.shiro:shiro-guice:jar:1.2.3
|
|
27
|
+
com.google.guava:guava:jar:r09
|
|
28
|
+
com.google.inject:guice:jar:3.0
|
|
29
|
+
aopalliance:aopalliance:jar:1.0
|
|
30
|
+
com.google.inject.extensions:guice-multibindings:jar:3.0
|
|
31
|
+
org.jdbi:jdbi:jar:2.62
|
|
32
|
+
org.joda:joda-money:jar:0.9
|
|
33
|
+
org.kill-bill.billing:killbill-internal-api:jar:0.13.7
|
|
34
|
+
org.kill-bill.billing:killbill-platform-api:jar:0.2
|
|
35
|
+
org.kill-bill.billing:killbill-platform-base:jar:0.2
|
|
36
|
+
com.google.code.findbugs:annotations:jar:3.0.0
|
|
37
|
+
org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4:jar:1.16
|
|
38
|
+
org.kill-bill.billing:killbill-platform-osgi-api:jar:0.2
|
|
39
|
+
org.osgi:org.osgi.core:jar:5.0.0
|
|
40
|
+
org.kill-bill.commons:killbill-clock:jar:0.3
|
|
41
|
+
org.kill-bill.commons:killbill-concurrent:jar:0.3
|
|
42
|
+
org.kill-bill.commons:killbill-embeddeddb-common:jar:0.3
|
|
43
|
+
org.kill-bill.commons:killbill-jdbi:jar:0.3
|
|
44
|
+
com.h2database:h2:jar:1.4.186
|
|
45
|
+
javax.inject:javax.inject:jar:1
|
|
46
|
+
org.kill-bill.commons:killbill-locker:jar:0.3
|
|
47
|
+
org.kill-bill.commons:killbill-queue:jar:0.3
|
|
48
|
+
org.kill-bill.commons:killbill-xmlloader:jar:0.3
|
|
49
|
+
org.skife.config:config-magic:jar:0.14
|
|
50
|
+
org.slf4j:jcl-over-slf4j:jar:1.7.12
|
|
51
|
+
org.slf4j:slf4j-api:jar:1.7.12
|
|
52
|
+
org.weakref:jmxutils:jar:1.12
|
|
53
|
+
org.mockito:mockito-all:jar:1.10.19
|
|
54
|
+
javax.servlet:javax.servlet-api:jar:3.1.0
|
|
55
|
+
org.bouncycastle:bcpkix-jdk15on:jar:1.50
|
|
56
|
+
org.bouncycastle:bcprov-jdk15on:jar:1.50
|
data/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@ Apache License
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2014 The Billing Project, LLC
|
|
189
|
+
Copyright 2014-2015 The Billing Project, LLC
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -198,4 +198,4 @@ Apache License
|
|
|
198
198
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
199
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
200
|
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
201
|
+
limitations under the License.
|
data/NEWS
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
2.0.0
|
|
2
|
+
Initial release for Kill Bill 0.14.x
|
|
3
|
+
|
|
4
|
+
1.8.1
|
|
5
|
+
Fix add_payment_method to retrieve the token from the properties embedded in the payment_method data
|
|
6
|
+
|
|
7
|
+
1.8.0
|
|
8
|
+
Add missing require 'openssl'
|
|
9
|
+
|
|
10
|
+
1.7.1
|
|
11
|
+
Update to generated template
|
|
12
|
+
|
|
1
13
|
1.7.0
|
|
2
14
|
Update to latest killbill
|
|
3
15
|
Change groupId to org.kill-bill.billing.plugin.ruby
|
data/README.md
CHANGED
|
@@ -1,13 +1,46 @@
|
|
|
1
|
-
[](https://travis-ci.org/killbill/killbill-paypal-express-plugin)
|
|
2
|
-
[](https://codeclimate.com/github/killbill/killbill-paypal-express-plugin)
|
|
3
|
-
|
|
4
1
|
killbill-paypal-express-plugin
|
|
5
2
|
==============================
|
|
6
3
|
|
|
7
|
-
Plugin to use Express Checkout as a gateway.
|
|
4
|
+
Plugin to use [PayPal Express Checkout](https://www.paypal.com/webapps/mpp/express-checkout) as a gateway.
|
|
8
5
|
|
|
9
6
|
Release builds are available on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.kill-bill.billing.plugin.ruby%22%20AND%20a%3A%22paypal-express-plugin%22) with coordinates `org.kill-bill.billing.plugin.ruby:paypal-express-plugin`.
|
|
10
7
|
|
|
8
|
+
Kill Bill compatibility
|
|
9
|
+
-----------------------
|
|
10
|
+
|
|
11
|
+
| Plugin version | Kill Bill version |
|
|
12
|
+
| -------------: | ----------------: |
|
|
13
|
+
| 2.x.y | 0.14.z |
|
|
14
|
+
|
|
15
|
+
Requirements
|
|
16
|
+
------------
|
|
17
|
+
|
|
18
|
+
The plugin needs a database. The latest version of the schema can be found [here](https://github.com/killbill/killbill-paypal-express-plugin/blob/master/db/ddl.sql).
|
|
19
|
+
|
|
20
|
+
Configuration
|
|
21
|
+
-------------
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
curl -v \
|
|
25
|
+
-X POST \
|
|
26
|
+
-u admin:password \
|
|
27
|
+
-H 'X-Killbill-ApiKey: bob' \
|
|
28
|
+
-H 'X-Killbill-ApiSecret: lazar' \
|
|
29
|
+
-H 'X-Killbill-CreatedBy: admin' \
|
|
30
|
+
-H 'Content-Type: text/plain' \
|
|
31
|
+
-d ':paypal_express:
|
|
32
|
+
:signature: "your-paypal-signature"
|
|
33
|
+
:login: "your-username-facilitator.something.com"
|
|
34
|
+
:password: "your-password"' \
|
|
35
|
+
http://127.0.0.1:8080/1.0/kb/tenants/uploadPluginConfig/killbill-paypal-express
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
To go to production, create a `paypal_express.yml` configuration file under `/var/tmp/bundles/plugins/ruby/killbill-paypal-express/x.y.z/` containing the following:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
:paypal_express:
|
|
42
|
+
:test: false
|
|
43
|
+
```
|
|
11
44
|
|
|
12
45
|
Usage
|
|
13
46
|
-----
|
|
@@ -17,8 +50,12 @@ Issue the following call to generate a Paypal token:
|
|
|
17
50
|
```
|
|
18
51
|
curl -v \
|
|
19
52
|
-X POST \
|
|
20
|
-
-
|
|
21
|
-
|
|
53
|
+
-u admin:password \
|
|
54
|
+
-H 'X-Killbill-ApiKey: bob' \
|
|
55
|
+
-H 'X-Killbill-ApiSecret: lazar' \
|
|
56
|
+
-H 'X-Killbill-CreatedBy: admin' \
|
|
57
|
+
-H 'Content-Type: application/json' \
|
|
58
|
+
-d '{
|
|
22
59
|
"kb_account_id": "13d26090-b8d7-11e2-9e96-0800200c9a66",
|
|
23
60
|
"currency": "USD",
|
|
24
61
|
"options": {
|
|
@@ -29,7 +66,7 @@ curl -v \
|
|
|
29
66
|
}
|
|
30
67
|
}
|
|
31
68
|
}' \
|
|
32
|
-
|
|
69
|
+
http://127.0.0.1:8080/plugins/killbill-paypal-express/1.0/setup-checkout
|
|
33
70
|
```
|
|
34
71
|
|
|
35
72
|
Kill Bill will return a 302 Found on success. The customer should be redirected to the url specified in the Location header, e.g. https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-20G53990M6953444J.
|
|
@@ -39,10 +76,12 @@ Once the customer comes back from the PayPal flow, save the BAID in Kill Bill:
|
|
|
39
76
|
```
|
|
40
77
|
curl -v \
|
|
41
78
|
-X POST \
|
|
42
|
-
-
|
|
43
|
-
-H
|
|
44
|
-
-H
|
|
45
|
-
|
|
79
|
+
-u admin:password \
|
|
80
|
+
-H 'X-Killbill-ApiKey: bob' \
|
|
81
|
+
-H 'X-Killbill-ApiSecret: lazar' \
|
|
82
|
+
-H 'X-Killbill-CreatedBy: admin' \
|
|
83
|
+
-H 'Content-Type: application/json' \
|
|
84
|
+
-d '{
|
|
46
85
|
"pluginName": "killbill-paypal-express",
|
|
47
86
|
"pluginInfo": {
|
|
48
87
|
"properties": [{
|
|
@@ -51,45 +90,5 @@ curl -v \
|
|
|
51
90
|
}]
|
|
52
91
|
}
|
|
53
92
|
}' \
|
|
54
|
-
"http
|
|
93
|
+
"http://127.0.0.1:8080/1.0/kb/accounts/13d26090-b8d7-11e2-9e96-0800200c9a66/paymentMethods?isDefault=true"
|
|
55
94
|
```
|
|
56
|
-
|
|
57
|
-
To display the payment method details for that account, one can call:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
curl -v \
|
|
61
|
-
"http://$HOST:8080/1.0/kb/accounts/13d26090-b8d7-11e2-9e96-0800200c9a66/paymentMethods?withPluginInfo=true"
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Requirements
|
|
65
|
-
------------
|
|
66
|
-
|
|
67
|
-
The plugin needs a database. The latest version of the schema can be found here: https://raw.github.com/killbill/killbill-paypal-express-plugin/master/db/ddl.sql.
|
|
68
|
-
|
|
69
|
-
Configuration
|
|
70
|
-
-------------
|
|
71
|
-
|
|
72
|
-
The plugin expects a `paypal_express.yml` configuration file containing the following:
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
:paypal_express:
|
|
76
|
-
:signature: 'your-paypal-signature'
|
|
77
|
-
:login: 'your-username-facilitator.something.com'
|
|
78
|
-
:password: 'your-password'
|
|
79
|
-
:log_file: '/var/tmp/paypal.log'
|
|
80
|
-
# Switch to false for production
|
|
81
|
-
:test: true
|
|
82
|
-
|
|
83
|
-
:database:
|
|
84
|
-
:adapter: 'sqlite3'
|
|
85
|
-
:database: 'test.db'
|
|
86
|
-
# For MySQL
|
|
87
|
-
# :adapter: 'jdbc'
|
|
88
|
-
# :username: 'your-username'
|
|
89
|
-
# :password: 'your-password'
|
|
90
|
-
# :driver: 'com.mysql.jdbc.Driver'
|
|
91
|
-
# :url: 'jdbc:mysql://127.0.0.1:3306/your-database'
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
By default, the plugin will look at the plugin directory root (where `killbill.properties` is located) to find this file.
|
|
95
|
-
Alternatively, set the Kill Bill system property `-Dorg.killbill.billing.osgi.bundles.jruby.conf.dir=/my/directory` to specify another location.
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2.0.0
|
data/db/ddl.sql
CHANGED
|
@@ -7,10 +7,10 @@ CREATE TABLE `paypal_express_payment_methods` (
|
|
|
7
7
|
`cc_first_name` varchar(255) DEFAULT NULL,
|
|
8
8
|
`cc_last_name` varchar(255) DEFAULT NULL,
|
|
9
9
|
`cc_type` varchar(255) DEFAULT NULL,
|
|
10
|
-
`cc_exp_month`
|
|
11
|
-
`cc_exp_year`
|
|
12
|
-
`cc_number`
|
|
13
|
-
`cc_last_4`
|
|
10
|
+
`cc_exp_month` varchar(255) DEFAULT NULL,
|
|
11
|
+
`cc_exp_year` varchar(255) DEFAULT NULL,
|
|
12
|
+
`cc_number` varchar(255) DEFAULT NULL,
|
|
13
|
+
`cc_last_4` varchar(255) DEFAULT NULL,
|
|
14
14
|
`cc_start_month` varchar(255) DEFAULT NULL,
|
|
15
15
|
`cc_start_year` varchar(255) DEFAULT NULL,
|
|
16
16
|
`cc_issue_number` varchar(255) DEFAULT NULL,
|
data/db/schema.rb
CHANGED
|
@@ -9,15 +9,15 @@ ActiveRecord::Schema.define(:version => 20140410153635) do
|
|
|
9
9
|
t.string "cc_first_name"
|
|
10
10
|
t.string "cc_last_name"
|
|
11
11
|
t.string "cc_type"
|
|
12
|
-
t.
|
|
13
|
-
t.
|
|
14
|
-
t.
|
|
15
|
-
t.
|
|
16
|
-
t.
|
|
17
|
-
t.
|
|
18
|
-
t.
|
|
19
|
-
t.
|
|
20
|
-
t.
|
|
12
|
+
t.string "cc_exp_month"
|
|
13
|
+
t.string "cc_exp_year"
|
|
14
|
+
t.string "cc_number"
|
|
15
|
+
t.string "cc_last_4"
|
|
16
|
+
t.string "cc_start_month"
|
|
17
|
+
t.string "cc_start_year"
|
|
18
|
+
t.string "cc_issue_number"
|
|
19
|
+
t.string "cc_verification_value"
|
|
20
|
+
t.string "cc_track_data"
|
|
21
21
|
t.string "address1"
|
|
22
22
|
t.string "address2"
|
|
23
23
|
t.string "city"
|
|
@@ -12,37 +12,40 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
|
|
13
13
|
s.author = 'Kill Bill core team'
|
|
14
14
|
s.email = 'killbilling-users@googlegroups.com'
|
|
15
|
-
s.homepage = 'http://
|
|
15
|
+
s.homepage = 'http://killbill.io'
|
|
16
16
|
|
|
17
17
|
s.files = `git ls-files`.split("\n")
|
|
18
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
19
19
|
s.bindir = 'bin'
|
|
20
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
20
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
|
21
21
|
s.require_paths = ['lib']
|
|
22
22
|
|
|
23
23
|
s.rdoc_options << '--exclude' << '.'
|
|
24
24
|
|
|
25
|
-
s.add_dependency 'killbill', '~>
|
|
26
|
-
|
|
27
|
-
s.add_dependency 'offsite_payments', '~> 2.0.1'
|
|
28
|
-
s.add_dependency 'activerecord', '~> 4.1.0'
|
|
29
|
-
s.add_dependency 'actionpack', '~> 4.1.0'
|
|
30
|
-
s.add_dependency 'actionview', '~> 4.1.0'
|
|
31
|
-
s.add_dependency 'activesupport', '~> 4.1.0'
|
|
32
|
-
s.add_dependency 'money', '~> 6.1.1'
|
|
33
|
-
s.add_dependency 'monetize', '~> 0.3.0'
|
|
25
|
+
s.add_dependency 'killbill', '~> 4.0.0'
|
|
26
|
+
|
|
34
27
|
s.add_dependency 'sinatra', '~> 1.3.4'
|
|
28
|
+
s.add_dependency 'thread_safe', '~> 0.3.4'
|
|
29
|
+
s.add_dependency 'activerecord', '~> 4.1.0'
|
|
35
30
|
if defined?(JRUBY_VERSION)
|
|
36
|
-
s.add_dependency 'activerecord-
|
|
31
|
+
s.add_dependency 'activerecord-bogacs', '~> 0.3'
|
|
32
|
+
s.add_dependency 'activerecord-jdbc-adapter', '~> 1.3'
|
|
37
33
|
# Required to avoid errors like java.lang.NoClassDefFoundError: org/bouncycastle/asn1/DERBoolean
|
|
38
|
-
s.add_dependency 'jruby-openssl', '~> 0.9.
|
|
34
|
+
s.add_dependency 'jruby-openssl', '~> 0.9.6'
|
|
39
35
|
end
|
|
36
|
+
s.add_dependency 'actionpack', '~> 4.1.0'
|
|
37
|
+
s.add_dependency 'actionview', '~> 4.1.0'
|
|
38
|
+
s.add_dependency 'activemerchant', '~> 1.48.0'
|
|
39
|
+
s.add_dependency 'offsite_payments', '~> 2.1.0'
|
|
40
|
+
s.add_dependency 'monetize', '~> 1.1.0'
|
|
41
|
+
s.add_dependency 'money', '~> 6.5.1'
|
|
40
42
|
|
|
41
|
-
s.add_development_dependency 'jbundler', '~> 0.4.
|
|
43
|
+
s.add_development_dependency 'jbundler', '~> 0.4.3'
|
|
42
44
|
s.add_development_dependency 'rake', '>= 10.0.0'
|
|
43
45
|
s.add_development_dependency 'rspec', '~> 2.12.0'
|
|
44
46
|
if defined?(JRUBY_VERSION)
|
|
45
|
-
s.add_development_dependency '
|
|
47
|
+
s.add_development_dependency 'jdbc-sqlite3', '~> 3.7'
|
|
48
|
+
s.add_development_dependency 'jdbc-mariadb', '~> 1.1'
|
|
46
49
|
else
|
|
47
50
|
s.add_development_dependency 'sqlite3', '~> 1.3.7'
|
|
48
51
|
end
|
data/lib/paypal_express.rb
CHANGED
data/lib/paypal_express/api.rb
CHANGED
|
@@ -18,6 +18,14 @@ module Killbill #:nodoc:
|
|
|
18
18
|
@ip = ::Killbill::Plugin::ActiveMerchant::Utils.ip
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
+
def on_event(event)
|
|
22
|
+
# Require to deal with per tenant configuration invalidation
|
|
23
|
+
super(event)
|
|
24
|
+
#
|
|
25
|
+
# Custom event logic could be added below...
|
|
26
|
+
#
|
|
27
|
+
end
|
|
28
|
+
|
|
21
29
|
def authorize_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
|
|
22
30
|
# Pass extra parameters for the gateway here
|
|
23
31
|
options = {}
|
|
@@ -113,17 +121,19 @@ module Killbill #:nodoc:
|
|
|
113
121
|
end
|
|
114
122
|
|
|
115
123
|
def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context)
|
|
116
|
-
# token is passed
|
|
117
|
-
token = (
|
|
118
|
-
|
|
124
|
+
# token is passed via properties
|
|
125
|
+
token = find_value_from_properties(properties, 'token')
|
|
126
|
+
# token is passed from the json body
|
|
127
|
+
token = find_value_from_properties(payment_method_props.properties, 'token') if token.nil?
|
|
128
|
+
raise 'No token specified!' if token.nil?
|
|
119
129
|
|
|
120
130
|
# Go to Paypal to get the Payer id (GetExpressCheckoutDetails call)
|
|
121
131
|
options = properties_to_hash(properties)
|
|
122
132
|
payment_processor_account_id = options[:payment_processor_account_id] || :default
|
|
123
|
-
gateway = lookup_gateway(payment_processor_account_id)
|
|
133
|
+
gateway = lookup_gateway(payment_processor_account_id, context.tenant_id)
|
|
124
134
|
gw_response = gateway.details_for(token)
|
|
125
135
|
response, transaction = save_response_and_transaction(gw_response, :details_for, kb_account_id, context.tenant_id, payment_processor_account_id)
|
|
126
|
-
|
|
136
|
+
raise response.message unless response.success? and !response.payer_id.blank?
|
|
127
137
|
|
|
128
138
|
# Pass extra parameters for the gateway here
|
|
129
139
|
options = {
|
|
@@ -203,9 +213,9 @@ module Killbill #:nodoc:
|
|
|
203
213
|
end
|
|
204
214
|
end
|
|
205
215
|
|
|
206
|
-
def to_express_checkout_url(response, options = {})
|
|
216
|
+
def to_express_checkout_url(response, kb_tenant_id, options = {})
|
|
207
217
|
payment_processor_account_id = options[:payment_processor_account_id] || :default
|
|
208
|
-
gateway = lookup_gateway(payment_processor_account_id)
|
|
218
|
+
gateway = lookup_gateway(payment_processor_account_id, kb_tenant_id)
|
|
209
219
|
gateway.redirect_url_for(response.token)
|
|
210
220
|
end
|
|
211
221
|
|
|
@@ -60,16 +60,19 @@ post '/plugins/killbill-paypal-express/1.0/setup-checkout', :provides => 'json'
|
|
|
60
60
|
halt 400, {'Content-Type' => 'text/plain'}, "Invalid payload: #{e}"
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
kb_tenant_id = data['kb_tenant_id'] || request.env['killbill_tenant'].id.to_s
|
|
64
|
+
options = (data['options'] || {}).deep_symbolize_keys
|
|
65
|
+
|
|
63
66
|
response = plugin.initiate_express_checkout data['kb_account_id'],
|
|
64
|
-
|
|
67
|
+
kb_tenant_id,
|
|
65
68
|
data['amount_in_cents'] || 0,
|
|
66
69
|
data['currency'] || 'USD',
|
|
67
|
-
|
|
70
|
+
options
|
|
68
71
|
unless response.success?
|
|
69
72
|
status 500
|
|
70
73
|
response.message
|
|
71
74
|
else
|
|
72
|
-
redirect plugin.to_express_checkout_url(response)
|
|
75
|
+
redirect plugin.to_express_checkout_url(response, kb_tenant_id, options)
|
|
73
76
|
end
|
|
74
77
|
end
|
|
75
78
|
|
|
@@ -21,9 +21,9 @@ module Killbill #:nodoc:
|
|
|
21
21
|
def to_payment_method_plugin
|
|
22
22
|
pm_plugin = super
|
|
23
23
|
|
|
24
|
-
pm_plugin.properties <<
|
|
25
|
-
pm_plugin.properties <<
|
|
26
|
-
pm_plugin.properties <<
|
|
24
|
+
pm_plugin.properties << create_plugin_property('paypalExpressToken', paypal_express_token)
|
|
25
|
+
pm_plugin.properties << create_plugin_property('payerId', paypal_express_payer_id)
|
|
26
|
+
pm_plugin.properties << create_plugin_property('baid', token)
|
|
27
27
|
|
|
28
28
|
pm_plugin
|
|
29
29
|
end
|
|
@@ -24,15 +24,16 @@ module Killbill #:nodoc:
|
|
|
24
24
|
options[:billing_agreement][:description] ||= 'Kill Bill billing agreement'
|
|
25
25
|
|
|
26
26
|
# Go to Paypal (SetExpressCheckout call)
|
|
27
|
-
|
|
27
|
+
payment_processor_account_id = options[:payment_processor_account_id] || :default
|
|
28
|
+
paypal_express_response = gateway(payment_processor_account_id, kb_tenant_id).setup_authorization(amount_in_cents, options)
|
|
28
29
|
response, transaction = save_response_and_transaction(paypal_express_response, :initiate_express_checkout, kb_account_id, kb_tenant_id, payment_processor_account_id)
|
|
29
30
|
|
|
30
31
|
response
|
|
31
32
|
end
|
|
32
33
|
|
|
33
|
-
def to_express_checkout_url(response, options = {})
|
|
34
|
+
def to_express_checkout_url(response, kb_tenant_id = nil, options = {})
|
|
34
35
|
payment_processor_account_id = options[:payment_processor_account_id] || :default
|
|
35
|
-
gateway = gateway(payment_processor_account_id)
|
|
36
|
+
gateway = gateway(payment_processor_account_id, kb_tenant_id)
|
|
36
37
|
gateway.redirect_url_for(response.token)
|
|
37
38
|
end
|
|
38
39
|
end
|
data/paypal_express.yml
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
:paypal_express:
|
|
2
|
-
:signature:
|
|
3
|
-
:login:
|
|
4
|
-
:password:
|
|
2
|
+
:signature: <%= ENV['SIGNATURE'] %>
|
|
3
|
+
:login: <%= ENV['LOGIN'] %>
|
|
4
|
+
:password: <%= ENV['PASSWORD'] %>
|
|
5
5
|
:test: true
|
|
6
|
-
:log_file: /var/tmp/paypal_express.log
|
|
7
6
|
|
|
8
7
|
:database:
|
|
8
|
+
# SQLite (development)
|
|
9
9
|
:adapter: sqlite3
|
|
10
10
|
:database: test.db
|
|
11
11
|
# For MySQL
|
|
12
|
-
# :adapter:
|
|
12
|
+
# :adapter: mysql
|
|
13
13
|
# :username: 'killbill'
|
|
14
14
|
# :password: 'killbill'
|
|
15
|
-
# :
|
|
16
|
-
#
|
|
15
|
+
# :database: 'killbill' # or set the URL :
|
|
16
|
+
# #:url: jdbc:mysql://127.0.0.1:3306/killbill
|
|
17
|
+
# :driver: org.mariadb.jdbc.Driver # as in KB
|
|
18
|
+
# :pool: 30 # AR's default is max 5 connections
|
|
17
19
|
# In Kill Bill
|
|
18
|
-
# :adapter:
|
|
20
|
+
# :adapter: mysql
|
|
19
21
|
# :jndi: 'killbill/osgi/jdbc'
|
|
20
|
-
# :
|
|
21
|
-
#
|
|
22
|
-
# :
|
|
22
|
+
# :pool: false # false-pool (JNDI pool's max)
|
|
23
|
+
# # uncomment if pool does not support JDBC4 :
|
|
24
|
+
# #:connection_alive_sql: 'select 1'
|
|
25
|
+
# # MySQL adapter #configure_connection defaults :
|
|
26
|
+
# # @@SESSION.sql_auto_is_null = 0,
|
|
27
|
+
# # @@SESSION.wait_timeout = 2147483,
|
|
28
|
+
# # @@SESSION.sql_mode = 'STRICT_ALL_TABLES'
|
|
29
|
+
# # ... can be disabled (on AR-JDBC 1.4) using :
|
|
30
|
+
# :configure_connection: false
|
data/pom.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<!--
|
|
3
3
|
~ Copyright 2010-2013 Ning, Inc.
|
|
4
|
-
~ Copyright 2014 The Billing Project, LLC
|
|
4
|
+
~ Copyright 2014-2015 The Billing Project, LLC
|
|
5
5
|
~
|
|
6
6
|
~ The Billing Project licenses this file to you under the Apache License, version 2.0
|
|
7
7
|
~ (the "License"); you may not use this file except in compliance with the
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<groupId>org.kill-bill.billing.plugin.ruby</groupId>
|
|
27
27
|
<artifactId>paypal-express-plugin</artifactId>
|
|
28
28
|
<packaging>pom</packaging>
|
|
29
|
-
<version>
|
|
29
|
+
<version>2.0.0</version>
|
|
30
30
|
<name>paypal-express-plugin</name>
|
|
31
31
|
<url>http://github.com/killbill/killbill-paypal-express-plugin</url>
|
|
32
32
|
<description>Plugin for accessing Paypal Express Checkout as a payment gateway</description>
|
data/release.sh
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
set -e
|
|
2
2
|
|
|
3
|
+
BUNDLE=${BUNDLE-"bundle exec"}
|
|
4
|
+
MVN=${MVN-"mvn"}
|
|
5
|
+
|
|
3
6
|
if [ 'GNU' != "$(tar --help | grep GNU | head -1 | awk '{print $1}')" ]; then
|
|
4
7
|
echo 'Unable to release: make sure to use GNU tar'
|
|
5
8
|
exit 1
|
|
@@ -14,28 +17,45 @@ else
|
|
|
14
17
|
fi
|
|
15
18
|
|
|
16
19
|
VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
|
|
17
|
-
if [ "$VERSION" != "$(cat $PWD/VERSION)" ]; then
|
|
20
|
+
if [[ -z "$NO_RELEASE" && "$VERSION" != "$(cat $PWD/VERSION)" ]]; then
|
|
18
21
|
echo 'Unable to release: make sure the versions in pom.xml and VERSION match'
|
|
19
22
|
exit 1
|
|
20
23
|
fi
|
|
21
24
|
|
|
22
25
|
echo 'Cleaning up'
|
|
23
|
-
rake killbill:clean
|
|
26
|
+
$BUNDLE rake killbill:clean
|
|
27
|
+
|
|
28
|
+
echo 'Building gem'
|
|
29
|
+
$BUNDLE rake build
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
if [[ -z "$NO_RELEASE" ]]; then
|
|
32
|
+
echo 'Pushing the gem to Rubygems'
|
|
33
|
+
$BUNDLE rake release
|
|
34
|
+
fi
|
|
27
35
|
|
|
28
36
|
echo 'Building artifact'
|
|
29
|
-
rake killbill:package
|
|
37
|
+
$BUNDLE rake killbill:package
|
|
30
38
|
|
|
31
39
|
ARTIFACT="$PWD/pkg/killbill-paypal-express-$VERSION.tar.gz"
|
|
32
40
|
echo "Pushing $ARTIFACT to Maven Central"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
if [[ -z "$NO_RELEASE" ]]; then
|
|
43
|
+
GOAL=gpg:sign-and-deploy-file
|
|
44
|
+
REPOSITORY_ID=ossrh-releases
|
|
45
|
+
URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
|
|
46
|
+
else
|
|
47
|
+
GOAL=deploy:deploy-file
|
|
48
|
+
REPOSITORY_ID=sonatype-nexus-snapshots
|
|
49
|
+
URL=https://oss.sonatype.org/content/repositories/snapshots/
|
|
50
|
+
VERSION="$VERSION-SNAPSHOT"
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
$MVN $GOAL \
|
|
54
|
+
-DgroupId=org.kill-bill.billing.plugin.ruby \
|
|
55
|
+
-DartifactId=paypal-express-plugin \
|
|
56
|
+
-Dversion=$VERSION \
|
|
57
|
+
-Dpackaging=tar.gz \
|
|
58
|
+
-DrepositoryId=$REPOSITORY_ID \
|
|
59
|
+
-Durl=$URL \
|
|
60
|
+
-Dfile=$ARTIFACT \
|
|
61
|
+
-DpomFile=pom.xml
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
describe Killbill::PaypalExpress::PaymentPlugin do
|
|
4
|
+
|
|
5
|
+
include ::Killbill::Plugin::ActiveMerchant::RSpec
|
|
6
|
+
|
|
4
7
|
before(:each) do
|
|
5
8
|
Dir.mktmpdir do |dir|
|
|
6
9
|
file = File.new(File.join(dir, 'paypal_express.yml'), 'w+')
|
|
@@ -17,11 +20,7 @@ describe Killbill::PaypalExpress::PaymentPlugin do
|
|
|
17
20
|
eos
|
|
18
21
|
file.close
|
|
19
22
|
|
|
20
|
-
@plugin
|
|
21
|
-
@plugin.logger = Logger.new(STDOUT)
|
|
22
|
-
@plugin.logger.level = Logger::INFO
|
|
23
|
-
@plugin.conf_dir = File.dirname(file)
|
|
24
|
-
@plugin.kb_apis = Killbill::Plugin::KillbillApi.new('paypal_express', {})
|
|
23
|
+
@plugin = build_plugin(::Killbill::PaypalExpress::PaymentPlugin, 'paypal_express', File.dirname(file))
|
|
25
24
|
|
|
26
25
|
# Start the plugin here - since the config file will be deleted
|
|
27
26
|
@plugin.start_plugin
|
|
@@ -8,39 +8,28 @@ describe Killbill::PaypalExpress::PaymentPlugin do
|
|
|
8
8
|
|
|
9
9
|
# Share the BAID
|
|
10
10
|
before(:all) do
|
|
11
|
-
@plugin = Killbill::PaypalExpress::PaymentPlugin
|
|
12
|
-
|
|
13
|
-
@payment_api = ::Killbill::Plugin::ActiveMerchant::RSpec::FakeJavaPaymentApi.new
|
|
14
|
-
@account_api = ::Killbill::Plugin::ActiveMerchant::RSpec::FakeJavaUserAccountApi.new
|
|
15
|
-
svcs = {:account_user_api => @account_api, :payment_api => @payment_api}
|
|
16
|
-
@plugin.kb_apis = Killbill::Plugin::KillbillApi.new('paypal-express', svcs)
|
|
17
|
-
|
|
18
|
-
@call_context = ::Killbill::Plugin::Model::CallContext.new
|
|
19
|
-
@call_context.tenant_id = '00000011-0022-0033-0044-000000000055'
|
|
20
|
-
@call_context = @call_context.to_ruby(@call_context)
|
|
21
|
-
|
|
22
|
-
@plugin.logger = Logger.new(STDOUT)
|
|
23
|
-
@plugin.logger.level = Logger::INFO
|
|
24
|
-
@plugin.conf_dir = File.expand_path(File.dirname(__FILE__) + '../../../../')
|
|
11
|
+
@plugin = build_plugin(::Killbill::PaypalExpress::PaymentPlugin, 'paypal_express')
|
|
25
12
|
@plugin.start_plugin
|
|
26
13
|
|
|
14
|
+
@call_context = build_call_context
|
|
15
|
+
|
|
27
16
|
@properties = []
|
|
28
|
-
@amount
|
|
29
|
-
@currency
|
|
17
|
+
@amount = BigDecimal.new('100')
|
|
18
|
+
@currency = 'USD'
|
|
30
19
|
|
|
31
|
-
kb_account_id
|
|
32
|
-
external_key, kb_account_id = create_kb_account(kb_account_id)
|
|
20
|
+
kb_account_id = SecureRandom.uuid
|
|
21
|
+
external_key, kb_account_id = create_kb_account(kb_account_id, @plugin.kb_apis.proxied_services[:account_user_api])
|
|
33
22
|
|
|
34
23
|
# Initiate the setup process
|
|
35
|
-
response
|
|
36
|
-
token
|
|
37
|
-
print "\nPlease go to #{@plugin.to_express_checkout_url(response)} to proceed and press any key to continue...
|
|
24
|
+
response = create_token(kb_account_id, @call_context.tenant_id)
|
|
25
|
+
token = response.token
|
|
26
|
+
print "\nPlease go to #{@plugin.to_express_checkout_url(response, @call_context.tenant_id)} to proceed and press any key to continue...
|
|
38
27
|
Note: you need to log-in with a paypal sandbox account (create one here: https://developer.paypal.com/webapps/developer/applications/accounts)\n"
|
|
39
28
|
$stdin.gets
|
|
40
29
|
|
|
41
30
|
# Complete the setup process
|
|
42
|
-
@properties <<
|
|
43
|
-
@pm
|
|
31
|
+
@properties << build_property('token', token)
|
|
32
|
+
@pm = create_payment_method(::Killbill::PaypalExpress::PaypalExpressPaymentMethod, kb_account_id, @call_context.tenant_id, @properties)
|
|
44
33
|
|
|
45
34
|
# Verify our table directly. Note that @pm.token is the baid
|
|
46
35
|
payment_methods = ::Killbill::PaypalExpress::PaypalExpressPaymentMethod.from_kb_account_id_and_token(@pm.token, kb_account_id, @call_context.tenant_id)
|
|
@@ -58,7 +47,7 @@ Note: you need to log-in with a paypal sandbox account (create one here: https:/
|
|
|
58
47
|
|
|
59
48
|
kb_payment_id = SecureRandom.uuid
|
|
60
49
|
1.upto(6) do
|
|
61
|
-
@kb_payment = @payment_api.add_payment(kb_payment_id)
|
|
50
|
+
@kb_payment = @plugin.kb_apis.proxied_services[:payment_api].add_payment(kb_payment_id)
|
|
62
51
|
end
|
|
63
52
|
end
|
|
64
53
|
|
|
@@ -74,7 +63,7 @@ Note: you need to log-in with a paypal sandbox account (create one here: https:/
|
|
|
74
63
|
|
|
75
64
|
# Try a full refund
|
|
76
65
|
refund_response = @plugin.refund_payment(@pm.kb_account_id, @kb_payment.id, @kb_payment.transactions[1].id, @pm.kb_payment_method_id, @amount, @currency, @properties, @call_context)
|
|
77
|
-
refund_response.status.should eq(:PROCESSED),
|
|
66
|
+
refund_response.status.should eq(:PROCESSED), refund_response.gateway_error
|
|
78
67
|
refund_response.amount.should == @amount
|
|
79
68
|
refund_response.transaction_type.should == :REFUND
|
|
80
69
|
end
|
|
@@ -96,7 +85,7 @@ Note: you need to log-in with a paypal sandbox account (create one here: https:/
|
|
|
96
85
|
|
|
97
86
|
# Try a partial refund
|
|
98
87
|
refund_response = @plugin.refund_payment(@pm.kb_account_id, @kb_payment.id, @kb_payment.transactions[4].id, @pm.kb_payment_method_id, partial_capture_amount, @currency, @properties, @call_context)
|
|
99
|
-
refund_response.status.should eq(:PROCESSED),
|
|
88
|
+
refund_response.status.should eq(:PROCESSED), refund_response.gateway_error
|
|
100
89
|
refund_response.amount.should == partial_capture_amount
|
|
101
90
|
refund_response.transaction_type.should == :REFUND
|
|
102
91
|
|
|
@@ -125,7 +114,7 @@ Note: you need to log-in with a paypal sandbox account (create one here: https:/
|
|
|
125
114
|
payment_response.transaction_type.should == :AUTHORIZE
|
|
126
115
|
|
|
127
116
|
partial_capture_amount = BigDecimal.new('10')
|
|
128
|
-
payment_response
|
|
117
|
+
payment_response = @plugin.capture_payment(@pm.kb_account_id, @kb_payment.id, @kb_payment.transactions[1].id, @pm.kb_payment_method_id, partial_capture_amount, @currency, @properties, @call_context)
|
|
129
118
|
payment_response.status.should eq(:PROCESSED), payment_response.gateway_error
|
|
130
119
|
payment_response.amount.should == partial_capture_amount
|
|
131
120
|
payment_response.transaction_type.should == :CAPTURE
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: killbill-paypal-express
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kill Bill core team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-05-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: killbill
|
|
@@ -16,40 +16,40 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ~>
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 4.0.0
|
|
20
20
|
requirement: !ruby/object:Gem::Requirement
|
|
21
21
|
requirements:
|
|
22
22
|
- - ~>
|
|
23
23
|
- !ruby/object:Gem::Version
|
|
24
|
-
version:
|
|
24
|
+
version: 4.0.0
|
|
25
25
|
prerelease: false
|
|
26
26
|
type: :runtime
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: sinatra
|
|
29
29
|
version_requirements: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - ~>
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 1.
|
|
33
|
+
version: 1.3.4
|
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
|
35
35
|
requirements:
|
|
36
36
|
- - ~>
|
|
37
37
|
- !ruby/object:Gem::Version
|
|
38
|
-
version: 1.
|
|
38
|
+
version: 1.3.4
|
|
39
39
|
prerelease: false
|
|
40
40
|
type: :runtime
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: thread_safe
|
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - ~>
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: 0.3.4
|
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
|
49
49
|
requirements:
|
|
50
50
|
- - ~>
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
|
-
version:
|
|
52
|
+
version: 0.3.4
|
|
53
53
|
prerelease: false
|
|
54
54
|
type: :runtime
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
@@ -67,35 +67,49 @@ dependencies:
|
|
|
67
67
|
prerelease: false
|
|
68
68
|
type: :runtime
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
70
|
+
name: activerecord-bogacs
|
|
71
71
|
version_requirements: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
73
|
- - ~>
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
75
|
+
version: '0.3'
|
|
76
76
|
requirement: !ruby/object:Gem::Requirement
|
|
77
77
|
requirements:
|
|
78
78
|
- - ~>
|
|
79
79
|
- !ruby/object:Gem::Version
|
|
80
|
-
version:
|
|
80
|
+
version: '0.3'
|
|
81
81
|
prerelease: false
|
|
82
82
|
type: :runtime
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
84
|
+
name: activerecord-jdbc-adapter
|
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
87
|
- - ~>
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version:
|
|
89
|
+
version: '1.3'
|
|
90
90
|
requirement: !ruby/object:Gem::Requirement
|
|
91
91
|
requirements:
|
|
92
92
|
- - ~>
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
|
-
version:
|
|
94
|
+
version: '1.3'
|
|
95
|
+
prerelease: false
|
|
96
|
+
type: :runtime
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: jruby-openssl
|
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ~>
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 0.9.6
|
|
104
|
+
requirement: !ruby/object:Gem::Requirement
|
|
105
|
+
requirements:
|
|
106
|
+
- - ~>
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: 0.9.6
|
|
95
109
|
prerelease: false
|
|
96
110
|
type: :runtime
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
112
|
+
name: actionpack
|
|
99
113
|
version_requirements: !ruby/object:Gem::Requirement
|
|
100
114
|
requirements:
|
|
101
115
|
- - ~>
|
|
@@ -109,73 +123,73 @@ dependencies:
|
|
|
109
123
|
prerelease: false
|
|
110
124
|
type: :runtime
|
|
111
125
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
126
|
+
name: actionview
|
|
113
127
|
version_requirements: !ruby/object:Gem::Requirement
|
|
114
128
|
requirements:
|
|
115
129
|
- - ~>
|
|
116
130
|
- !ruby/object:Gem::Version
|
|
117
|
-
version:
|
|
131
|
+
version: 4.1.0
|
|
118
132
|
requirement: !ruby/object:Gem::Requirement
|
|
119
133
|
requirements:
|
|
120
134
|
- - ~>
|
|
121
135
|
- !ruby/object:Gem::Version
|
|
122
|
-
version:
|
|
136
|
+
version: 4.1.0
|
|
123
137
|
prerelease: false
|
|
124
138
|
type: :runtime
|
|
125
139
|
- !ruby/object:Gem::Dependency
|
|
126
|
-
name:
|
|
140
|
+
name: activemerchant
|
|
127
141
|
version_requirements: !ruby/object:Gem::Requirement
|
|
128
142
|
requirements:
|
|
129
143
|
- - ~>
|
|
130
144
|
- !ruby/object:Gem::Version
|
|
131
|
-
version:
|
|
145
|
+
version: 1.48.0
|
|
132
146
|
requirement: !ruby/object:Gem::Requirement
|
|
133
147
|
requirements:
|
|
134
148
|
- - ~>
|
|
135
149
|
- !ruby/object:Gem::Version
|
|
136
|
-
version:
|
|
150
|
+
version: 1.48.0
|
|
137
151
|
prerelease: false
|
|
138
152
|
type: :runtime
|
|
139
153
|
- !ruby/object:Gem::Dependency
|
|
140
|
-
name:
|
|
154
|
+
name: offsite_payments
|
|
141
155
|
version_requirements: !ruby/object:Gem::Requirement
|
|
142
156
|
requirements:
|
|
143
157
|
- - ~>
|
|
144
158
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: 1.
|
|
159
|
+
version: 2.1.0
|
|
146
160
|
requirement: !ruby/object:Gem::Requirement
|
|
147
161
|
requirements:
|
|
148
162
|
- - ~>
|
|
149
163
|
- !ruby/object:Gem::Version
|
|
150
|
-
version: 1.
|
|
164
|
+
version: 2.1.0
|
|
151
165
|
prerelease: false
|
|
152
166
|
type: :runtime
|
|
153
167
|
- !ruby/object:Gem::Dependency
|
|
154
|
-
name:
|
|
168
|
+
name: monetize
|
|
155
169
|
version_requirements: !ruby/object:Gem::Requirement
|
|
156
170
|
requirements:
|
|
157
171
|
- - ~>
|
|
158
172
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: 1.
|
|
173
|
+
version: 1.1.0
|
|
160
174
|
requirement: !ruby/object:Gem::Requirement
|
|
161
175
|
requirements:
|
|
162
176
|
- - ~>
|
|
163
177
|
- !ruby/object:Gem::Version
|
|
164
|
-
version: 1.
|
|
178
|
+
version: 1.1.0
|
|
165
179
|
prerelease: false
|
|
166
180
|
type: :runtime
|
|
167
181
|
- !ruby/object:Gem::Dependency
|
|
168
|
-
name:
|
|
182
|
+
name: money
|
|
169
183
|
version_requirements: !ruby/object:Gem::Requirement
|
|
170
184
|
requirements:
|
|
171
185
|
- - ~>
|
|
172
186
|
- !ruby/object:Gem::Version
|
|
173
|
-
version:
|
|
187
|
+
version: 6.5.1
|
|
174
188
|
requirement: !ruby/object:Gem::Requirement
|
|
175
189
|
requirements:
|
|
176
190
|
- - ~>
|
|
177
191
|
- !ruby/object:Gem::Version
|
|
178
|
-
version:
|
|
192
|
+
version: 6.5.1
|
|
179
193
|
prerelease: false
|
|
180
194
|
type: :runtime
|
|
181
195
|
- !ruby/object:Gem::Dependency
|
|
@@ -184,12 +198,12 @@ dependencies:
|
|
|
184
198
|
requirements:
|
|
185
199
|
- - ~>
|
|
186
200
|
- !ruby/object:Gem::Version
|
|
187
|
-
version: 0.4.
|
|
201
|
+
version: 0.4.3
|
|
188
202
|
requirement: !ruby/object:Gem::Requirement
|
|
189
203
|
requirements:
|
|
190
204
|
- - ~>
|
|
191
205
|
- !ruby/object:Gem::Version
|
|
192
|
-
version: 0.4.
|
|
206
|
+
version: 0.4.3
|
|
193
207
|
prerelease: false
|
|
194
208
|
type: :development
|
|
195
209
|
- !ruby/object:Gem::Dependency
|
|
@@ -221,17 +235,31 @@ dependencies:
|
|
|
221
235
|
prerelease: false
|
|
222
236
|
type: :development
|
|
223
237
|
- !ruby/object:Gem::Dependency
|
|
224
|
-
name:
|
|
238
|
+
name: jdbc-sqlite3
|
|
225
239
|
version_requirements: !ruby/object:Gem::Requirement
|
|
226
240
|
requirements:
|
|
227
241
|
- - ~>
|
|
228
242
|
- !ruby/object:Gem::Version
|
|
229
|
-
version:
|
|
243
|
+
version: '3.7'
|
|
230
244
|
requirement: !ruby/object:Gem::Requirement
|
|
231
245
|
requirements:
|
|
232
246
|
- - ~>
|
|
233
247
|
- !ruby/object:Gem::Version
|
|
234
|
-
version:
|
|
248
|
+
version: '3.7'
|
|
249
|
+
prerelease: false
|
|
250
|
+
type: :development
|
|
251
|
+
- !ruby/object:Gem::Dependency
|
|
252
|
+
name: jdbc-mariadb
|
|
253
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
254
|
+
requirements:
|
|
255
|
+
- - ~>
|
|
256
|
+
- !ruby/object:Gem::Version
|
|
257
|
+
version: '1.1'
|
|
258
|
+
requirement: !ruby/object:Gem::Requirement
|
|
259
|
+
requirements:
|
|
260
|
+
- - ~>
|
|
261
|
+
- !ruby/object:Gem::Version
|
|
262
|
+
version: '1.1'
|
|
235
263
|
prerelease: false
|
|
236
264
|
type: :development
|
|
237
265
|
description: Kill Bill payment plugin for Paypal Express Checkout.
|
|
@@ -243,7 +271,10 @@ files:
|
|
|
243
271
|
- .gitignore
|
|
244
272
|
- .travis.yml
|
|
245
273
|
- Gemfile
|
|
274
|
+
- Gemfile.head
|
|
275
|
+
- Gemfile.lock
|
|
246
276
|
- Jarfile
|
|
277
|
+
- Jarfile.lock
|
|
247
278
|
- LICENSE
|
|
248
279
|
- NEWS
|
|
249
280
|
- README.md
|
|
@@ -268,7 +299,7 @@ files:
|
|
|
268
299
|
- spec/paypal_express/base_plugin_spec.rb
|
|
269
300
|
- spec/paypal_express/remote/integration_spec.rb
|
|
270
301
|
- spec/spec_helper.rb
|
|
271
|
-
homepage: http://
|
|
302
|
+
homepage: http://killbill.io
|
|
272
303
|
licenses:
|
|
273
304
|
- Apache License (2.0)
|
|
274
305
|
metadata: {}
|
|
@@ -290,11 +321,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
290
321
|
version: '0'
|
|
291
322
|
requirements: []
|
|
292
323
|
rubyforge_project:
|
|
293
|
-
rubygems_version: 2.
|
|
324
|
+
rubygems_version: 2.1.9
|
|
294
325
|
signing_key:
|
|
295
326
|
specification_version: 4
|
|
296
327
|
summary: Plugin to use Paypal Express Checkout as a gateway.
|
|
297
|
-
test_files:
|
|
298
|
-
- spec/paypal_express/base_plugin_spec.rb
|
|
299
|
-
- spec/paypal_express/remote/integration_spec.rb
|
|
300
|
-
- spec/spec_helper.rb
|
|
328
|
+
test_files: []
|