exact4r 0.9.3 → 1.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.
- data/CHANGELOG +3 -0
- data/README +0 -11
- data/Rakefile +38 -6
- data/VERSION +1 -1
- data/lib/ews/transaction/request.rb +4 -0
- data/lib/ews/transaction/validator.rb +2 -0
- data/lib/ews/transporter.rb +4 -2
- data/test/credentials.rb +62 -0
- data/test/credentials.yml +53 -0
- data/test/exhaustive/batch_query_close_test.rb +193 -0
- data/test/exhaustive/forced_post_test.rb +3 -3
- data/test/exhaustive/online_debit_purchase_test.rb +9 -5
- data/test/exhaustive/online_debit_refund_test.rb +9 -5
- data/test/exhaustive/pre_auth_completion_test.rb +3 -3
- data/test/exhaustive/pre_auth_only_test.rb +9 -3
- data/test/exhaustive/pre_auth_test.rb +3 -3
- data/test/exhaustive/purchase_correction_test.rb +13 -7
- data/test/exhaustive/purchase_test.rb +3 -3
- data/test/exhaustive/recurring_seed_pre_auth_test.rb +3 -3
- data/test/exhaustive/recurring_seed_purchase_test.rb +3 -3
- data/test/exhaustive/refund_correction_test.rb +12 -6
- data/test/exhaustive/refund_test.rb +3 -3
- data/test/exhaustive/secure_storage_test.rb +3 -3
- data/test/exhaustive/tagged_online_debit_refund_test.rb +64 -37
- data/test/exhaustive/tagged_pre_auth_completion_test.rb +8 -8
- data/test/exhaustive/tagged_pre_auth_test.rb +8 -8
- data/test/exhaustive/tagged_purchase_test.rb +8 -8
- data/test/exhaustive/tagged_refund_test.rb +9 -9
- data/test/exhaustive/tagged_void_test.rb +24 -10
- data/test/exhaustive/transaction_details_test.rb +8 -6
- data/test/exhaustive/void_test.rb +9 -3
- data/test/general/avs_test.rb +7 -7
- data/test/general/request_test.rb +20 -37
- data/test/general/transporter_test.rb +6 -6
- data/test/general/validator_test.rb +2 -2
- data/test/test_helper.rb +8 -18
- metadata +5 -27
- data/doc/classes/EWS/Transaction/FakeResponse.html +0 -451
- data/doc/classes/EWS/Transaction/Request.html +0 -469
- data/doc/classes/EWS/Transaction/Response.html +0 -472
- data/doc/classes/EWS/Transaction/Validator.html +0 -182
- data/doc/classes/EWS/Transporter.html +0 -269
- data/doc/classes/REXML/Document.html +0 -176
- data/doc/classes/REXML/Entity.html +0 -150
- data/doc/classes/REXML.html +0 -112
- data/doc/created.rid +0 -1
- data/doc/files/CHANGELOG.html +0 -156
- data/doc/files/LICENCE.html +0 -109
- data/doc/files/README.html +0 -371
- data/doc/files/VERSION.html +0 -107
- data/doc/files/lib/ews/transaction/fake_response_rb.html +0 -101
- data/doc/files/lib/ews/transaction/mapping_rb.html +0 -108
- data/doc/files/lib/ews/transaction/request_rb.html +0 -108
- data/doc/files/lib/ews/transaction/response_rb.html +0 -101
- data/doc/files/lib/ews/transaction/validator_rb.html +0 -101
- data/doc/files/lib/ews/transporter_rb.html +0 -108
- data/doc/files/lib/exact4r_rb.html +0 -117
- data/doc/fr_class_index.html +0 -34
- data/doc/fr_file_index.html +0 -37
- data/doc/fr_method_index.html +0 -48
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
@@ -7,7 +7,7 @@ class PurchaseCorrectionTest < Test::Unit::TestCase
|
|
7
7
|
# using a normal Void transaction instead of a Purchase Correction.
|
8
8
|
|
9
9
|
def setup
|
10
|
-
@transporter = EWS::Transporter.new(
|
10
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_mandatory
|
@@ -15,11 +15,11 @@ class PurchaseCorrectionTest < Test::Unit::TestCase
|
|
15
15
|
assert !request.valid?
|
16
16
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
17
17
|
|
18
|
-
request.gateway_id =
|
18
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "password must be supplied", request.errors[:password]
|
21
21
|
|
22
|
-
request.password =
|
22
|
+
request.password = @@credentials.current_gateway[:password]
|
23
23
|
assert !request.valid?
|
24
24
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
25
25
|
|
@@ -43,8 +43,10 @@ class PurchaseCorrectionTest < Test::Unit::TestCase
|
|
43
43
|
assert request.valid?
|
44
44
|
end
|
45
45
|
|
46
|
-
def test_by_credit_card
|
47
|
-
|
46
|
+
def test_by_credit_card
|
47
|
+
return unless @@credentials.moneris?
|
48
|
+
|
49
|
+
request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :purchase_correction).merge(@@credentials.current_gateway))
|
48
50
|
request.amount = 11.25
|
49
51
|
request.authorization_num = "1234"
|
50
52
|
assert request.valid?, request.errors.inspect
|
@@ -55,7 +57,9 @@ class PurchaseCorrectionTest < Test::Unit::TestCase
|
|
55
57
|
end
|
56
58
|
|
57
59
|
def test_by_track1
|
58
|
-
|
60
|
+
return unless @@credentials.moneris?
|
61
|
+
|
62
|
+
request = EWS::Transaction::Request.new(track1_params.merge(:transaction_type => :purchase_correction).merge(@@credentials.current_gateway))
|
59
63
|
request.amount = 11.25
|
60
64
|
request.authorization_num = "1234"
|
61
65
|
assert request.valid?, request.errors.inspect
|
@@ -66,7 +70,9 @@ class PurchaseCorrectionTest < Test::Unit::TestCase
|
|
66
70
|
end
|
67
71
|
|
68
72
|
def test_by_track2
|
69
|
-
|
73
|
+
return unless @@credentials.moneris?
|
74
|
+
|
75
|
+
request = EWS::Transaction::Request.new(track2_params.merge(:transaction_type => :purchase_correction).merge(@@credentials.current_gateway))
|
70
76
|
request.amount = 11.25
|
71
77
|
request.authorization_num = "1234"
|
72
78
|
assert request.valid?, request.errors.inspect
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../test_helper"
|
|
3
3
|
class PurchaseTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@transporter = EWS::Transporter.new(
|
6
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_mandatory
|
@@ -11,11 +11,11 @@ class PurchaseTest < Test::Unit::TestCase
|
|
11
11
|
assert !request.valid?
|
12
12
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
13
13
|
|
14
|
-
request.gateway_id =
|
14
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
15
15
|
assert !request.valid?
|
16
16
|
assert_equal "password must be supplied", request.errors[:password]
|
17
17
|
|
18
|
-
request.password =
|
18
|
+
request.password = @@credentials.current_gateway[:password]
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
21
21
|
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../test_helper"
|
|
3
3
|
class RecurrringSeedPreAuthTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@transporter = EWS::Transporter.new(
|
6
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_mandatory
|
@@ -11,11 +11,11 @@ class RecurrringSeedPreAuthTest < Test::Unit::TestCase
|
|
11
11
|
assert !request.valid?
|
12
12
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
13
13
|
|
14
|
-
request.gateway_id =
|
14
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
15
15
|
assert !request.valid?
|
16
16
|
assert_equal "password must be supplied", request.errors[:password]
|
17
17
|
|
18
|
-
request.password =
|
18
|
+
request.password = @@credentials.current_gateway[:password]
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
21
21
|
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../test_helper"
|
|
3
3
|
class RecurringSeedPurchaseTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@transporter = EWS::Transporter.new(
|
6
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_mandatory
|
@@ -11,11 +11,11 @@ class RecurringSeedPurchaseTest < Test::Unit::TestCase
|
|
11
11
|
assert !request.valid?
|
12
12
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
13
13
|
|
14
|
-
request.gateway_id =
|
14
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
15
15
|
assert !request.valid?
|
16
16
|
assert_equal "password must be supplied", request.errors[:password]
|
17
17
|
|
18
|
-
request.password =
|
18
|
+
request.password = @@credentials.current_gateway[:password]
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
21
21
|
|
@@ -7,7 +7,7 @@ class RefundCorrectionTest < Test::Unit::TestCase
|
|
7
7
|
# using a normal Void transaction instead of a Refund Correction.
|
8
8
|
|
9
9
|
def setup
|
10
|
-
@transporter = EWS::Transporter.new(
|
10
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_mandatory
|
@@ -15,11 +15,11 @@ class RefundCorrectionTest < Test::Unit::TestCase
|
|
15
15
|
assert !request.valid?
|
16
16
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
17
17
|
|
18
|
-
request.gateway_id =
|
18
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "password must be supplied", request.errors[:password]
|
21
21
|
|
22
|
-
request.password =
|
22
|
+
request.password = @@credentials.current_gateway[:password]
|
23
23
|
assert !request.valid?
|
24
24
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
25
25
|
|
@@ -44,7 +44,9 @@ class RefundCorrectionTest < Test::Unit::TestCase
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_by_credit_card
|
47
|
-
|
47
|
+
return unless @@credentials.moneris?
|
48
|
+
|
49
|
+
request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :refund_correction).merge(@@credentials.current_gateway))
|
48
50
|
request.amount = 11.25
|
49
51
|
request.authorization_num = "1234"
|
50
52
|
assert request.valid?, request.errors.inspect
|
@@ -55,7 +57,9 @@ class RefundCorrectionTest < Test::Unit::TestCase
|
|
55
57
|
end
|
56
58
|
|
57
59
|
def test_by_track1
|
58
|
-
|
60
|
+
return unless @@credentials.moneris?
|
61
|
+
|
62
|
+
request = EWS::Transaction::Request.new(track1_params.merge(:transaction_type => :refund_correction).merge(@@credentials.current_gateway))
|
59
63
|
request.amount = 11.25
|
60
64
|
request.authorization_num = "1234"
|
61
65
|
assert request.valid?, request.errors.inspect
|
@@ -66,7 +70,9 @@ class RefundCorrectionTest < Test::Unit::TestCase
|
|
66
70
|
end
|
67
71
|
|
68
72
|
def test_by_track2
|
69
|
-
|
73
|
+
return unless @@credentials.moneris?
|
74
|
+
|
75
|
+
request = EWS::Transaction::Request.new(track2_params.merge(:transaction_type => :refund_correction).merge(@@credentials.current_gateway))
|
70
76
|
request.amount = 11.25
|
71
77
|
request.authorization_num = "1234"
|
72
78
|
assert request.valid?, request.errors.inspect
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../test_helper"
|
|
3
3
|
class RefundTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@transporter = EWS::Transporter.new(
|
6
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_mandatory
|
@@ -11,11 +11,11 @@ class RefundTest < Test::Unit::TestCase
|
|
11
11
|
assert !request.valid?
|
12
12
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
13
13
|
|
14
|
-
request.gateway_id =
|
14
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
15
15
|
assert !request.valid?
|
16
16
|
assert_equal "password must be supplied", request.errors[:password]
|
17
17
|
|
18
|
-
request.password =
|
18
|
+
request.password = @@credentials.current_gateway[:password]
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
21
21
|
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../test_helper"
|
|
3
3
|
class SecureStorageTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@transporter = EWS::Transporter.new(
|
6
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_mandatory
|
@@ -11,11 +11,11 @@ class SecureStorageTest < Test::Unit::TestCase
|
|
11
11
|
assert !request.valid?
|
12
12
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
13
13
|
|
14
|
-
request.gateway_id =
|
14
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
15
15
|
assert !request.valid?
|
16
16
|
assert_equal "password must be supplied", request.errors[:password]
|
17
17
|
|
18
|
-
request.password =
|
18
|
+
request.password = @@credentials.current_gateway[:password]
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
21
21
|
|
@@ -1,21 +1,9 @@
|
|
1
1
|
require File.dirname(__FILE__) + "/../test_helper"
|
2
2
|
|
3
|
-
class
|
3
|
+
class TaggedOnlineDebitRefundTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@transporter = EWS::Transporter.new(
|
7
|
-
|
8
|
-
# do initial recurring seed
|
9
|
-
request = EWS::Transaction::Request.new({
|
10
|
-
:transaction_type => :idebit_purchase,
|
11
|
-
:amount => 11.25,
|
12
|
-
:pan => TEST_CARD_NUMBER,
|
13
|
-
:cardholder_name => TEST_CARD_HOLDER
|
14
|
-
}.merge(CHASE_BASIC_AUTH))
|
15
|
-
assert request.valid?, request.errors.inspect
|
16
|
-
|
17
|
-
@response = @transporter.submit(request, :json)
|
18
|
-
assert @response.approved?
|
6
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
19
7
|
end
|
20
8
|
|
21
9
|
def test_mandatory
|
@@ -23,11 +11,11 @@ class TaggedRefundTest < Test::Unit::TestCase
|
|
23
11
|
assert !request.valid?
|
24
12
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
25
13
|
|
26
|
-
request.gateway_id =
|
14
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
27
15
|
assert !request.valid?
|
28
16
|
assert_equal "password must be supplied", request.errors[:password]
|
29
17
|
|
30
|
-
request.password =
|
18
|
+
request.password = @@credentials.current_gateway[:password]
|
31
19
|
assert !request.valid?
|
32
20
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
33
21
|
|
@@ -48,48 +36,64 @@ class TaggedRefundTest < Test::Unit::TestCase
|
|
48
36
|
end
|
49
37
|
|
50
38
|
def test_json
|
39
|
+
return unless @@credentials.chase?
|
40
|
+
|
41
|
+
response = do_online_debit_purchase
|
42
|
+
|
51
43
|
request = EWS::Transaction::Request.new({
|
52
44
|
:transaction_type => :tagged_online_debit_refund,
|
53
45
|
:amount => 12.50,
|
54
|
-
:transaction_tag =>
|
55
|
-
:authorization_num =>
|
56
|
-
}.merge(
|
46
|
+
:transaction_tag => response.transaction_tag,
|
47
|
+
:authorization_num => response.authorization_num
|
48
|
+
}.merge(@@credentials.current_gateway))
|
57
49
|
assert request.valid?, request.errors.inspect
|
58
50
|
|
59
51
|
assert_details_correct request, @transporter.submit(request, :json)
|
60
52
|
end
|
61
53
|
|
62
54
|
def test_rest
|
55
|
+
return unless @@credentials.chase?
|
56
|
+
|
57
|
+
response = do_online_debit_purchase
|
58
|
+
|
63
59
|
request = EWS::Transaction::Request.new({
|
64
60
|
:transaction_type => :tagged_online_debit_refund,
|
65
61
|
:amount => 12.50,
|
66
|
-
:transaction_tag =>
|
67
|
-
:authorization_num =>
|
68
|
-
}.merge(
|
62
|
+
:transaction_tag => response.transaction_tag,
|
63
|
+
:authorization_num => response.authorization_num
|
64
|
+
}.merge(@@credentials.current_gateway))
|
69
65
|
assert request.valid?, request.errors.inspect
|
70
66
|
|
71
67
|
assert_details_correct request, @transporter.submit(request, :rest)
|
72
68
|
end
|
73
69
|
|
74
70
|
def test_soap
|
71
|
+
return unless @@credentials.chase?
|
72
|
+
|
73
|
+
response = do_online_debit_purchase
|
74
|
+
|
75
75
|
request = EWS::Transaction::Request.new({
|
76
76
|
:transaction_type => :tagged_online_debit_refund,
|
77
77
|
:amount => 12.50,
|
78
|
-
:transaction_tag =>
|
79
|
-
:authorization_num =>
|
80
|
-
}.merge(
|
78
|
+
:transaction_tag => response.transaction_tag,
|
79
|
+
:authorization_num => response.authorization_num
|
80
|
+
}.merge(@@credentials.current_gateway))
|
81
81
|
assert request.valid?, request.errors.inspect
|
82
82
|
|
83
83
|
assert_details_correct request, @transporter.submit(request, :soap)
|
84
84
|
end
|
85
85
|
|
86
86
|
def test_multiple_refunds_against_one_seed
|
87
|
+
return unless @@credentials.chase?
|
88
|
+
|
89
|
+
response = do_online_debit_purchase
|
90
|
+
|
87
91
|
request = EWS::Transaction::Request.new({
|
88
92
|
:transaction_type => :tagged_online_debit_refund,
|
89
93
|
:amount => 3.50,
|
90
|
-
:transaction_tag =>
|
91
|
-
:authorization_num =>
|
92
|
-
}.merge(
|
94
|
+
:transaction_tag => response.transaction_tag,
|
95
|
+
:authorization_num => response.authorization_num
|
96
|
+
}.merge(@@credentials.current_gateway))
|
93
97
|
assert request.valid?, request.errors.inspect
|
94
98
|
|
95
99
|
assert_details_correct request, @transporter.submit(request, :json)
|
@@ -102,8 +106,10 @@ class TaggedRefundTest < Test::Unit::TestCase
|
|
102
106
|
end
|
103
107
|
|
104
108
|
def test_not_permitted_after_recurring_seed_purchase
|
109
|
+
return unless @@credentials.chase?
|
110
|
+
|
105
111
|
# do initial recurring seed pre auth
|
106
|
-
pre_request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :recurring_seed_purchase).merge(
|
112
|
+
pre_request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :recurring_seed_purchase).merge(@@credentials.current_gateway))
|
107
113
|
pre_request.amount = 10.1
|
108
114
|
assert pre_request.valid?, pre_request.errors.inspect
|
109
115
|
|
@@ -116,7 +122,7 @@ class TaggedRefundTest < Test::Unit::TestCase
|
|
116
122
|
:amount => 12.50,
|
117
123
|
:transaction_tag => pre_response.transaction_tag,
|
118
124
|
:authorization_num => pre_response.authorization_num
|
119
|
-
}.merge(
|
125
|
+
}.merge(@@credentials.current_gateway))
|
120
126
|
assert request.valid?, request.errors.inspect
|
121
127
|
|
122
128
|
response = @transporter.submit(request, :json)
|
@@ -124,8 +130,10 @@ class TaggedRefundTest < Test::Unit::TestCase
|
|
124
130
|
end
|
125
131
|
|
126
132
|
def test_not_permitted_after_recurring_seed_pre_auth
|
133
|
+
return unless @@credentials.chase?
|
134
|
+
|
127
135
|
# do initial recurring seed pre auth
|
128
|
-
pre_request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :recurring_seed_pre_auth).merge(
|
136
|
+
pre_request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :recurring_seed_pre_auth).merge(@@credentials.current_gateway))
|
129
137
|
pre_request.amount = 10.1
|
130
138
|
assert pre_request.valid?, pre_request.errors.inspect
|
131
139
|
|
@@ -138,16 +146,18 @@ class TaggedRefundTest < Test::Unit::TestCase
|
|
138
146
|
:amount => 12.50,
|
139
147
|
:transaction_tag => pre_response.transaction_tag,
|
140
148
|
:authorization_num => pre_response.authorization_num
|
141
|
-
}.merge(
|
149
|
+
}.merge(@@credentials.current_gateway))
|
142
150
|
assert request.valid?, request.errors.inspect
|
143
151
|
|
144
152
|
response = @transporter.submit(request, :json)
|
145
153
|
assert !response.approved?
|
146
154
|
end
|
147
155
|
|
148
|
-
def
|
156
|
+
def test_not_permitted_after_plain_purchase
|
157
|
+
return unless @@credentials.chase?
|
158
|
+
|
149
159
|
# do initial purchase
|
150
|
-
pre_request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :purchase).merge(
|
160
|
+
pre_request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :purchase).merge(@@credentials.current_gateway))
|
151
161
|
pre_request.amount = 10.1
|
152
162
|
assert pre_request.valid?, pre_request.errors.inspect
|
153
163
|
|
@@ -156,13 +166,30 @@ class TaggedRefundTest < Test::Unit::TestCase
|
|
156
166
|
|
157
167
|
# now do the tagged refund
|
158
168
|
request = EWS::Transaction::Request.new({
|
159
|
-
:transaction_type => :
|
169
|
+
:transaction_type => :tagged_online_debit_refund,
|
160
170
|
:amount => 12.50,
|
161
171
|
:transaction_tag => pre_response.transaction_tag,
|
162
172
|
:authorization_num => pre_response.authorization_num
|
163
|
-
}.merge(
|
173
|
+
}.merge(@@credentials.current_gateway))
|
164
174
|
assert request.valid?, request.errors.inspect
|
165
175
|
|
166
|
-
|
176
|
+
response = @transporter.submit(request, :json)
|
177
|
+
assert !response.approved?
|
178
|
+
end
|
179
|
+
|
180
|
+
private
|
181
|
+
def do_online_debit_purchase
|
182
|
+
# do initial Online Debit Purchase
|
183
|
+
request = EWS::Transaction::Request.new({
|
184
|
+
:transaction_type => :idebit_purchase,
|
185
|
+
:amount => 13.00,
|
186
|
+
:pan => TEST_CARD_NUMBER,
|
187
|
+
:cardholder_name => TEST_CARD_HOLDER
|
188
|
+
}.merge(@@credentials.current_gateway))
|
189
|
+
assert request.valid?, request.errors.inspect
|
190
|
+
|
191
|
+
response = @transporter.submit(request, :json)
|
192
|
+
assert response.approved?
|
193
|
+
response
|
167
194
|
end
|
168
195
|
end
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../test_helper"
|
|
3
3
|
class TaggedPreAuthCompletionTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@transporter = EWS::Transporter.new(
|
6
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
7
7
|
|
8
8
|
# do initial recurring seed
|
9
9
|
request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :recurring_seed_pre_auth))
|
@@ -19,11 +19,11 @@ class TaggedPreAuthCompletionTest < Test::Unit::TestCase
|
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
21
21
|
|
22
|
-
request.gateway_id =
|
22
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
23
23
|
assert !request.valid?
|
24
24
|
assert_equal "password must be supplied", request.errors[:password]
|
25
25
|
|
26
|
-
request.password =
|
26
|
+
request.password = @@credentials.current_gateway[:password]
|
27
27
|
assert !request.valid?
|
28
28
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
29
29
|
|
@@ -49,7 +49,7 @@ class TaggedPreAuthCompletionTest < Test::Unit::TestCase
|
|
49
49
|
:amount => 12.50,
|
50
50
|
:transaction_tag => @response.transaction_tag,
|
51
51
|
:authorization_num => @response.authorization_num
|
52
|
-
}.merge(
|
52
|
+
}.merge(@@credentials.current_gateway))
|
53
53
|
assert request.valid?, request.errors.inspect
|
54
54
|
|
55
55
|
assert_details_correct request, @transporter.submit(request, :json)
|
@@ -61,7 +61,7 @@ class TaggedPreAuthCompletionTest < Test::Unit::TestCase
|
|
61
61
|
:amount => 12.50,
|
62
62
|
:transaction_tag => @response.transaction_tag,
|
63
63
|
:authorization_num => @response.authorization_num
|
64
|
-
}.merge(
|
64
|
+
}.merge(@@credentials.current_gateway))
|
65
65
|
assert request.valid?, request.errors.inspect
|
66
66
|
|
67
67
|
assert_details_correct request, @transporter.submit(request, :rest)
|
@@ -73,7 +73,7 @@ class TaggedPreAuthCompletionTest < Test::Unit::TestCase
|
|
73
73
|
:amount => 12.50,
|
74
74
|
:transaction_tag => @response.transaction_tag,
|
75
75
|
:authorization_num => @response.authorization_num
|
76
|
-
}.merge(
|
76
|
+
}.merge(@@credentials.current_gateway))
|
77
77
|
assert request.valid?, request.errors.inspect
|
78
78
|
|
79
79
|
assert_details_correct request, @transporter.submit(request, :soap)
|
@@ -85,7 +85,7 @@ class TaggedPreAuthCompletionTest < Test::Unit::TestCase
|
|
85
85
|
:amount => 12.50,
|
86
86
|
:transaction_tag => @response.transaction_tag,
|
87
87
|
:authorization_num => @response.authorization_num
|
88
|
-
}.merge(
|
88
|
+
}.merge(@@credentials.current_gateway))
|
89
89
|
assert request.valid?, request.errors.inspect
|
90
90
|
|
91
91
|
assert_details_correct request, @transporter.submit(request, :json)
|
@@ -110,7 +110,7 @@ class TaggedPreAuthCompletionTest < Test::Unit::TestCase
|
|
110
110
|
:amount => 12.50,
|
111
111
|
:transaction_tag => pre_response.transaction_tag,
|
112
112
|
:authorization_num => pre_response.authorization_num
|
113
|
-
}.merge(
|
113
|
+
}.merge(@@credentials.current_gateway))
|
114
114
|
assert request.valid?, request.errors.inspect
|
115
115
|
|
116
116
|
response = @transporter.submit(request, :json)
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../test_helper"
|
|
3
3
|
class TaggedPreAuthTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@transporter = EWS::Transporter.new(
|
6
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
7
7
|
|
8
8
|
# do initial recurring seed
|
9
9
|
request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :recurring_seed_pre_auth))
|
@@ -19,11 +19,11 @@ class TaggedPreAuthTest < Test::Unit::TestCase
|
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
21
21
|
|
22
|
-
request.gateway_id =
|
22
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
23
23
|
assert !request.valid?
|
24
24
|
assert_equal "password must be supplied", request.errors[:password]
|
25
25
|
|
26
|
-
request.password =
|
26
|
+
request.password = @@credentials.current_gateway[:password]
|
27
27
|
assert !request.valid?
|
28
28
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
29
29
|
|
@@ -49,7 +49,7 @@ class TaggedPreAuthTest < Test::Unit::TestCase
|
|
49
49
|
:amount => 12.50,
|
50
50
|
:transaction_tag => @response.transaction_tag,
|
51
51
|
:authorization_num => @response.authorization_num
|
52
|
-
}.merge(
|
52
|
+
}.merge(@@credentials.current_gateway))
|
53
53
|
assert request.valid?, request.errors.inspect
|
54
54
|
|
55
55
|
assert_details_correct request, @transporter.submit(request, :json)
|
@@ -61,7 +61,7 @@ class TaggedPreAuthTest < Test::Unit::TestCase
|
|
61
61
|
:amount => 12.50,
|
62
62
|
:transaction_tag => @response.transaction_tag,
|
63
63
|
:authorization_num => @response.authorization_num
|
64
|
-
}.merge(
|
64
|
+
}.merge(@@credentials.current_gateway))
|
65
65
|
assert request.valid?, request.errors.inspect
|
66
66
|
|
67
67
|
assert_details_correct request, @transporter.submit(request, :rest)
|
@@ -73,7 +73,7 @@ class TaggedPreAuthTest < Test::Unit::TestCase
|
|
73
73
|
:amount => 12.50,
|
74
74
|
:transaction_tag => @response.transaction_tag,
|
75
75
|
:authorization_num => @response.authorization_num
|
76
|
-
}.merge(
|
76
|
+
}.merge(@@credentials.current_gateway))
|
77
77
|
assert request.valid?, request.errors.inspect
|
78
78
|
|
79
79
|
assert_details_correct request, @transporter.submit(request, :soap)
|
@@ -85,7 +85,7 @@ class TaggedPreAuthTest < Test::Unit::TestCase
|
|
85
85
|
:amount => 12.50,
|
86
86
|
:transaction_tag => @response.transaction_tag,
|
87
87
|
:authorization_num => @response.authorization_num
|
88
|
-
}.merge(
|
88
|
+
}.merge(@@credentials.current_gateway))
|
89
89
|
assert request.valid?, request.errors.inspect
|
90
90
|
|
91
91
|
assert_details_correct request, @transporter.submit(request, :json)
|
@@ -108,7 +108,7 @@ class TaggedPreAuthTest < Test::Unit::TestCase
|
|
108
108
|
:amount => 12.50,
|
109
109
|
:transaction_tag => pre_response.transaction_tag,
|
110
110
|
:authorization_num => pre_response.authorization_num
|
111
|
-
}.merge(
|
111
|
+
}.merge(@@credentials.current_gateway))
|
112
112
|
assert request.valid?, request.errors.inspect
|
113
113
|
|
114
114
|
assert_details_correct request, @transporter.submit(request, :json)
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../test_helper"
|
|
3
3
|
class TaggedPurchaseTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@transporter = EWS::Transporter.new(
|
6
|
+
@transporter = EWS::Transporter.new(@@credentials.config['location'])
|
7
7
|
|
8
8
|
# do initial recurring seed
|
9
9
|
request = EWS::Transaction::Request.new(cc_number_params.merge(:transaction_type => :recurring_seed_purchase))
|
@@ -19,11 +19,11 @@ class TaggedPurchaseTest < Test::Unit::TestCase
|
|
19
19
|
assert !request.valid?
|
20
20
|
assert_equal "gateway_id must be supplied", request.errors[:gateway_id]
|
21
21
|
|
22
|
-
request.gateway_id =
|
22
|
+
request.gateway_id = @@credentials.current_gateway[:gateway_id]
|
23
23
|
assert !request.valid?
|
24
24
|
assert_equal "password must be supplied", request.errors[:password]
|
25
25
|
|
26
|
-
request.password =
|
26
|
+
request.password = @@credentials.current_gateway[:password]
|
27
27
|
assert !request.valid?
|
28
28
|
assert_equal "One of the following must be supplied: cc_number, track1, track2 or transaction_tag.", request.errors[:base]
|
29
29
|
|
@@ -49,7 +49,7 @@ class TaggedPurchaseTest < Test::Unit::TestCase
|
|
49
49
|
:amount => 12.50,
|
50
50
|
:transaction_tag => @response.transaction_tag,
|
51
51
|
:authorization_num => @response.authorization_num
|
52
|
-
}.merge(
|
52
|
+
}.merge(@@credentials.current_gateway))
|
53
53
|
assert request.valid?, request.errors.inspect
|
54
54
|
|
55
55
|
assert_details_correct request, @transporter.submit(request, :json)
|
@@ -61,7 +61,7 @@ class TaggedPurchaseTest < Test::Unit::TestCase
|
|
61
61
|
:amount => 12.50,
|
62
62
|
:transaction_tag => @response.transaction_tag,
|
63
63
|
:authorization_num => @response.authorization_num
|
64
|
-
}.merge(
|
64
|
+
}.merge(@@credentials.current_gateway))
|
65
65
|
assert request.valid?, request.errors.inspect
|
66
66
|
|
67
67
|
assert_details_correct request, @transporter.submit(request, :rest)
|
@@ -73,7 +73,7 @@ class TaggedPurchaseTest < Test::Unit::TestCase
|
|
73
73
|
:amount => 12.50,
|
74
74
|
:transaction_tag => @response.transaction_tag,
|
75
75
|
:authorization_num => @response.authorization_num
|
76
|
-
}.merge(
|
76
|
+
}.merge(@@credentials.current_gateway))
|
77
77
|
assert request.valid?, request.errors.inspect
|
78
78
|
|
79
79
|
assert_details_correct request, @transporter.submit(request, :soap)
|
@@ -85,7 +85,7 @@ class TaggedPurchaseTest < Test::Unit::TestCase
|
|
85
85
|
:amount => 12.50,
|
86
86
|
:transaction_tag => @response.transaction_tag,
|
87
87
|
:authorization_num => @response.authorization_num
|
88
|
-
}.merge(
|
88
|
+
}.merge(@@credentials.current_gateway))
|
89
89
|
assert request.valid?, request.errors.inspect
|
90
90
|
|
91
91
|
assert_details_correct request, @transporter.submit(request, :json)
|
@@ -108,7 +108,7 @@ class TaggedPurchaseTest < Test::Unit::TestCase
|
|
108
108
|
:amount => 12.50,
|
109
109
|
:transaction_tag => pre_response.transaction_tag,
|
110
110
|
:authorization_num => pre_response.authorization_num
|
111
|
-
}.merge(
|
111
|
+
}.merge(@@credentials.current_gateway))
|
112
112
|
assert request.valid?, request.errors.inspect
|
113
113
|
|
114
114
|
assert_details_correct request, @transporter.submit(request, :json)
|