heartland_portico 3.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,39 @@
1
+ <tns:Ver1.0>
2
+ <tns:Header>
3
+ <tns:ClerkID>${#Project#ClerkID}</tns:ClerkID>
4
+ <tns:DeveloperID>${#Project#DeveloperID}</tns:DeveloperID>
5
+ <tns:DeviceId>${#Project#DeviceID-Retail}</tns:DeviceId>
6
+ <tns:LicenseId>${#Project#LicenseID-Retail}</tns:LicenseId>
7
+ <tns:Password>${#Project#Password}</tns:Password>
8
+ <tns:SiteId>${#Project#SiteID-Retail}</tns:SiteId>
9
+ <tns:SiteTrace>${#Project#SiteTrace}</tns:SiteTrace>
10
+ <tns:UserName>${#Project#UserName-Retail}</tns:UserName>
11
+ <tns:VersionNbr>${#Project#VersionNbr}</tns:VersionNbr>
12
+ </tns:Header>
13
+ <tns:Transaction>
14
+ <tns:CheckSale>
15
+ <tns:Block1>
16
+ <tns:AccountInfo>
17
+ <tns:AccountNumber>24413815</tns:AccountNumber>
18
+ <tns:AccountType>CHECKING</tns:AccountType>
19
+ <tns:RoutingNumber>490000018</tns:RoutingNumber>
20
+ </tns:AccountInfo>
21
+ <tns:Amt>1.00</tns:Amt>
22
+ <tns:CheckAction>SALE</tns:CheckAction>
23
+ <tns:CheckType>PERSONAL</tns:CheckType>
24
+ <tns:ConsumerInfo>
25
+ <tns:Address1>123 Main St</tns:Address1>
26
+ <tns:CheckName>Heartland Pays</tns:CheckName>
27
+ <tns:City>New York</tns:City>
28
+ <tns:FirstName>Bob</tns:FirstName>
29
+ <tns:LastName>Smith</tns:LastName>
30
+ <tns:PhoneNumber>5555551234</tns:PhoneNumber>
31
+ <tns:State>NY</tns:State>
32
+ <tns:Zip>10120</tns:Zip>
33
+ </tns:ConsumerInfo>
34
+ <tns:DataEntryMode>MANUAL</tns:DataEntryMode>
35
+ <tns:SECCode>PPD</tns:SECCode>
36
+ </tns:Block1>
37
+ </tns:CheckSale>
38
+ </tns:Transaction>
39
+ </tns:Ver1.0>
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3
+ <soap:Body>
4
+ <PosResponse xmlns="http://Hps.Exchange.PosGateway" rootUrl="https://cert.api2.heartlandportico.com/Hps.Exchange.PosGateway">
5
+ <Ver1.0>
6
+ <Header>
7
+ <LicenseId>21198</LicenseId>
8
+ <SiteId>21201</SiteId>
9
+ <DeviceId>1525731</DeviceId>
10
+ <GatewayTxnId>20865555</GatewayTxnId>
11
+ <GatewayRspCode>0</GatewayRspCode>
12
+ <GatewayRspMsg>Success</GatewayRspMsg>
13
+ <RspDT>2014-10-28T12:49:21.9037146</RspDT>
14
+ </Header>
15
+ <Transaction>
16
+ <CheckSale>
17
+ <RspCode>0</RspCode>
18
+ <RspMessage>Transaction Approved</RspMessage>
19
+ <AuthCode> 272-172</AuthCode>
20
+ <CheckRspInfo>
21
+ <Type>Approve</Type>
22
+ <Code>A-4096</Code>
23
+ <Message>Internal Override</Message>
24
+ </CheckRspInfo>
25
+ </CheckSale>
26
+ </Transaction>
27
+ </Ver1.0>
28
+ </PosResponse>
29
+ </soap:Body>
30
+ </soap:Envelope>
@@ -0,0 +1,31 @@
1
+ <!--
2
+ See PorticoGatewayDeveloperGuideExamples-Cert-soapui-project.xml line 17330
3
+ -->
4
+ <tns:Ver1.0>
5
+ <tns:Header>
6
+ <tns:ClerkID>${#Project#ClerkID}</tns:ClerkID>
7
+ <tns:DeveloperID>${#Project#DeveloperID}</tns:DeveloperID>
8
+ <tns:DeviceId>${#Project#DeviceID-Retail}</tns:DeviceId>
9
+ <tns:LicenseId>${#Project#LicenseID-Retail}</tns:LicenseId>
10
+ <tns:Password>${#Project#Password}</tns:Password>
11
+ <tns:SiteId>${#Project#SiteID-Retail}</tns:SiteId>
12
+ <tns:SiteTrace>${#Project#SiteTrace}</tns:SiteTrace>
13
+ <tns:UserName>${#Project#UserName-Retail}</tns:UserName>
14
+ <tns:VersionNbr>${#Project#VersionNbr}</tns:VersionNbr>
15
+ </tns:Header>
16
+ <tns:Transaction>
17
+ <tns:CreditAccountVerify>
18
+ <tns:Block1>
19
+ <tns:CardData>
20
+ <tns:ManualEntry>
21
+ <tns:CardNbr>${#Project#CardNumberVISA}</tns:CardNbr>
22
+ <tns:ExpMonth>${#Project#ExpMonth}</tns:ExpMonth>
23
+ <tns:ExpYear>${#Project#ExpYear}</tns:ExpYear>
24
+ </tns:ManualEntry>
25
+ </tns:CardData>
26
+ <tns:CardHolderData>
27
+ </tns:CardHolderData>
28
+ </tns:Block1>
29
+ </tns:CreditAccountVerify>
30
+ </tns:Transaction>
31
+ </tns:Ver1.0>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3
+ <soap:Body>
4
+ <PosResponse xmlns="http://Hps.Exchange.PosGateway" rootUrl="https://cert.api2.heartlandportico.com/Hps.Exchange.PosGateway">
5
+ <Ver1.0>
6
+ <Header>
7
+ <LicenseId>21198</LicenseId>
8
+ <SiteId>21201</SiteId>
9
+ <DeviceId>1525731</DeviceId>
10
+ <GatewayTxnId>9379359</GatewayTxnId>
11
+ <GatewayRspCode>0</GatewayRspCode>
12
+ <GatewayRspMsg>Success</GatewayRspMsg>
13
+ <RspDT>2013-12-27T12:49:49.6239883</RspDT>
14
+ </Header>
15
+ <Transaction>
16
+ <CreditAccountVerify>
17
+ <RspCode>85</RspCode>
18
+ <RspText>CARD OK</RspText>
19
+ <AuthCode>18972A</AuthCode>
20
+ <AVSRsltCode>0</AVSRsltCode>
21
+ <RefNbr>336113690998</RefNbr>
22
+ <CardType>Visa</CardType>
23
+ <AVSRsltText>AVS Not Requested.</AVSRsltText>
24
+ </CreditAccountVerify>
25
+ </Transaction>
26
+ </Ver1.0>
27
+ </PosResponse>
28
+ </soap:Body>
29
+ </soap:Envelope>
@@ -0,0 +1,27 @@
1
+ <tns:Ver1.0>
2
+ <tns:Header>
3
+ <tns:DeveloperID>002914</tns:DeveloperID>
4
+ <tns:DeviceId>1525731</tns:DeviceId>
5
+ <tns:LicenseId>21198</tns:LicenseId>
6
+ <tns:Password>$Test1234</tns:Password>
7
+ <tns:SiteId>21201</tns:SiteId>
8
+ <tns:UserName>777700007186</tns:UserName>
9
+ <tns:VersionNbr>1551</tns:VersionNbr>
10
+ </tns:Header>
11
+ <tns:Transaction>
12
+ <tns:CreditAuth>
13
+ <tns:Block1>
14
+ <tns:AllowDup>Y</tns:AllowDup>
15
+ <tns:Amt>1.00</tns:Amt>
16
+ <tns:CardData>
17
+ <tns:ManualEntry>
18
+ <tns:CardNbr>4012002000060016</tns:CardNbr>
19
+ <tns:ExpMonth>12</tns:ExpMonth>
20
+ <tns:ExpYear>2025</tns:ExpYear>
21
+ </tns:ManualEntry>
22
+ </tns:CardData>
23
+ <tns:Ecommerce>ECOM</tns:Ecommerce>
24
+ </tns:Block1>
25
+ </tns:CreditAuth>
26
+ </tns:Transaction>
27
+ </tns:Ver1.0>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3
+ <soap:Body>
4
+ <PosResponse xmlns="http://Hps.Exchange.PosGateway" rootUrl="https://cert.api2.heartlandportico.com/Hps.Exchange.PosGateway">
5
+ <Ver1.0>
6
+ <Header>
7
+ <LicenseId>21198</LicenseId>
8
+ <SiteId>21201</SiteId>
9
+ <DeviceId>1525731</DeviceId>
10
+ <GatewayTxnId>9379561</GatewayTxnId>
11
+ <GatewayRspCode>0</GatewayRspCode>
12
+ <GatewayRspMsg>Success</GatewayRspMsg>
13
+ <RspDT>2013-12-27T16:52:28.8073158</RspDT>
14
+ </Header>
15
+ <Transaction>
16
+ <CreditAuth>
17
+ <RspCode>00</RspCode>
18
+ <RspText>APPROVAL</RspText>
19
+ <AuthCode>19194A</AuthCode>
20
+ <AVSRsltCode>0</AVSRsltCode>
21
+ <RefNbr>336113692611</RefNbr>
22
+ <CardType>Visa</CardType>
23
+ <AVSRsltText>AVS Not Requested.</AVSRsltText>
24
+ </CreditAuth>
25
+ </Transaction>
26
+ </Ver1.0>
27
+ </PosResponse>
28
+ </soap:Body>
29
+ </soap:Envelope>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3
+ <soap:Body>
4
+ <PosResponse xmlns="http://Hps.Exchange.PosGateway" rootUrl="https://cert.api2.heartlandportico.com/Hps.Exchange.PosGateway">
5
+ <Ver1.0>
6
+ <Header>
7
+ <LicenseId>21198</LicenseId>
8
+ <SiteId>21201</SiteId>
9
+ <DeviceId>1525731</DeviceId>
10
+ <GatewayTxnId>9379563</GatewayTxnId>
11
+ <GatewayRspCode>0</GatewayRspCode>
12
+ <GatewayRspMsg>Success</GatewayRspMsg>
13
+ <RspDT>2013-12-27T16:52:31.4281326</RspDT>
14
+ </Header>
15
+ <Transaction>
16
+ <CreditAuth>
17
+ <RspCode>05</RspCode>
18
+ <RspText>DECLINE</RspText>
19
+ <AuthCode> </AuthCode>
20
+ <AVSRsltCode>0</AVSRsltCode>
21
+ <RefNbr>336113692612</RefNbr>
22
+ <CardType>Visa</CardType>
23
+ <AVSRsltText>AVS Not Requested.</AVSRsltText>
24
+ </CreditAuth>
25
+ </Transaction>
26
+ </Ver1.0>
27
+ </PosResponse>
28
+ </soap:Body>
29
+ </soap:Envelope>
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3
+ <soap:Body>
4
+ <PosResponse xmlns="http://Hps.Exchange.PosGateway" rootUrl="https://cert.api2.heartlandportico.com/Hps.Exchange.PosGateway">
5
+ <Ver1.0>
6
+ <Header>
7
+ <GatewayTxnId>9367952</GatewayTxnId>
8
+ <GatewayRspCode>-2</GatewayRspCode>
9
+ <GatewayRspMsg>Authentication Error</GatewayRspMsg>
10
+ <RspDT>2013-12-24T16:07:16.0295985</RspDT>
11
+ </Header>
12
+ </Ver1.0>
13
+ </PosResponse>
14
+ </soap:Body>
15
+ </soap:Envelope>
@@ -0,0 +1,108 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ module Savon
4
+ class Operation
5
+ def httpi
6
+ $httpi || HTTPI
7
+ end
8
+ def call_with_logging(request)
9
+ @logger.log(request) { httpi.post(request) }
10
+ end
11
+ end
12
+ end
13
+
14
+ require 'savon/mock/spec_helper'
15
+
16
+ describe HeartlandPortico::ACH do
17
+ include Savon::SpecHelper
18
+ before(:all) { savon.mock! }
19
+ after(:all) { savon.unmock! }
20
+
21
+ let(:client) { HeartlandPortico::ACH.new(config['credentials']) }
22
+ let(:config) {
23
+ YAML.load(File.read('./config/spec.yml'))
24
+ }
25
+
26
+ let(:expected_request) { xml_fixture("check_sale_request_stub") }
27
+ let(:success_response) { xml_fixture("check_sale_response_success") }
28
+ let(:auth_error_response) { xml_fixture("response_authentication_error") }
29
+
30
+ describe '#sale' do
31
+ let(:params) {{
32
+ :sec_code => 'PPD',
33
+ :check_type => 'PERSONAL',
34
+ :account_type => 'CHECKING',
35
+
36
+ :routing_number => '490000018',
37
+ :account_number => '24413815',
38
+
39
+ :first_name => "Bob",
40
+ :last_name => "Smith",
41
+ :address => "123 Main St",
42
+ :city => "New York",
43
+ :state => "NY",
44
+ :zip => "10120",
45
+ :phone => "5555551234",
46
+ :memo => "Heartland Pays",
47
+ }}
48
+ let(:amount) { 100 }
49
+
50
+ describe "standard request" do
51
+ let(:response) {
52
+ savon.expects(:do_transaction).with(:message => expected_request).returns(success_response)
53
+ client.sale(amount, params)
54
+ }
55
+
56
+ it { expect(response.message).to eq("Transaction Approved")}
57
+ it { expect(response).to be_success }
58
+ it { expect(response.authorization).to eq("20865555")}
59
+ end
60
+
61
+ describe "with bad authentication" do
62
+ let(:response) {
63
+ savon.expects(:do_transaction).with(:message => expected_request).returns(auth_error_response)
64
+ client.sale(amount, params)
65
+ }
66
+
67
+ it { expect(response.message).to eq("ERROR")}
68
+ it { expect(response).to_not be_success }
69
+ end
70
+ end
71
+ end
72
+
73
+ describe HeartlandPortico::ACH, :remote => true do
74
+ let(:client) { HeartlandPortico::ACH.new(config['credentials']) }
75
+ let(:config) {
76
+ # Copy config/spec.yml to config/cert.yml and replace values
77
+ # as provided by your certification contact to run remote specs.
78
+ YAML.load(File.read('./config/cert.yml'))
79
+ }
80
+
81
+ describe '#sale' do
82
+ let(:params) {{
83
+ :sec_code => 'PPD',
84
+ :check_type => 'PERSONAL',
85
+ :account_type => 'CHECKING',
86
+
87
+ :routing_number => '490000018',
88
+ :account_number => '24413815',
89
+
90
+ :first_name => "Bob",
91
+ :last_name => "Smith",
92
+ :address => "123 Main St",
93
+ :city => "New York",
94
+ :state => "NY",
95
+ :zip => "10120",
96
+ :phone => "5555551234",
97
+ :memo => "Heartland Pays",
98
+ }}
99
+ let(:amount) { "1.00" }
100
+ let(:response) { client.sale(amount, params) }
101
+
102
+ describe "for great success" do
103
+ it { expect(response).to be_success }
104
+ it { expect(response).to be_successful_request }
105
+ it { expect(response.message).to eq("Transaction Approved") }
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,108 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ require 'savon/mock/spec_helper'
4
+
5
+ describe HeartlandPortico do
6
+ include Savon::SpecHelper
7
+ before(:all) { savon.mock! }
8
+ after(:all) { savon.unmock! }
9
+
10
+ let(:client) { HeartlandPortico.new(config['credentials']) }
11
+ let(:config) {
12
+ YAML.load(File.read('./config/spec.yml'))
13
+ }
14
+
15
+ describe '#credit_account_verify' do
16
+ let(:card_data) {{
17
+ :manual_entry => {
18
+ :card_nbr => '${#Project#CardNumberVISA}',
19
+ :exp_month => '${#Project#ExpMonth}',
20
+ :exp_year => '${#Project#ExpYear}'
21
+ }
22
+ }}
23
+ let(:card_holder_data) {{}}
24
+ let(:params) {{
25
+ :card_data => card_data,
26
+ :card_holder_data => card_holder_data
27
+ }}
28
+
29
+ let(:expected_request) { xml_fixture("credit_account_verify_request_stub") }
30
+ let(:success_response) { xml_fixture("credit_account_verify_response_success") }
31
+ let(:auth_error_response) { xml_fixture("response_authentication_error") }
32
+
33
+ describe "standard request" do
34
+ let(:response) {
35
+ savon.expects(:do_transaction).with(:message => expected_request).returns(success_response)
36
+ client.credit_account_verify(params)
37
+ }
38
+
39
+ it { expect(response.message).to eq("CARD OK")}
40
+ it { expect(response).to be_success }
41
+ end
42
+
43
+ describe "with bad authentication" do
44
+ let(:response) {
45
+ savon.expects(:do_transaction).with(:message => expected_request).returns(auth_error_response)
46
+ client.credit_account_verify(params)
47
+ }
48
+
49
+ it { expect(response.message).to eq("ERROR")}
50
+ it { expect(response).to_not be_success }
51
+ end
52
+ end
53
+ end
54
+
55
+ describe HeartlandPortico, :remote => true do
56
+ let(:client) { HeartlandPortico.new(config['credentials']) }
57
+ let(:config) {
58
+ # Copy config/spec.yml to config/cert.yml and replace values
59
+ # as provided by your certification contact to run remote specs.
60
+ YAML.load(File.read('./config/cert.yml'))
61
+ }
62
+
63
+ describe '#credit_account_verify' do
64
+ let(:card_data) {{ :manual_entry => config['test_visa'] }}
65
+ let(:card_holder_data) {{}}
66
+ let(:params) {{
67
+ :card_data => card_data,
68
+ :card_holder_data => card_holder_data
69
+ }}
70
+
71
+ it "returns a response" do
72
+ response = client.credit_account_verify(params)
73
+ expect(response).to be_success
74
+ expect(response.message).to eq("CARD OK")
75
+ end
76
+ end
77
+
78
+
79
+ describe '#credit_auth' do
80
+ let(:card_data) {{ :manual_entry => config['test_visa'] }}
81
+ let(:card_holder_data) {{}}
82
+ let(:params) {{
83
+ :allow_dup => 'Y', # For tests only, obviously
84
+ :amt => amount,
85
+ # gateway_txn_id => Previous request transaction ID
86
+ :card_data => card_data,
87
+ :card_holder_data => card_holder_data,
88
+ :ecommerce => "ECOM",
89
+ }}
90
+ let(:response) { client.credit_auth(params) }
91
+
92
+ describe "for great success" do
93
+ let(:amount) { "1.00" }
94
+
95
+ it { expect(response).to be_success }
96
+ it { expect(response).to be_successful_request }
97
+ it { expect(response.message).to eq("APPROVAL") }
98
+ end
99
+
100
+ describe "returns a decline response" do
101
+ let(:amount) { "10.25" }
102
+
103
+ it { expect(response).to_not be_success }
104
+ it { expect(response).to be_successful_request }
105
+ it { expect(response.message).to eq("DECLINE") }
106
+ end
107
+ end
108
+ end