activemerchant_paybox_direct_plus 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +2 -17
- data/Gemfile.lock +39 -82
- data/README.md +106 -0
- data/Rakefile +8 -52
- data/activemerchant_paybox_direct_plus.gemspec +31 -67
- data/lib/activemerchant_paybox_direct_plus.rb +54 -160
- data/test/remote/gateways/remote_paybox_direct_plus_test.rb +77 -40
- data/test/test_helper.rb +7 -196
- metadata +79 -131
- data/README.markdown +0 -45
- data/VERSION +0 -1
- data/test/fixtures.yml +0 -4
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cdcc26b41a91604e959f17e90ba6cb05e4fed471
|
4
|
+
data.tar.gz: 2ccd755c29799465173fd1165064860e25f2d19d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e1e5431f39f67ffa4e339adee6dc8502c80fbe80fd27c65c95cefc3d2b1b8001f94651ca9d61d0c3fba2d4e967b8abede3878fb68288ba9d7563827990d2505b
|
7
|
+
data.tar.gz: ac6e94a791e833bfc8b37b79d9e7273b1c7fe63a1231bdee943cd90bd30587ed8b2662a5867e0165ebc0e8a707576ad7487d975d4cf548d38d3cef272339c190
|
data/Gemfile
CHANGED
@@ -1,18 +1,3 @@
|
|
1
|
-
source
|
2
|
-
# Add dependencies required to use your gem here.
|
3
|
-
# Example:
|
4
|
-
# gem "activesupport", ">= 2.3.5"
|
1
|
+
source 'https://rubygems.org'
|
5
2
|
|
6
|
-
|
7
|
-
# Include everything needed to run rake, tests, features, etc.
|
8
|
-
group :development do
|
9
|
-
gem "activemerchant", "~> 1.10"
|
10
|
-
gem "shoulda", ">= 0"
|
11
|
-
gem "bundler"
|
12
|
-
gem "jeweler"
|
13
|
-
gem "simplecov"
|
14
|
-
gem 'money'
|
15
|
-
gem 'mocha'
|
16
|
-
gem 'activesupport'
|
17
|
-
gem 'actionpack', ">=3.0"
|
18
|
-
end
|
3
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,90 +1,47 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
activemerchant_paybox_direct_plus (1.0.0)
|
5
|
+
activemerchant (~> 1)
|
6
|
+
|
1
7
|
GEM
|
2
|
-
remote:
|
8
|
+
remote: https://rubygems.org/
|
3
9
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
mocha (~> 0.13.2)
|
33
|
-
builder (3.0.4)
|
34
|
-
erubis (2.7.0)
|
35
|
-
git (1.2.5)
|
36
|
-
hike (1.2.2)
|
37
|
-
i18n (0.6.4)
|
38
|
-
jeweler (1.8.4)
|
39
|
-
bundler (~> 1.0)
|
40
|
-
git (>= 1.2.5)
|
41
|
-
rake
|
42
|
-
rdoc
|
43
|
-
journey (1.0.4)
|
44
|
-
json (1.7.7)
|
45
|
-
metaclass (0.0.1)
|
46
|
-
mocha (0.13.3)
|
47
|
-
metaclass (~> 0.0.1)
|
48
|
-
money (5.1.1)
|
49
|
-
i18n (~> 0.6.0)
|
50
|
-
multi_json (1.7.3)
|
51
|
-
nokogiri (1.5.9)
|
52
|
-
rack (1.4.5)
|
53
|
-
rack-cache (1.2)
|
54
|
-
rack (>= 0.4)
|
55
|
-
rack-test (0.6.2)
|
56
|
-
rack (>= 1.0)
|
57
|
-
rake (10.0.4)
|
58
|
-
rdoc (4.0.1)
|
59
|
-
json (~> 1.4)
|
60
|
-
shoulda (3.4.0)
|
61
|
-
shoulda-context (~> 1.0, >= 1.0.1)
|
62
|
-
shoulda-matchers (~> 1.0, >= 1.4.1)
|
63
|
-
shoulda-context (1.1.1)
|
64
|
-
shoulda-matchers (1.5.6)
|
65
|
-
activesupport (>= 3.0.0)
|
66
|
-
bourne (~> 1.3)
|
67
|
-
simplecov (0.7.1)
|
68
|
-
multi_json (~> 1.0)
|
69
|
-
simplecov-html (~> 0.7.1)
|
70
|
-
simplecov-html (0.7.1)
|
71
|
-
sprockets (2.2.2)
|
72
|
-
hike (~> 1.2)
|
73
|
-
multi_json (~> 1.0)
|
74
|
-
rack (~> 1.0)
|
75
|
-
tilt (~> 1.1, != 1.3.0)
|
76
|
-
tilt (1.4.0)
|
10
|
+
activemerchant (1.56.0)
|
11
|
+
activesupport (>= 3.2.14, < 5.1)
|
12
|
+
builder (>= 2.1.2, < 4.0.0)
|
13
|
+
i18n (>= 0.6.9)
|
14
|
+
nokogiri (~> 1.4)
|
15
|
+
activesupport (4.2.5.1)
|
16
|
+
i18n (~> 0.7)
|
17
|
+
json (~> 1.7, >= 1.7.7)
|
18
|
+
minitest (~> 5.1)
|
19
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
20
|
+
tzinfo (~> 1.1)
|
21
|
+
builder (3.2.2)
|
22
|
+
docile (1.1.5)
|
23
|
+
i18n (0.7.0)
|
24
|
+
json (1.8.3)
|
25
|
+
mini_portile2 (2.0.0)
|
26
|
+
minitest (5.8.4)
|
27
|
+
nokogiri (1.6.7.2)
|
28
|
+
mini_portile2 (~> 2.0.0.rc2)
|
29
|
+
rake (10.5.0)
|
30
|
+
simplecov (0.11.1)
|
31
|
+
docile (~> 1.1.0)
|
32
|
+
json (~> 1.8)
|
33
|
+
simplecov-html (~> 0.10.0)
|
34
|
+
simplecov-html (0.10.0)
|
35
|
+
thread_safe (0.3.5)
|
36
|
+
tzinfo (1.2.2)
|
37
|
+
thread_safe (~> 0.1)
|
77
38
|
|
78
39
|
PLATFORMS
|
79
40
|
ruby
|
80
41
|
|
81
42
|
DEPENDENCIES
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
jeweler
|
87
|
-
mocha
|
88
|
-
money
|
89
|
-
shoulda
|
43
|
+
activemerchant_paybox_direct_plus!
|
44
|
+
bundler (~> 1.7)
|
45
|
+
minitest
|
46
|
+
rake (~> 10)
|
90
47
|
simplecov
|
data/README.md
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
## Paybox Direct Plus
|
2
|
+
|
3
|
+
This is a implementation of Paybox Direct Plus for ActiveMerchant.
|
4
|
+
Paybox Direct Plus is a French payment solution allowing recurring payments, subscriptions, etc.
|
5
|
+
|
6
|
+
### Setup the gateway
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
gateway = ActiveMerchant::Billing::PayboxDirectPlusGateway.new(
|
10
|
+
login: '199988899',
|
11
|
+
password: '1999888I'
|
12
|
+
)
|
13
|
+
```
|
14
|
+
### Subscribed user functionalities
|
15
|
+
|
16
|
+
Create a user profile:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
response = gateway.subscriber_create(amount, active_merchant_credit_card, user_reference: 'YOUR_USER_REFERENCE')
|
20
|
+
response.success? # check if called succeeded
|
21
|
+
response.authorization # authorization number, to be used for capture / void / refund
|
22
|
+
response.params['porteur'] # credit card reference, to be saved to use with the user reference for future purchases
|
23
|
+
```
|
24
|
+
|
25
|
+
When creating a user profile, Paybox will do an authorization on the credit card.
|
26
|
+
Paybox recommends that you give the same amount than your transaction so you can simple capture it later.
|
27
|
+
|
28
|
+
If you don't know yet how much you'll have to charge the client, you can also send an amount of 0.
|
29
|
+
|
30
|
+
After your client is subscribed, you will be able to use several other operations:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
credit_card = ActiveMerchant::Billing::CreditCard.new(
|
34
|
+
last_name: client_cc.last_name,
|
35
|
+
first_name: client_cc.first_name,
|
36
|
+
verification_value: client_cc.verification_value,
|
37
|
+
year: client_cc.expires_on.year,
|
38
|
+
month: client_cc.expires_on.month
|
39
|
+
) # notice the absence of credit card number here
|
40
|
+
|
41
|
+
purchase = gateway.subscriber_purchase(
|
42
|
+
amount, credit_card,
|
43
|
+
user_reference: 'YOUR_USER_REFERENCE',
|
44
|
+
order_id: 'ORDER_REFERENCE',
|
45
|
+
credit_card_reference: subscriber_create_response.params['porteur']
|
46
|
+
) # authorize + capture in one call
|
47
|
+
|
48
|
+
authorize = gateway.subscriber_authorize(
|
49
|
+
amount, credit_card,
|
50
|
+
user_reference: 'YOUR_USER_REFERENCE',
|
51
|
+
order_id: 'ORDER_REFERENCE',
|
52
|
+
credit_card_reference: subscriber_create_response.params['porteur']
|
53
|
+
)
|
54
|
+
|
55
|
+
capture = gateway.subscriber_capture(
|
56
|
+
amount, authorize.authorization,
|
57
|
+
user_reference: 'YOUR_USER_REFERENCE',
|
58
|
+
order_id: 'ORDER_REFERENCE'
|
59
|
+
)
|
60
|
+
|
61
|
+
refund = gateway.subscriber_refund(
|
62
|
+
amount, authorize.authorization,
|
63
|
+
user_reference: 'YOUR_USER_REFERENCE',
|
64
|
+
order_id: 'ORDER_REFERENCE'
|
65
|
+
)
|
66
|
+
|
67
|
+
void = gateway.subscriber_void(
|
68
|
+
amount, authorize.authorization,
|
69
|
+
user_reference: 'YOUR_USER_REFERENCE',
|
70
|
+
order_id: 'ORDER_REFERENCE'
|
71
|
+
)
|
72
|
+
```
|
73
|
+
|
74
|
+
Using the `subscriber_purchase` method will do an authorization and a capture. Some banks requires some delay between 2
|
75
|
+
authorizations on the same card. So, if you register a profile then call `subscriber_purchase` just after instead of
|
76
|
+
`subscriber_capture`, it may fail with some banks.
|
77
|
+
|
78
|
+
### Non subscribed user functionalities
|
79
|
+
|
80
|
+
The gateway inherits [Donal Piret's Paybox Direct Gateway](https://github.com/activemerchant/active_merchant/blob/master/lib/active_merchant/billing/gateways/paybox_direct.rb),
|
81
|
+
so all methods of that gateway are accessible.
|
82
|
+
|
83
|
+
### Compatibility
|
84
|
+
|
85
|
+
For Ruby 1.8, use version 0.1.0
|
86
|
+
|
87
|
+
For Ruby 1.9, use version 0.2.0
|
88
|
+
|
89
|
+
For Ruby 2.0+, use latest version ~>1.0
|
90
|
+
|
91
|
+
### Tests
|
92
|
+
|
93
|
+
Remote integrations tests using the Paybox tests logins and server are available and should always pass.
|
94
|
+
|
95
|
+
```
|
96
|
+
bundle install
|
97
|
+
bundle exec rake test
|
98
|
+
```
|
99
|
+
|
100
|
+
### Credits
|
101
|
+
|
102
|
+
The base of all this work is Donald Piret's great work on Paybox Direct Gateway implementation.
|
103
|
+
|
104
|
+
### Contact
|
105
|
+
|
106
|
+
Please don't hesitate to contact me if you have any question, any suggestion or if you found any bug.
|
data/Rakefile
CHANGED
@@ -1,64 +1,20 @@
|
|
1
|
-
require '
|
2
|
-
require 'bundler'
|
3
|
-
begin
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
require 'rake'
|
11
|
-
|
12
|
-
require 'jeweler'
|
13
|
-
Jeweler::Tasks.new do |gem|
|
14
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
-
gem.name = "activemerchant_paybox_direct_plus"
|
16
|
-
gem.homepage = "https://github.com/arambert/Paybox-Direct-Plus"
|
17
|
-
gem.license = "MIT"
|
18
|
-
gem.summary = "Paybox Direct Plus for ActiveMerchant"
|
19
|
-
gem.description = "Paybox Direct Plus ActiveMerchant Billing Gateway implementation"
|
20
|
-
gem.email = "nospam@nospam.com"
|
21
|
-
gem.authors = ["donaldpiret", "arambert", "slainer68"]
|
22
|
-
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
-
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
-
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
-
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
-
gem.add_runtime_dependency 'activemerchant', '~> 1.10'
|
27
|
-
end
|
28
|
-
Jeweler::RubygemsDotOrgTasks.new
|
29
|
-
|
1
|
+
require 'bundler/gem_tasks'
|
30
2
|
require 'rake/testtask'
|
31
3
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
test.verbose = true
|
37
|
-
end
|
38
|
-
|
39
|
-
Rake::TestTask.new(:units) do |t|
|
40
|
-
t.pattern = 'test/unit/**/*_test.rb'
|
41
|
-
t.ruby_opts << '-rubygems'
|
42
|
-
t.libs << 'test'
|
43
|
-
t.verbose = true
|
44
|
-
end
|
45
|
-
|
46
|
-
Rake::TestTask.new(:remote) do |t|
|
47
|
-
t.pattern = 'test/remote/**/*_test.rb'
|
48
|
-
t.ruby_opts << '-rubygems'
|
49
|
-
t.libs << 'test'
|
50
|
-
t.verbose = true
|
51
|
-
end
|
4
|
+
Rake::TestTask.new(:test) do |t|
|
5
|
+
t.libs << 'test'
|
6
|
+
t.pattern = 'test/**/*_test.rb'
|
7
|
+
t.verbose = true
|
52
8
|
end
|
53
9
|
|
54
|
-
task :
|
10
|
+
task default: :test
|
55
11
|
|
56
12
|
require 'rdoc/task'
|
57
13
|
Rake::RDocTask.new do |rdoc|
|
58
|
-
version =
|
14
|
+
version = ActivemerchantPayboxDirectPlus::VERSION
|
59
15
|
|
60
16
|
rdoc.rdoc_dir = 'rdoc'
|
61
|
-
rdoc.title = "
|
17
|
+
rdoc.title = "ActiveMerchant PayboxDirectPlusGateway #{version}"
|
62
18
|
rdoc.rdoc_files.include('README*')
|
63
19
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
64
20
|
end
|
@@ -1,77 +1,41 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
# -*- encoding: utf-8 -*-
|
1
|
+
lib = File.expand_path('..', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'lib/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version =
|
6
|
+
s.name = 'activemerchant_paybox_direct_plus'
|
7
|
+
s.version = ActivemerchantPayboxDirectPlus::VERSION
|
8
|
+
|
9
|
+
s.description = 'Paybox Direct Plus ActiveMerchant Billing Gateway implementation'
|
10
|
+
s.summary = 'Paybox Direct Plus for ActiveMerchant'
|
11
|
+
|
12
|
+
s.authors = %w(donaldpiret arambert slainer68 TiteiKo)
|
13
|
+
s.email = 'nospam@nospam.com'
|
9
14
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["donaldpiret", "arambert", "slainer68"]
|
12
|
-
s.date = "2013-05-06"
|
13
|
-
s.description = "Paybox Direct Plus ActiveMerchant Billing Gateway implementation"
|
14
|
-
s.email = "nospam@nospam.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
|
-
|
17
|
-
|
16
|
+
'LICENSE.txt',
|
17
|
+
'README.md'
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
"test/remote/gateways/remote_paybox_direct_plus_test.rb",
|
30
|
-
"test/test_helper.rb"
|
20
|
+
'Gemfile',
|
21
|
+
'Gemfile.lock',
|
22
|
+
'LICENSE.txt',
|
23
|
+
'README.md',
|
24
|
+
'Rakefile',
|
25
|
+
'activemerchant_paybox_direct_plus.gemspec',
|
26
|
+
'lib/activemerchant_paybox_direct_plus.rb',
|
27
|
+
'test/remote/gateways/remote_paybox_direct_plus_test.rb',
|
28
|
+
'test/test_helper.rb'
|
31
29
|
]
|
32
|
-
s.homepage = "https://github.com/arambert/Paybox-Direct-Plus"
|
33
|
-
s.licenses = ["MIT"]
|
34
|
-
s.require_paths = ["lib"]
|
35
|
-
s.rubygems_version = "1.8.15"
|
36
|
-
s.summary = "Paybox Direct Plus for ActiveMerchant"
|
37
30
|
|
38
|
-
|
39
|
-
|
31
|
+
s.homepage = 'https://github.com/arambert/Paybox-Direct-Plus'
|
32
|
+
s.licenses = ['MIT']
|
33
|
+
s.require_paths = ['lib']
|
40
34
|
|
41
|
-
|
42
|
-
s.add_development_dependency(%q<activemerchant>, ["~> 1.10"])
|
43
|
-
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
44
|
-
s.add_development_dependency(%q<bundler>, [">= 0"])
|
45
|
-
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
46
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
47
|
-
s.add_development_dependency(%q<money>, [">= 0"])
|
48
|
-
s.add_development_dependency(%q<mocha>, [">= 0"])
|
49
|
-
s.add_development_dependency(%q<activesupport>, [">= 0"])
|
50
|
-
s.add_development_dependency(%q<actionpack>, [">= 3.0"])
|
51
|
-
s.add_runtime_dependency(%q<activemerchant>, ["~> 1.10"])
|
52
|
-
else
|
53
|
-
s.add_dependency(%q<activemerchant>, ["~> 1.10"])
|
54
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
55
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
56
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
57
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
58
|
-
s.add_dependency(%q<money>, [">= 0"])
|
59
|
-
s.add_dependency(%q<mocha>, [">= 0"])
|
60
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
61
|
-
s.add_dependency(%q<actionpack>, [">= 3.0"])
|
62
|
-
s.add_dependency(%q<activemerchant>, ["~> 1.10"])
|
63
|
-
end
|
64
|
-
else
|
65
|
-
s.add_dependency(%q<activemerchant>, ["~> 1.10"])
|
66
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
67
|
-
s.add_dependency(%q<bundler>, [">= 0"])
|
68
|
-
s.add_dependency(%q<jeweler>, [">= 0"])
|
69
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
70
|
-
s.add_dependency(%q<money>, [">= 0"])
|
71
|
-
s.add_dependency(%q<mocha>, [">= 0"])
|
72
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
73
|
-
s.add_dependency(%q<actionpack>, [">= 3.0"])
|
74
|
-
s.add_dependency(%q<activemerchant>, ["~> 1.10"])
|
75
|
-
end
|
76
|
-
end
|
35
|
+
s.add_dependency 'activemerchant', '~> 1'
|
77
36
|
|
37
|
+
s.add_development_dependency 'minitest', '>= 0'
|
38
|
+
s.add_development_dependency 'simplecov', '>= 0'
|
39
|
+
s.add_development_dependency 'bundler', '~> 1.7'
|
40
|
+
s.add_development_dependency 'rake', '~> 10'
|
41
|
+
end
|