sisow 1.5 → 2.1
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/.env.example +2 -0
- data/.gitignore +2 -1
- data/.ruby-version +1 -0
- data/.travis.yml +1 -5
- data/Gemfile +1 -1
- data/README.rdoc +10 -2
- data/lib/sisow.rb +1 -0
- data/lib/sisow/api/callback.rb +12 -1
- data/lib/sisow/api/request.rb +19 -5
- data/lib/sisow/api/request/transaction_request.rb +4 -10
- data/lib/sisow/issuer.rb +4 -4
- data/lib/sisow/payment.rb +7 -2
- data/lib/sisow/payment/credit_card_payment.rb +11 -0
- data/lib/sisow/version.rb +1 -1
- data/script/ci +0 -2
- data/sisow.gemspec +9 -8
- data/spec/models/callback_spec.rb +13 -0
- data/spec/models/issuer_spec.rb +14 -0
- data/spec/models/payment_spec.rb +13 -1
- data/spec/models/ping_spec.rb +1 -1
- data/spec/models/request_spec.rb +47 -7
- data/spec/models/transaction_request_spec.rb +2 -2
- data/spec/spec_helper.rb +6 -7
- data/spec/vcr_setup.rb +1 -1
- metadata +59 -66
- data/.rbenv-version +0 -1
- data/.rvmrc +0 -1
- data/Gemfile.lock +0 -47
- data/spec/sisow.yml.example +0 -5
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 358f59df3fa296a9dc216a4581968079fa734e35f1c69bbf4da60f73a7858db2
|
|
4
|
+
data.tar.gz: 5bdd565e49e7c436114e6939df4b05c5583ee2c8afaca80dea1c8ba6e965cf33
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c737bc3e92c8022fecb49744711fafb5dbde04b738aaa1645f64c452ff30dd51b39c71f042dc6873ba1cba44cacd085029bdc338eb9ec9739ea33af937b8ed2c
|
|
7
|
+
data.tar.gz: 0e87ae935f5911414180f138eb0162767e9b2a1c2e767b58145cc0be197b3fb82cdbd29706fe86ecf2ca6cc154c2da42e44b72927935f8a81296c08d7db7e571
|
data/.env.example
ADDED
data/.gitignore
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.5.0
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
|
@@ -44,6 +44,10 @@ To set up a payment, your user needs to choose an issuer (a bank) that will fulf
|
|
|
44
44
|
This will return a list of <tt>Sisow::Issuer</tt> objects that have an <tt>id</tt> and a <tt>name</tt>. The <tt>id</tt> is needed
|
|
45
45
|
to set up the payment in the following step.
|
|
46
46
|
|
|
47
|
+
Optionally you can also retrieve a list of issuers by supplying the merchant_id and merchant_key directly to the method.
|
|
48
|
+
|
|
49
|
+
Sisow::Issuer.list(merchant_id: 1, merchant_key: 'abcd')
|
|
50
|
+
|
|
47
51
|
=== Setting up a payment
|
|
48
52
|
|
|
49
53
|
After choosing an issuer, your user must be redirected to the payment page for that issuer. For that to happen, you'll have to
|
|
@@ -52,6 +56,8 @@ set up a payment through the Sisow API, after which you'll be given a URL to red
|
|
|
52
56
|
Setting up a payment looks like this:
|
|
53
57
|
|
|
54
58
|
payment_attributes = {
|
|
59
|
+
:merchant_id => 1, # optional: set if you don't want to use a global configuration
|
|
60
|
+
:merchant_key => 'abcd', # optional: set if you don't want to use a global configuration
|
|
55
61
|
:purchase_id => '2012-01-28-33558', # for your own reference
|
|
56
62
|
:issuer_id => '99', # the issuer id from the previous step
|
|
57
63
|
:description => 'Acme Inc. payment', # description of this payment
|
|
@@ -61,7 +67,7 @@ Setting up a payment looks like this:
|
|
|
61
67
|
:cancel_url => 'http://example.com', # where the user is sent when he cancels the payment
|
|
62
68
|
:callback_url => 'http://example.com', # where a failed (not cancelled) payment will be reported
|
|
63
69
|
:notify_url => 'http://example.com', # where the payment status will be reported
|
|
64
|
-
:locale => 'GB' # for Paypal payments. Only GB and US are currently valid.
|
|
70
|
+
:locale => 'GB' # for Paypal payments. Only GB and US are currently valid.
|
|
65
71
|
# Any other option (or leaving it out entirely) will default
|
|
66
72
|
# to a Dutch payment page
|
|
67
73
|
}
|
|
@@ -89,6 +95,8 @@ As documented in the Sisow API documentation, four callbacks are available. When
|
|
|
89
95
|
The <tt>Sisow::Api::Callback</tt> can handle these callbacks for you. To initialize such an instance you should provide the following query parameters (which are given by Sisow in the request):
|
|
90
96
|
|
|
91
97
|
callback = Sisow::Api::Callback.new(
|
|
98
|
+
:merchant_id => 1, # optional: set if you don't want to use a global configuration
|
|
99
|
+
:merchant_key => 'abcd', # optional: set if you don't want to use a global configuration
|
|
92
100
|
:transaction_id => params[:trxid],
|
|
93
101
|
:entrance_code => params[:ec],
|
|
94
102
|
:status => params[:status],
|
|
@@ -111,7 +119,7 @@ Your contributions are more than welcome. To contribute to this gem, follow thes
|
|
|
111
119
|
1. Fork the repository from Github
|
|
112
120
|
2. Clone your fork on your development machine
|
|
113
121
|
3. Install the dependencies with <tt>bundle install</tt>
|
|
114
|
-
4. Copy <tt
|
|
122
|
+
4. Copy <tt>.env.example</tt> to <tt>.env</tt> and enter your own Sisow credentials
|
|
115
123
|
5. Verify your clone is working by running <tt>rspec</tt>
|
|
116
124
|
6. Hack away
|
|
117
125
|
7. Run the specs with <tt>rspec</tt>
|
data/lib/sisow.rb
CHANGED
|
@@ -14,6 +14,7 @@ require 'sisow/payment/ideal_payment'
|
|
|
14
14
|
require 'sisow/payment/bancontact_payment'
|
|
15
15
|
require 'sisow/payment/sofort_payment'
|
|
16
16
|
require 'sisow/payment/paypal_payment'
|
|
17
|
+
require 'sisow/payment/credit_card_payment'
|
|
17
18
|
require 'sisow/merchant'
|
|
18
19
|
require 'sisow/api/request'
|
|
19
20
|
require 'sisow/api/request/directory_request'
|
data/lib/sisow/api/callback.rb
CHANGED
|
@@ -2,6 +2,9 @@ module Sisow
|
|
|
2
2
|
module Api
|
|
3
3
|
class Callback
|
|
4
4
|
|
|
5
|
+
attr_writer :merchant_key,
|
|
6
|
+
:merchant_id
|
|
7
|
+
|
|
5
8
|
attr_accessor :transaction_id,
|
|
6
9
|
:entrance_code,
|
|
7
10
|
:status,
|
|
@@ -46,10 +49,18 @@ module Sisow
|
|
|
46
49
|
@status == 'Reversed'
|
|
47
50
|
end
|
|
48
51
|
|
|
52
|
+
def merchant_id
|
|
53
|
+
@merchant_id || Sisow.configuration.merchant_id
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def merchant_key
|
|
57
|
+
@merchant_key || Sisow.configuration.merchant_key
|
|
58
|
+
end
|
|
59
|
+
|
|
49
60
|
private
|
|
50
61
|
|
|
51
62
|
def valid_callback
|
|
52
|
-
string = [ @transaction_id, @entrance_code, @status,
|
|
63
|
+
string = [ @transaction_id, @entrance_code, @status, merchant_id, merchant_key ].join
|
|
53
64
|
calculated_sha1 = Digest::SHA1.hexdigest(string)
|
|
54
65
|
|
|
55
66
|
calculated_sha1 == @sha1
|
data/lib/sisow/api/request.rb
CHANGED
|
@@ -4,10 +4,24 @@ module Sisow
|
|
|
4
4
|
module Api
|
|
5
5
|
class Request
|
|
6
6
|
|
|
7
|
-
BASE_URI = "
|
|
7
|
+
BASE_URI = "https://www.sisow.nl/Sisow/iDeal/RestHandler.ashx"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
attr_writer :merchant_id,
|
|
10
|
+
:merchant_key
|
|
11
|
+
|
|
12
|
+
def merchant_id
|
|
13
|
+
@merchant_id || Sisow.configuration.merchant_id
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def merchant_key
|
|
17
|
+
@merchant_key || Sisow.configuration.merchant_key
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.perform(merchant_id: nil, merchant_key: nil)
|
|
21
|
+
new.tap do |r|
|
|
22
|
+
r.merchant_id = merchant_id if merchant_id
|
|
23
|
+
r.merchant_key = merchant_key if merchant_key
|
|
24
|
+
end.perform
|
|
11
25
|
end
|
|
12
26
|
|
|
13
27
|
def perform
|
|
@@ -26,7 +40,7 @@ module Sisow
|
|
|
26
40
|
|
|
27
41
|
def default_params
|
|
28
42
|
{
|
|
29
|
-
:merchantid =>
|
|
43
|
+
:merchantid => merchant_id,
|
|
30
44
|
:test => Sisow.configuration.test_mode_enabled?? test_mode_param : nil
|
|
31
45
|
}
|
|
32
46
|
end
|
|
@@ -39,7 +53,7 @@ module Sisow
|
|
|
39
53
|
private
|
|
40
54
|
|
|
41
55
|
def can_perform?
|
|
42
|
-
!(
|
|
56
|
+
!(merchant_id.nil? || merchant_id.empty?) && !(merchant_key.nil? || merchant_key.empty?)
|
|
43
57
|
end
|
|
44
58
|
|
|
45
59
|
def uri
|
|
@@ -2,12 +2,6 @@ module Sisow
|
|
|
2
2
|
module Api
|
|
3
3
|
class TransactionRequest < Request
|
|
4
4
|
|
|
5
|
-
attr_accessor :purchase_id,
|
|
6
|
-
:issuer_id,
|
|
7
|
-
:description,
|
|
8
|
-
:amount,
|
|
9
|
-
:payment
|
|
10
|
-
|
|
11
5
|
def initialize(payment)
|
|
12
6
|
@payment = payment
|
|
13
7
|
end
|
|
@@ -37,8 +31,8 @@ module Sisow
|
|
|
37
31
|
payment.purchase_id,
|
|
38
32
|
payment.entrance_code,
|
|
39
33
|
payment.amount,
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
merchant_id,
|
|
35
|
+
merchant_key
|
|
42
36
|
].join
|
|
43
37
|
|
|
44
38
|
Digest::SHA1.hexdigest(string)
|
|
@@ -94,8 +88,8 @@ module Sisow
|
|
|
94
88
|
string = [
|
|
95
89
|
response.transactionrequest.transaction.trxid,
|
|
96
90
|
response.transactionrequest.transaction.issuerurl,
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
merchant_id,
|
|
92
|
+
merchant_key
|
|
99
93
|
].join
|
|
100
94
|
|
|
101
95
|
calculated_sha1 = Digest::SHA1.hexdigest(string)
|
data/lib/sisow/issuer.rb
CHANGED
|
@@ -2,8 +2,8 @@ module Sisow
|
|
|
2
2
|
class Issuer
|
|
3
3
|
attr_accessor :id, :name
|
|
4
4
|
|
|
5
|
-
def self.list
|
|
6
|
-
@list ||= find_all_from_api
|
|
5
|
+
def self.list(merchant_id: nil, merchant_key: nil)
|
|
6
|
+
@list ||= find_all_from_api(merchant_id, merchant_key)
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def self.find(issuer_id)
|
|
@@ -17,8 +17,8 @@ module Sisow
|
|
|
17
17
|
|
|
18
18
|
private
|
|
19
19
|
|
|
20
|
-
def self.find_all_from_api
|
|
21
|
-
hash = Sisow::Api::DirectoryRequest.perform
|
|
20
|
+
def self.find_all_from_api(merchant_id = nil, merchant_key = nil)
|
|
21
|
+
hash = Sisow::Api::DirectoryRequest.perform(merchant_id: merchant_id, merchant_key: merchant_key)
|
|
22
22
|
|
|
23
23
|
hash.issuer = [ hash.issuer ] unless hash.issuer.is_a?(Array)
|
|
24
24
|
|
data/lib/sisow/payment.rb
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
module Sisow
|
|
2
2
|
class Payment
|
|
3
3
|
|
|
4
|
-
attr_accessor :
|
|
4
|
+
attr_accessor :merchant_id,
|
|
5
|
+
:merchant_key,
|
|
6
|
+
:purchase_id,
|
|
5
7
|
:issuer_id,
|
|
6
8
|
:description,
|
|
7
9
|
:amount,
|
|
@@ -48,7 +50,10 @@ module Sisow
|
|
|
48
50
|
end
|
|
49
51
|
|
|
50
52
|
def request
|
|
51
|
-
@request ||= Sisow::Api::TransactionRequest.new(self)
|
|
53
|
+
@request ||= Sisow::Api::TransactionRequest.new(self).tap do |r|
|
|
54
|
+
r.merchant_id = merchant_id if merchant_id
|
|
55
|
+
r.merchant_key = merchant_key if merchant_key
|
|
56
|
+
end
|
|
52
57
|
end
|
|
53
58
|
|
|
54
59
|
end
|
data/lib/sisow/version.rb
CHANGED
data/script/ci
CHANGED
data/sisow.gemspec
CHANGED
|
@@ -19,14 +19,15 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
20
20
|
s.require_paths = ["lib"]
|
|
21
21
|
|
|
22
|
-
s.add_dependency 'httpi'
|
|
23
|
-
s.add_dependency 'hashie'
|
|
24
|
-
s.add_dependency 'crack'
|
|
22
|
+
s.add_dependency 'httpi', '~> 2'
|
|
23
|
+
s.add_dependency 'hashie', '~> 3'
|
|
24
|
+
s.add_dependency 'crack', '~> 0.4'
|
|
25
25
|
|
|
26
|
-
s.add_development_dependency 'rspec'
|
|
27
|
-
s.add_development_dependency 'vcr'
|
|
28
|
-
s.add_development_dependency '
|
|
29
|
-
s.add_development_dependency 'simplecov'
|
|
30
|
-
s.add_development_dependency 'simplecov-rcov'
|
|
26
|
+
s.add_development_dependency 'rspec', '~> 3'
|
|
27
|
+
s.add_development_dependency 'vcr', '~> 4'
|
|
28
|
+
s.add_development_dependency 'webmock', '~> 3'
|
|
29
|
+
s.add_development_dependency 'simplecov', '~> 0.16'
|
|
30
|
+
s.add_development_dependency 'simplecov-rcov', '~> 0.2'
|
|
31
|
+
s.add_development_dependency 'dotenv', '~> 2'
|
|
31
32
|
|
|
32
33
|
end
|
|
@@ -25,7 +25,20 @@ describe Sisow::Api::Callback do
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
it "should be valid" do
|
|
28
|
+
@callback.valid?.should == true
|
|
29
|
+
lambda { @callback.validate! }.should_not raise_error
|
|
30
|
+
@callback.validate!.should == true
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "should be valid with instance configuration" do
|
|
34
|
+
Sisow.configure do |config|
|
|
35
|
+
config.merchant_id = "invalid"
|
|
36
|
+
config.merchant_key = "invalid"
|
|
37
|
+
end
|
|
38
|
+
|
|
28
39
|
@callback = Sisow::Api::Callback.new(
|
|
40
|
+
:merchant_id => ENV.fetch('MERCHANT_ID'),
|
|
41
|
+
:merchant_key => ENV.fetch('MERCHANT_KEY'),
|
|
29
42
|
:transaction_id => @transaction_id,
|
|
30
43
|
:entrance_code => @entrance_code,
|
|
31
44
|
:status => @status,
|
data/spec/models/issuer_spec.rb
CHANGED
|
@@ -11,6 +11,20 @@ describe Sisow::Issuer do
|
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
it "should list all available issuers with instance configuration" do
|
|
15
|
+
Sisow.configure do |config|
|
|
16
|
+
config.merchant_id = "invalid"
|
|
17
|
+
config.merchant_key = "invalid"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
VCR.use_cassette('issuer') do
|
|
21
|
+
list = Sisow::Issuer.list(merchant_id: ENV.fetch('MERCHANT_ID'), merchant_key: ENV.fetch('MERCHANT_KEY'))
|
|
22
|
+
list.size.should == 1
|
|
23
|
+
list.first.name.should =~ /Sisow Bank/
|
|
24
|
+
list.first.id.should_not be_nil
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
14
28
|
it "should find an issuer by ID" do
|
|
15
29
|
VCR.use_cassette('issuer') do
|
|
16
30
|
issuer = Sisow::Issuer.find(99)
|
data/spec/models/payment_spec.rb
CHANGED
|
@@ -46,7 +46,7 @@ describe Sisow::Payment do
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
it "should raise an error when calling payment_method" do
|
|
49
|
-
lambda{ @payment.payment_method }.should raise_error
|
|
49
|
+
lambda{ @payment.payment_method }.should raise_error(RuntimeError, "Implement me in a subclass")
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
it "should raise an error if amount is missing" do
|
|
@@ -54,4 +54,16 @@ describe Sisow::Payment do
|
|
|
54
54
|
lambda{ @payment.payment_url }.should raise_error(Sisow::Exception, "One of your payment parameters is missing or invalid")
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
describe "with instance configuration" do
|
|
58
|
+
it "should set merchant_id and merchant_key from attributes" do
|
|
59
|
+
@payment.stub(:payment_method).and_return('ideal')
|
|
60
|
+
|
|
61
|
+
@payment.merchant_id = "1234"
|
|
62
|
+
@payment.merchant_key = "4321"
|
|
63
|
+
|
|
64
|
+
@payment.send(:request).merchant_id.should == "1234"
|
|
65
|
+
@payment.send(:request).merchant_key.should == "4321"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
57
69
|
end
|
data/spec/models/ping_spec.rb
CHANGED
data/spec/models/request_spec.rb
CHANGED
|
@@ -4,16 +4,16 @@ describe Sisow::Api::Request do
|
|
|
4
4
|
|
|
5
5
|
before :each do
|
|
6
6
|
@request = Sisow::Api::Request.new
|
|
7
|
-
@request.stub
|
|
8
|
-
@request.stub
|
|
9
|
-
@request.stub
|
|
10
|
-
@request.stub
|
|
11
|
-
Sisow::Api::Request.stub
|
|
7
|
+
@request.stub(:params).and_return(@request.default_params)
|
|
8
|
+
@request.stub(:method).and_return("CheckMerchantRequest")
|
|
9
|
+
@request.stub(:clean).and_return(['ideal'])
|
|
10
|
+
@request.stub(:validate!).and_return(true)
|
|
11
|
+
Sisow::Api::Request.stub(:new).and_return(@request)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
it "should point to the base URI of the Sisow API" do
|
|
15
15
|
request = Sisow::Api::Request.new
|
|
16
|
-
request.send(:base_uri).should == "
|
|
16
|
+
request.send(:base_uri).should == "https://www.sisow.nl/Sisow/iDeal/RestHandler.ashx"
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it "should perform properly" do
|
|
@@ -25,7 +25,7 @@ describe Sisow::Api::Request do
|
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
params = @request.params.merge!(:sha1 => sha1)
|
|
28
|
-
@request.stub
|
|
28
|
+
@request.stub(:params).and_return(params)
|
|
29
29
|
|
|
30
30
|
VCR.use_cassette('request') do
|
|
31
31
|
@request.perform
|
|
@@ -38,4 +38,44 @@ describe Sisow::Api::Request do
|
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
describe "with instance configuration" do
|
|
42
|
+
it "should perform properly" do
|
|
43
|
+
Sisow.configure do |config|
|
|
44
|
+
config.merchant_id = "invalid"
|
|
45
|
+
config.merchant_key = "invalid"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
@request = Sisow::Api::Request.new
|
|
49
|
+
@request.merchant_id = ENV.fetch('MERCHANT_ID')
|
|
50
|
+
@request.merchant_key = ENV.fetch('MERCHANT_KEY')
|
|
51
|
+
@request.stub(:params).and_return(@request.default_params)
|
|
52
|
+
@request.stub(:method).and_return("CheckMerchantRequest")
|
|
53
|
+
@request.stub(:clean).and_return(['ideal'])
|
|
54
|
+
@request.stub(:validate!).and_return(true)
|
|
55
|
+
|
|
56
|
+
sha1 = Digest::SHA1.hexdigest(
|
|
57
|
+
[
|
|
58
|
+
ENV.fetch('MERCHANT_ID'),
|
|
59
|
+
ENV.fetch('MERCHANT_KEY')
|
|
60
|
+
].join
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
params = @request.params.merge!(:sha1 => sha1)
|
|
64
|
+
@request.stub(:params).and_return(params)
|
|
65
|
+
|
|
66
|
+
VCR.use_cassette('request') do
|
|
67
|
+
@request.perform
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
it "should set merchant_id and merchant_key using class method" do
|
|
72
|
+
subject.stub(:perform).and_return(subject)
|
|
73
|
+
|
|
74
|
+
obj = subject.class.perform(merchant_id: "1234", merchant_key: "4321")
|
|
75
|
+
|
|
76
|
+
obj.merchant_id.should == "1234"
|
|
77
|
+
obj.merchant_key.should == "4321"
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
41
81
|
end
|
|
@@ -29,7 +29,7 @@ describe Sisow::Api::TransactionRequest do
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
it "should remove issuerid from params for Bancontact" do
|
|
32
|
-
Sisow.configuration.stub
|
|
32
|
+
Sisow.configuration.stub(:test_mode_enabled?).and_return(false)
|
|
33
33
|
payment = Sisow::BancontactPayment.new
|
|
34
34
|
request = Sisow::Api::TransactionRequest.new(payment)
|
|
35
35
|
|
|
@@ -44,7 +44,7 @@ describe Sisow::Api::TransactionRequest do
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
it "should remove issuerid from params for Sofort" do
|
|
47
|
-
Sisow.configuration.stub
|
|
47
|
+
Sisow.configuration.stub(:test_mode_enabled?).and_return(false)
|
|
48
48
|
payment = Sisow::SofortPayment.new
|
|
49
49
|
request = Sisow::Api::TransactionRequest.new(payment)
|
|
50
50
|
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'dotenv/load'
|
|
1
2
|
require 'bundler/setup'
|
|
2
3
|
require 'simplecov'
|
|
3
4
|
require 'simplecov-rcov'
|
|
@@ -12,21 +13,19 @@ end
|
|
|
12
13
|
|
|
13
14
|
require 'vcr_setup'
|
|
14
15
|
|
|
15
|
-
require 'rspec/autorun'
|
|
16
16
|
require 'sisow'
|
|
17
17
|
|
|
18
18
|
RSpec.configure do |config|
|
|
19
|
-
config.mock_with :
|
|
20
|
-
config.
|
|
19
|
+
config.mock_with(:rspec) { |c| c.syntax = :should }
|
|
20
|
+
config.color = true
|
|
21
21
|
config.tty = true
|
|
22
22
|
config.formatter = :progress
|
|
23
|
+
config.expect_with(:rspec) { |c| c.syntax = :should }
|
|
23
24
|
|
|
24
25
|
config.before(:each) do
|
|
25
|
-
hash = YAML.load(File.open('./spec/sisow.yml'))
|
|
26
|
-
|
|
27
26
|
Sisow.configure do |config|
|
|
28
|
-
config.merchant_id =
|
|
29
|
-
config.merchant_key =
|
|
27
|
+
config.merchant_id = ENV.fetch('MERCHANT_ID')
|
|
28
|
+
config.merchant_key = ENV.fetch('MERCHANT_KEY')
|
|
30
29
|
config.test_mode = true
|
|
31
30
|
config.debug_mode = false
|
|
32
31
|
end
|
data/spec/vcr_setup.rb
CHANGED
metadata
CHANGED
|
@@ -1,144 +1,141 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sisow
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '1
|
|
5
|
-
prerelease:
|
|
4
|
+
version: '2.1'
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Marcel de Graaf
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2021-08-20 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: httpi
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
none: false
|
|
18
16
|
requirements:
|
|
19
|
-
- -
|
|
17
|
+
- - "~>"
|
|
20
18
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: '
|
|
19
|
+
version: '2'
|
|
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
|
-
version: '
|
|
26
|
+
version: '2'
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
|
31
28
|
name: hashie
|
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
none: false
|
|
34
30
|
requirements:
|
|
35
|
-
- -
|
|
31
|
+
- - "~>"
|
|
36
32
|
- !ruby/object:Gem::Version
|
|
37
|
-
version: '
|
|
33
|
+
version: '3'
|
|
38
34
|
type: :runtime
|
|
39
35
|
prerelease: false
|
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
-
none: false
|
|
42
37
|
requirements:
|
|
43
|
-
- -
|
|
38
|
+
- - "~>"
|
|
44
39
|
- !ruby/object:Gem::Version
|
|
45
|
-
version: '
|
|
40
|
+
version: '3'
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
|
47
42
|
name: crack
|
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
|
49
|
-
none: false
|
|
50
44
|
requirements:
|
|
51
|
-
- -
|
|
45
|
+
- - "~>"
|
|
52
46
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '0'
|
|
47
|
+
version: '0.4'
|
|
54
48
|
type: :runtime
|
|
55
49
|
prerelease: false
|
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
-
none: false
|
|
58
51
|
requirements:
|
|
59
|
-
- -
|
|
52
|
+
- - "~>"
|
|
60
53
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
54
|
+
version: '0.4'
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
|
63
56
|
name: rspec
|
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
|
65
|
-
none: false
|
|
66
58
|
requirements:
|
|
67
|
-
- -
|
|
59
|
+
- - "~>"
|
|
68
60
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: '
|
|
61
|
+
version: '3'
|
|
70
62
|
type: :development
|
|
71
63
|
prerelease: false
|
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
-
none: false
|
|
74
65
|
requirements:
|
|
75
|
-
- -
|
|
66
|
+
- - "~>"
|
|
76
67
|
- !ruby/object:Gem::Version
|
|
77
|
-
version: '
|
|
68
|
+
version: '3'
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
|
79
70
|
name: vcr
|
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
|
81
|
-
none: false
|
|
82
72
|
requirements:
|
|
83
|
-
- -
|
|
73
|
+
- - "~>"
|
|
84
74
|
- !ruby/object:Gem::Version
|
|
85
|
-
version: '
|
|
75
|
+
version: '4'
|
|
86
76
|
type: :development
|
|
87
77
|
prerelease: false
|
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
-
none: false
|
|
90
79
|
requirements:
|
|
91
|
-
- -
|
|
80
|
+
- - "~>"
|
|
92
81
|
- !ruby/object:Gem::Version
|
|
93
|
-
version: '
|
|
82
|
+
version: '4'
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
|
95
|
-
name:
|
|
84
|
+
name: webmock
|
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
|
97
|
-
none: false
|
|
98
86
|
requirements:
|
|
99
|
-
- -
|
|
87
|
+
- - "~>"
|
|
100
88
|
- !ruby/object:Gem::Version
|
|
101
|
-
version: '
|
|
89
|
+
version: '3'
|
|
102
90
|
type: :development
|
|
103
91
|
prerelease: false
|
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
105
|
-
none: false
|
|
106
93
|
requirements:
|
|
107
|
-
- -
|
|
94
|
+
- - "~>"
|
|
108
95
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: '
|
|
96
|
+
version: '3'
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
|
111
98
|
name: simplecov
|
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
|
113
|
-
none: false
|
|
114
100
|
requirements:
|
|
115
|
-
- -
|
|
101
|
+
- - "~>"
|
|
116
102
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0'
|
|
103
|
+
version: '0.16'
|
|
118
104
|
type: :development
|
|
119
105
|
prerelease: false
|
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
none: false
|
|
122
107
|
requirements:
|
|
123
|
-
- -
|
|
108
|
+
- - "~>"
|
|
124
109
|
- !ruby/object:Gem::Version
|
|
125
|
-
version: '0'
|
|
110
|
+
version: '0.16'
|
|
126
111
|
- !ruby/object:Gem::Dependency
|
|
127
112
|
name: simplecov-rcov
|
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
|
129
|
-
none: false
|
|
130
114
|
requirements:
|
|
131
|
-
- -
|
|
115
|
+
- - "~>"
|
|
132
116
|
- !ruby/object:Gem::Version
|
|
133
|
-
version: '0'
|
|
117
|
+
version: '0.2'
|
|
134
118
|
type: :development
|
|
135
119
|
prerelease: false
|
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
137
|
-
none: false
|
|
138
121
|
requirements:
|
|
139
|
-
- -
|
|
122
|
+
- - "~>"
|
|
140
123
|
- !ruby/object:Gem::Version
|
|
141
|
-
version: '0'
|
|
124
|
+
version: '0.2'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: dotenv
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - "~>"
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '2'
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - "~>"
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '2'
|
|
142
139
|
description: This gem implements the REST API of the Sisow payment provider.
|
|
143
140
|
email:
|
|
144
141
|
- mail@marceldegraaf.net
|
|
@@ -146,12 +143,11 @@ executables: []
|
|
|
146
143
|
extensions: []
|
|
147
144
|
extra_rdoc_files: []
|
|
148
145
|
files:
|
|
149
|
-
- .
|
|
150
|
-
- .
|
|
151
|
-
- .
|
|
152
|
-
- .travis.yml
|
|
146
|
+
- ".env.example"
|
|
147
|
+
- ".gitignore"
|
|
148
|
+
- ".ruby-version"
|
|
149
|
+
- ".travis.yml"
|
|
153
150
|
- Gemfile
|
|
154
|
-
- Gemfile.lock
|
|
155
151
|
- README.rdoc
|
|
156
152
|
- Rakefile
|
|
157
153
|
- lib/sisow.rb
|
|
@@ -168,6 +164,7 @@ files:
|
|
|
168
164
|
- lib/sisow/merchant.rb
|
|
169
165
|
- lib/sisow/payment.rb
|
|
170
166
|
- lib/sisow/payment/bancontact_payment.rb
|
|
167
|
+
- lib/sisow/payment/credit_card_payment.rb
|
|
171
168
|
- lib/sisow/payment/ideal_payment.rb
|
|
172
169
|
- lib/sisow/payment/paypal_payment.rb
|
|
173
170
|
- lib/sisow/payment/sofort_payment.rb
|
|
@@ -190,32 +187,30 @@ files:
|
|
|
190
187
|
- spec/models/sisow_spec.rb
|
|
191
188
|
- spec/models/sofort_payment_spec.rb
|
|
192
189
|
- spec/models/transaction_request_spec.rb
|
|
193
|
-
- spec/sisow.yml.example
|
|
194
190
|
- spec/spec_helper.rb
|
|
195
191
|
- spec/vcr_setup.rb
|
|
196
192
|
homepage: http://github.com/marceldegraaf/sisow
|
|
197
193
|
licenses: []
|
|
194
|
+
metadata: {}
|
|
198
195
|
post_install_message:
|
|
199
196
|
rdoc_options: []
|
|
200
197
|
require_paths:
|
|
201
198
|
- lib
|
|
202
199
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
203
|
-
none: false
|
|
204
200
|
requirements:
|
|
205
|
-
- -
|
|
201
|
+
- - ">="
|
|
206
202
|
- !ruby/object:Gem::Version
|
|
207
203
|
version: '0'
|
|
208
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
|
-
none: false
|
|
210
205
|
requirements:
|
|
211
|
-
- -
|
|
206
|
+
- - ">="
|
|
212
207
|
- !ruby/object:Gem::Version
|
|
213
208
|
version: '0'
|
|
214
209
|
requirements: []
|
|
215
210
|
rubyforge_project: sisow
|
|
216
|
-
rubygems_version:
|
|
211
|
+
rubygems_version: 2.7.3
|
|
217
212
|
signing_key:
|
|
218
|
-
specification_version:
|
|
213
|
+
specification_version: 4
|
|
219
214
|
summary: Rails gem for payments through Sisow.
|
|
220
215
|
test_files:
|
|
221
216
|
- spec/models/bancontact_payment_spec.rb
|
|
@@ -232,7 +227,5 @@ test_files:
|
|
|
232
227
|
- spec/models/sisow_spec.rb
|
|
233
228
|
- spec/models/sofort_payment_spec.rb
|
|
234
229
|
- spec/models/transaction_request_spec.rb
|
|
235
|
-
- spec/sisow.yml.example
|
|
236
230
|
- spec/spec_helper.rb
|
|
237
231
|
- spec/vcr_setup.rb
|
|
238
|
-
has_rdoc:
|
data/.rbenv-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.9.3-p194
|
data/.rvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
rvm 1.9.3-p194@sisow
|
data/Gemfile.lock
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
sisow (1.4)
|
|
5
|
-
crack
|
|
6
|
-
hashie
|
|
7
|
-
httpi
|
|
8
|
-
|
|
9
|
-
GEM
|
|
10
|
-
remote: http://rubygems.org/
|
|
11
|
-
specs:
|
|
12
|
-
crack (0.3.2)
|
|
13
|
-
diff-lcs (1.1.3)
|
|
14
|
-
fakeweb (1.3.0)
|
|
15
|
-
hashie (1.2.0)
|
|
16
|
-
httpi (2.0.0)
|
|
17
|
-
rack
|
|
18
|
-
multi_json (1.3.5)
|
|
19
|
-
rack (1.4.4)
|
|
20
|
-
rake (0.9.2.2)
|
|
21
|
-
rspec (2.10.0)
|
|
22
|
-
rspec-core (~> 2.10.0)
|
|
23
|
-
rspec-expectations (~> 2.10.0)
|
|
24
|
-
rspec-mocks (~> 2.10.0)
|
|
25
|
-
rspec-core (2.10.0)
|
|
26
|
-
rspec-expectations (2.10.0)
|
|
27
|
-
diff-lcs (~> 1.1.3)
|
|
28
|
-
rspec-mocks (2.10.1)
|
|
29
|
-
simplecov (0.6.4)
|
|
30
|
-
multi_json (~> 1.0)
|
|
31
|
-
simplecov-html (~> 0.5.3)
|
|
32
|
-
simplecov-html (0.5.3)
|
|
33
|
-
simplecov-rcov (0.2.3)
|
|
34
|
-
simplecov (>= 0.4.1)
|
|
35
|
-
vcr (2.1.1)
|
|
36
|
-
|
|
37
|
-
PLATFORMS
|
|
38
|
-
ruby
|
|
39
|
-
|
|
40
|
-
DEPENDENCIES
|
|
41
|
-
fakeweb
|
|
42
|
-
rake
|
|
43
|
-
rspec
|
|
44
|
-
simplecov
|
|
45
|
-
simplecov-rcov
|
|
46
|
-
sisow!
|
|
47
|
-
vcr
|