mpi_client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mpi_client/option_translator.rb +5 -5
- data/lib/mpi_client.rb +1 -1
- data/spec/mpi_client_spec.rb +2 -2
- data/spec/option_translator_spec.rb +6 -6
- metadata +3 -3
@@ -1,14 +1,14 @@
|
|
1
1
|
class OptionTranslator
|
2
2
|
OPTION_MAP = {
|
3
|
-
:
|
3
|
+
:merchant_id => :Id,
|
4
4
|
:site_name => :Name,
|
5
|
-
:
|
6
|
-
:
|
5
|
+
:site_url => :URL,
|
6
|
+
:certificate_subject => :IP,
|
7
7
|
:acquirer_bin => :AcquirerBIN,
|
8
8
|
:country_code => :CountryCode,
|
9
9
|
:password => :Password,
|
10
|
-
:
|
11
|
-
:
|
10
|
+
:certificate => :PublicCertificate,
|
11
|
+
:private_key => :PrivateKey,
|
12
12
|
:directory_server_url => :DirectoryServerURL,
|
13
13
|
:brand => :CardType,
|
14
14
|
:response_url => :ResponseURL,
|
data/lib/mpi_client.rb
CHANGED
data/spec/mpi_client_spec.rb
CHANGED
@@ -15,7 +15,7 @@ describe "MPIClient" do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should prepare request data from request_type and options" do
|
18
|
-
options = { :
|
18
|
+
options = { :merchant_id => 'one', :account_id => 'account id' }
|
19
19
|
request_type = :some_type
|
20
20
|
result = @client.send(:prepare_request_data, request_type, options)
|
21
21
|
result.should match %r{<REQUEST type="#{request_type}">}
|
@@ -46,7 +46,7 @@ describe "MPIClient" do
|
|
46
46
|
|
47
47
|
result.data.should == {
|
48
48
|
:account_id => '9933fab999fd3fd0651df2c73bd6f12e',
|
49
|
-
:
|
49
|
+
:merchant_id => '231'
|
50
50
|
}
|
51
51
|
result.should be_success
|
52
52
|
end
|
@@ -2,15 +2,15 @@ require File.dirname(__FILE__) + '/../lib/mpi_client.rb'
|
|
2
2
|
|
3
3
|
describe "OptionTranslator" do
|
4
4
|
it "should translate options" do
|
5
|
-
{ :
|
5
|
+
{ :merchant_id => :Id,
|
6
6
|
:site_name => :Name,
|
7
|
-
:
|
8
|
-
:
|
7
|
+
:site_url => :URL,
|
8
|
+
:certificate_subject => :IP,
|
9
9
|
:acquirer_bin => :AcquirerBIN,
|
10
10
|
:country_code => :CountryCode,
|
11
11
|
:password => :Password,
|
12
|
-
:
|
13
|
-
:
|
12
|
+
:certificate => :PublicCertificate,
|
13
|
+
:private_key => :PrivateKey,
|
14
14
|
:directory_server_url => :DirectoryServerURL,
|
15
15
|
:brand => :CardType,
|
16
16
|
:response_url => :ResponseURL,
|
@@ -22,4 +22,4 @@ describe "OptionTranslator" do
|
|
22
22
|
OptionTranslator.to_server(client_option).should == server_option
|
23
23
|
end
|
24
24
|
end
|
25
|
-
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mpi_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Plashchynski
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-10-
|
13
|
+
date: 2009-10-15 00:00:00 +03:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
requirements: []
|
74
74
|
|
75
75
|
rubyforge_project:
|
76
|
-
rubygems_version: 1.3.
|
76
|
+
rubygems_version: 1.3.5
|
77
77
|
signing_key:
|
78
78
|
specification_version: 3
|
79
79
|
summary: MPI client library
|