worldnet_tps 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rvmrc +1 -0
- data/.travis.yml +6 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +22 -0
- data/README.md +70 -0
- data/Rakefile +6 -0
- data/lib/worldnet_tps.rb +12 -0
- data/lib/worldnet_tps/const.rb +42 -0
- data/lib/worldnet_tps/gateway.rb +71 -0
- data/lib/worldnet_tps/gateway.xsd +1909 -0
- data/lib/worldnet_tps/request/base.rb +107 -0
- data/lib/worldnet_tps/request/payment.rb +89 -0
- data/lib/worldnet_tps/request/refund.rb +59 -0
- data/lib/worldnet_tps/request/secure_card/registration.rb +71 -0
- data/lib/worldnet_tps/request/secure_card/removal.rb +46 -0
- data/lib/worldnet_tps/request/secure_card/search.rb +52 -0
- data/lib/worldnet_tps/response/error.rb +18 -0
- data/lib/worldnet_tps/response/invalid_hash.rb +21 -0
- data/lib/worldnet_tps/response/success.rb +25 -0
- data/lib/worldnet_tps/version.rb +3 -0
- data/lib/worldnet_tps/ws_object.rb +76 -0
- data/lib/worldnet_tps/xsd.rb +27 -0
- data/spec/fixtures/vcr_cassettes/payment/credit_card/failed.yml +60 -0
- data/spec/fixtures/vcr_cassettes/payment/credit_card/success.yml +59 -0
- data/spec/fixtures/vcr_cassettes/payment/secure_card/failed.yml +57 -0
- data/spec/fixtures/vcr_cassettes/payment/secure_card/success.yml +56 -0
- data/spec/fixtures/vcr_cassettes/refund/order_id/failed.yml +47 -0
- data/spec/fixtures/vcr_cassettes/refund/order_id/success.yml +46 -0
- data/spec/fixtures/vcr_cassettes/refund/unique_ref/failed.yml +47 -0
- data/spec/fixtures/vcr_cassettes/refund/unique_ref/success.yml +46 -0
- data/spec/fixtures/vcr_cassettes/secure_card/registration/registrarion_failed.yml +49 -0
- data/spec/fixtures/vcr_cassettes/secure_card/registration/registration_failed.yml +49 -0
- data/spec/fixtures/vcr_cassettes/secure_card/registration/registration_success.yml +48 -0
- data/spec/fixtures/vcr_cassettes/secure_card/registration/update_failed.yml +49 -0
- data/spec/fixtures/vcr_cassettes/secure_card/registration/update_success.yml +48 -0
- data/spec/fixtures/vcr_cassettes/secure_card/registration/update_success_success.yml +48 -0
- data/spec/fixtures/vcr_cassettes/secure_card/removal/failed.yml +45 -0
- data/spec/fixtures/vcr_cassettes/secure_card/removal/success.yml +44 -0
- data/spec/fixtures/vcr_cassettes/secure_card/search/failed.yml +44 -0
- data/spec/fixtures/vcr_cassettes/secure_card/search/success.yml +44 -0
- data/spec/gateway_spec.rb +42 -0
- data/spec/payment_spec.rb +117 -0
- data/spec/refund_spec.rb +95 -0
- data/spec/secure_card/registration_spec.rb +103 -0
- data/spec/secure_card/removal_spec.rb +57 -0
- data/spec/secure_card/search_spec.rb +58 -0
- data/spec/spec_helper.rb +58 -0
- data/spec/xsd_spec.rb +30 -0
- data/worldnet_tps.gemspec +28 -0
- metadata +205 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
module WorldnetTps
|
2
|
+
module Response
|
3
|
+
class InvalidHash < WorldnetTps::Response::Success
|
4
|
+
|
5
|
+
MESSAGE = 'INVALID RESPONSE HASH'.freeze
|
6
|
+
CODE = 'ECUSTOM'.freeze
|
7
|
+
|
8
|
+
def success?
|
9
|
+
false
|
10
|
+
end
|
11
|
+
|
12
|
+
def code
|
13
|
+
CODE
|
14
|
+
end
|
15
|
+
|
16
|
+
def message
|
17
|
+
MESSAGE
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module WorldnetTps
|
2
|
+
module Response
|
3
|
+
class Success
|
4
|
+
|
5
|
+
attr_reader :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}) # :nodoc:
|
8
|
+
@attributes = attributes
|
9
|
+
|
10
|
+
singleton_class.class_eval do
|
11
|
+
attributes.each do |key, value|
|
12
|
+
define_method key do
|
13
|
+
value
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def success?
|
20
|
+
true
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module WorldnetTps
|
2
|
+
class WsObject
|
3
|
+
|
4
|
+
attr_reader :gateway, :request, :response, :date_time, :attributes
|
5
|
+
|
6
|
+
class InvalidHashError < StandardError
|
7
|
+
|
8
|
+
end
|
9
|
+
|
10
|
+
def initialize(gateway, attrs = {})
|
11
|
+
@gateway = gateway
|
12
|
+
@attributes = attrs.merge(
|
13
|
+
currency: gateway.currency,
|
14
|
+
date_time: self.class.current_date_time,
|
15
|
+
terminal_id: gateway.terminal_id,
|
16
|
+
shared_secret: gateway.shared_secret,
|
17
|
+
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.current_date_time
|
22
|
+
DateTime.now.utc.strftime('%d-%m-%Y:%H:%M:%S:000')
|
23
|
+
end
|
24
|
+
|
25
|
+
protected
|
26
|
+
|
27
|
+
def []=(name, value)
|
28
|
+
@attributes[name] = value
|
29
|
+
end
|
30
|
+
|
31
|
+
alias :assign :[]=
|
32
|
+
|
33
|
+
def [](name)
|
34
|
+
@attributes[name]
|
35
|
+
end
|
36
|
+
|
37
|
+
def normalize_response_attributes(source)
|
38
|
+
response_keys.inject(Hash.new) do |hash, el|
|
39
|
+
hash[el] = source[prepare_key(el)]
|
40
|
+
hash
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def validate_hash!(response_attrs)
|
45
|
+
#check hash
|
46
|
+
response_source = self.class.response_check_sum_keys(self, response_attrs).inject("") do |str, el|
|
47
|
+
str << (response_attrs[el] || @attributes[el]).to_s
|
48
|
+
str
|
49
|
+
end
|
50
|
+
response_hash = Digest::MD5.hexdigest(response_source)
|
51
|
+
raise InvalidHashError.new "invalid HASH value" if response_attrs[:hash] != response_hash
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def verify_request_keys!(required_keys, attributes)
|
56
|
+
invalid_keys = required_keys - attributes.keys
|
57
|
+
if invalid_keys.any?
|
58
|
+
keys = invalid_keys.sort_by { |k| k.to_s }.join(", ")
|
59
|
+
raise ArgumentError, "#{keys} arguments are mandatory"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def request_hash
|
64
|
+
Digest::MD5.hexdigest self.class.request_check_sum_keys(self).inject("") { |str, el| str << attributes[el].to_s; str }
|
65
|
+
end
|
66
|
+
|
67
|
+
def add_check_sum!
|
68
|
+
@attributes[:hash] = request_hash
|
69
|
+
end
|
70
|
+
|
71
|
+
def prepare_key(k)
|
72
|
+
k.to_s.upcase.gsub("_", "")
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
module WorldnetTps
|
3
|
+
class XSD
|
4
|
+
class Error < StandardError
|
5
|
+
##<Nokogiri::XML::SyntaxError: Element 'REFUND': Missing child element(s). Expected is ( DATETIME ).>
|
6
|
+
attr_reader :internal_error
|
7
|
+
def initialize(error)
|
8
|
+
@internal_error = error
|
9
|
+
super(error.to_s)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
SCHEMA_PATH = File.join(File.dirname(__FILE__),'gateway.xsd')
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def validate!(xml)
|
17
|
+
document = Nokogiri::XML(xml)
|
18
|
+
error = schema.validate(document).first
|
19
|
+
raise Error.new(error) if error
|
20
|
+
end
|
21
|
+
|
22
|
+
def schema
|
23
|
+
@schema ||= Nokogiri::XML::Schema(File.read(SCHEMA_PATH))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://testpayments.worldnettps.com/merchant/xmlpayment
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
10
|
+
<PAYMENT>
|
11
|
+
<ORDERID>TXN-124-56</ORDERID>
|
12
|
+
<TERMINALID>6003</TERMINALID>
|
13
|
+
<AMOUNT>10.50</AMOUNT>
|
14
|
+
<DATETIME>10-12-2016:12:00:00:000</DATETIME>
|
15
|
+
<CARDNUMBER>4000060000000006</CARDNUMBER>
|
16
|
+
<CARDTYPE>UNSUPPORTED</CARDTYPE>
|
17
|
+
<CARDEXPIRY>1223</CARDEXPIRY>
|
18
|
+
<CARDHOLDERNAME>John Doe</CARDHOLDERNAME>
|
19
|
+
<HASH>d5c21de35fdebae93b3b78cc2d40966f</HASH>
|
20
|
+
<CURRENCY>USD</CURRENCY>
|
21
|
+
<TERMINALTYPE>2</TERMINALTYPE>
|
22
|
+
<TRANSACTIONTYPE>7</TRANSACTIONTYPE>
|
23
|
+
<EMAIL>john.doe@gmail.com</EMAIL>
|
24
|
+
<CVV>111</CVV>
|
25
|
+
<ADDRESS1>100 MAIN ST</ADDRESS1>
|
26
|
+
<ADDRESS2>SEATTLE WA</ADDRESS2>
|
27
|
+
<POSTCODE>98104</POSTCODE>
|
28
|
+
<PHONE>2064960114</PHONE>
|
29
|
+
<CITY>SEATTLE</CITY>
|
30
|
+
<COUNTRY>US</COUNTRY>
|
31
|
+
</PAYMENT>
|
32
|
+
headers:
|
33
|
+
Accept-Encoding:
|
34
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
35
|
+
Accept:
|
36
|
+
- "*/*"
|
37
|
+
User-Agent:
|
38
|
+
- Ruby
|
39
|
+
response:
|
40
|
+
status:
|
41
|
+
code: 200
|
42
|
+
message: OK
|
43
|
+
headers:
|
44
|
+
Date:
|
45
|
+
- Fri, 16 Dec 2016 10:15:49 GMT
|
46
|
+
Server:
|
47
|
+
- Apache
|
48
|
+
Content-Length:
|
49
|
+
- '106'
|
50
|
+
Strict-Transport-Security:
|
51
|
+
- max-age=15768000
|
52
|
+
Content-Type:
|
53
|
+
- text/xml;charset=UTF-8
|
54
|
+
body:
|
55
|
+
encoding: UTF-8
|
56
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<ERROR><ERRORSTRING>Order
|
57
|
+
Already Processed</ERRORSTRING></ERROR>\n"
|
58
|
+
http_version:
|
59
|
+
recorded_at: Fri, 16 Dec 2016 10:15:49 GMT
|
60
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://testpayments.worldnettps.com/merchant/xmlpayment
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
10
|
+
<PAYMENT>
|
11
|
+
<ORDERID>TXN-124-59</ORDERID>
|
12
|
+
<TERMINALID>6003</TERMINALID>
|
13
|
+
<AMOUNT>10.50</AMOUNT>
|
14
|
+
<DATETIME>10-12-2016:12:00:00:000</DATETIME>
|
15
|
+
<CARDNUMBER>4000060000000006</CARDNUMBER>
|
16
|
+
<CARDTYPE>VISA</CARDTYPE>
|
17
|
+
<CARDEXPIRY>1223</CARDEXPIRY>
|
18
|
+
<CARDHOLDERNAME>John Doe</CARDHOLDERNAME>
|
19
|
+
<HASH>80949a2820234af449af8320196493bc</HASH>
|
20
|
+
<CURRENCY>USD</CURRENCY>
|
21
|
+
<TERMINALTYPE>2</TERMINALTYPE>
|
22
|
+
<TRANSACTIONTYPE>7</TRANSACTIONTYPE>
|
23
|
+
<EMAIL>john.doe@gmail.com</EMAIL>
|
24
|
+
<CVV>111</CVV>
|
25
|
+
<ADDRESS1>100 MAIN ST</ADDRESS1>
|
26
|
+
<ADDRESS2>SEATTLE WA</ADDRESS2>
|
27
|
+
<POSTCODE>98104</POSTCODE>
|
28
|
+
<PHONE>2064960114</PHONE>
|
29
|
+
<CITY>SEATTLE</CITY>
|
30
|
+
<COUNTRY>US</COUNTRY>
|
31
|
+
</PAYMENT>
|
32
|
+
headers:
|
33
|
+
Accept-Encoding:
|
34
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
35
|
+
Accept:
|
36
|
+
- "*/*"
|
37
|
+
User-Agent:
|
38
|
+
- Ruby
|
39
|
+
response:
|
40
|
+
status:
|
41
|
+
code: 200
|
42
|
+
message: OK
|
43
|
+
headers:
|
44
|
+
Date:
|
45
|
+
- Fri, 16 Dec 2016 13:20:44 GMT
|
46
|
+
Server:
|
47
|
+
- Apache
|
48
|
+
Content-Length:
|
49
|
+
- '351'
|
50
|
+
Strict-Transport-Security:
|
51
|
+
- max-age=15768000
|
52
|
+
Content-Type:
|
53
|
+
- text/xml;charset=UTF-8
|
54
|
+
body:
|
55
|
+
encoding: UTF-8
|
56
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<PAYMENTRESPONSE><UNIQUEREF>EP8Q218WK1</UNIQUEREF><RESPONSECODE>A</RESPONSECODE><RESPONSETEXT>APPROVAL</RESPONSETEXT><APPROVALCODE>475318</APPROVALCODE><DATETIME>2016-12-16T13:20:44</DATETIME><AVSRESPONSE></AVSRESPONSE><CVVRESPONSE>M</CVVRESPONSE><HASH>ca2854cc92cf181fb7e28920bb621b6a</HASH></PAYMENTRESPONSE>\n"
|
57
|
+
http_version:
|
58
|
+
recorded_at: Fri, 16 Dec 2016 13:20:44 GMT
|
59
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,57 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://testpayments.worldnettps.com/merchant/xmlpayment
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
10
|
+
<PAYMENT>
|
11
|
+
<ORDERID>TXN-124-55</ORDERID>
|
12
|
+
<TERMINALID>6003</TERMINALID>
|
13
|
+
<AMOUNT>10.50</AMOUNT>
|
14
|
+
<DATETIME>10-12-2016:12:00:00:000</DATETIME>
|
15
|
+
<CARDNUMBER>2967539270368883</CARDNUMBER>
|
16
|
+
<CARDTYPE>SECURECARD</CARDTYPE>
|
17
|
+
<HASH>bf6396125726d7849c4eab3d270c2afb</HASH>
|
18
|
+
<CURRENCY>USD</CURRENCY>
|
19
|
+
<TERMINALTYPE>2</TERMINALTYPE>
|
20
|
+
<TRANSACTIONTYPE>7</TRANSACTIONTYPE>
|
21
|
+
<EMAIL>john.doe@gmail.com</EMAIL>
|
22
|
+
<ADDRESS1>100 MAIN ST</ADDRESS1>
|
23
|
+
<ADDRESS2>SEATTLE WA</ADDRESS2>
|
24
|
+
<POSTCODE>98104</POSTCODE>
|
25
|
+
<PHONE>2064960114</PHONE>
|
26
|
+
<CITY>SEATTLE</CITY>
|
27
|
+
<COUNTRY>US</COUNTRY>
|
28
|
+
</PAYMENT>
|
29
|
+
headers:
|
30
|
+
Accept-Encoding:
|
31
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
32
|
+
Accept:
|
33
|
+
- "*/*"
|
34
|
+
User-Agent:
|
35
|
+
- Ruby
|
36
|
+
response:
|
37
|
+
status:
|
38
|
+
code: 200
|
39
|
+
message: OK
|
40
|
+
headers:
|
41
|
+
Date:
|
42
|
+
- Fri, 16 Dec 2016 09:36:37 GMT
|
43
|
+
Server:
|
44
|
+
- Apache
|
45
|
+
Content-Length:
|
46
|
+
- '112'
|
47
|
+
Strict-Transport-Security:
|
48
|
+
- max-age=15768000
|
49
|
+
Content-Type:
|
50
|
+
- text/xml;charset=UTF-8
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<ERROR><ERRORSTRING>Invalid
|
54
|
+
Secure Card Reference</ERRORSTRING></ERROR>\n"
|
55
|
+
http_version:
|
56
|
+
recorded_at: Fri, 16 Dec 2016 09:36:37 GMT
|
57
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://testpayments.worldnettps.com/merchant/xmlpayment
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
10
|
+
<PAYMENT>
|
11
|
+
<ORDERID>TXN-124-55</ORDERID>
|
12
|
+
<TERMINALID>6003</TERMINALID>
|
13
|
+
<AMOUNT>10.50</AMOUNT>
|
14
|
+
<DATETIME>10-12-2016:12:00:00:000</DATETIME>
|
15
|
+
<CARDNUMBER>2967539270368883</CARDNUMBER>
|
16
|
+
<CARDTYPE>SECURECARD</CARDTYPE>
|
17
|
+
<HASH>bf6396125726d7849c4eab3d270c2afb</HASH>
|
18
|
+
<CURRENCY>USD</CURRENCY>
|
19
|
+
<TERMINALTYPE>2</TERMINALTYPE>
|
20
|
+
<TRANSACTIONTYPE>7</TRANSACTIONTYPE>
|
21
|
+
<EMAIL>john.doe@gmail.com</EMAIL>
|
22
|
+
<ADDRESS1>100 MAIN ST</ADDRESS1>
|
23
|
+
<ADDRESS2>SEATTLE WA</ADDRESS2>
|
24
|
+
<POSTCODE>98104</POSTCODE>
|
25
|
+
<PHONE>2064960114</PHONE>
|
26
|
+
<CITY>SEATTLE</CITY>
|
27
|
+
<COUNTRY>US</COUNTRY>
|
28
|
+
</PAYMENT>
|
29
|
+
headers:
|
30
|
+
Accept-Encoding:
|
31
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
32
|
+
Accept:
|
33
|
+
- "*/*"
|
34
|
+
User-Agent:
|
35
|
+
- Ruby
|
36
|
+
response:
|
37
|
+
status:
|
38
|
+
code: 200
|
39
|
+
message: OK
|
40
|
+
headers:
|
41
|
+
Date:
|
42
|
+
- Fri, 16 Dec 2016 09:40:51 GMT
|
43
|
+
Server:
|
44
|
+
- Apache
|
45
|
+
Content-Length:
|
46
|
+
- '350'
|
47
|
+
Strict-Transport-Security:
|
48
|
+
- max-age=15768000
|
49
|
+
Content-Type:
|
50
|
+
- text/xml;charset=UTF-8
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<PAYMENTRESPONSE><UNIQUEREF>KR3XSVSZ41</UNIQUEREF><RESPONSECODE>A</RESPONSECODE><RESPONSETEXT>APPROVAL</RESPONSETEXT><APPROVALCODE>475318</APPROVALCODE><DATETIME>2016-12-16T09:40:51</DATETIME><AVSRESPONSE></AVSRESPONSE><CVVRESPONSE></CVVRESPONSE><HASH>3d59bff811e0c3a3e1e13769f1c2ec03</HASH></PAYMENTRESPONSE>\n"
|
54
|
+
http_version:
|
55
|
+
recorded_at: Fri, 16 Dec 2016 09:40:51 GMT
|
56
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://testpayments.worldnettps.com/merchant/xmlpayment
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
10
|
+
<REFUND>
|
11
|
+
<ORDERID>TXN-124-57</ORDERID>
|
12
|
+
<TERMINALID>6003</TERMINALID>
|
13
|
+
<AMOUNT>10.50</AMOUNT>
|
14
|
+
<DATETIME>10-12-2016:12:00:00:000</DATETIME>
|
15
|
+
<HASH>02c1305ce3117a89b735e845a46a940e</HASH>
|
16
|
+
<OPERATOR>John</OPERATOR>
|
17
|
+
<REASON>Product is defective</REASON>
|
18
|
+
</REFUND>
|
19
|
+
headers:
|
20
|
+
Accept-Encoding:
|
21
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
+
Accept:
|
23
|
+
- "*/*"
|
24
|
+
User-Agent:
|
25
|
+
- Ruby
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 200
|
29
|
+
message: OK
|
30
|
+
headers:
|
31
|
+
Date:
|
32
|
+
- Fri, 16 Dec 2016 12:13:21 GMT
|
33
|
+
Server:
|
34
|
+
- Apache
|
35
|
+
Content-Length:
|
36
|
+
- '106'
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15768000
|
39
|
+
Content-Type:
|
40
|
+
- text/xml;charset=UTF-8
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<ERROR><ERRORSTRING>Invalid
|
44
|
+
UNIQUEREF field</ERRORSTRING></ERROR>\n"
|
45
|
+
http_version:
|
46
|
+
recorded_at: Fri, 16 Dec 2016 12:13:21 GMT
|
47
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://testpayments.worldnettps.com/merchant/xmlpayment
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
10
|
+
<REFUND>
|
11
|
+
<ORDERID>TXN-124-57</ORDERID>
|
12
|
+
<TERMINALID>6003</TERMINALID>
|
13
|
+
<AMOUNT>10.50</AMOUNT>
|
14
|
+
<DATETIME>10-12-2016:12:00:00:000</DATETIME>
|
15
|
+
<HASH>02c1305ce3117a89b735e845a46a940e</HASH>
|
16
|
+
<OPERATOR>John</OPERATOR>
|
17
|
+
<REASON>Product is defective</REASON>
|
18
|
+
</REFUND>
|
19
|
+
headers:
|
20
|
+
Accept-Encoding:
|
21
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
|
+
Accept:
|
23
|
+
- "*/*"
|
24
|
+
User-Agent:
|
25
|
+
- Ruby
|
26
|
+
response:
|
27
|
+
status:
|
28
|
+
code: 200
|
29
|
+
message: OK
|
30
|
+
headers:
|
31
|
+
Date:
|
32
|
+
- Fri, 16 Dec 2016 12:13:21 GMT
|
33
|
+
Server:
|
34
|
+
- Apache
|
35
|
+
Content-Length:
|
36
|
+
- '106'
|
37
|
+
Strict-Transport-Security:
|
38
|
+
- max-age=15768000
|
39
|
+
Content-Type:
|
40
|
+
- text/xml;charset=UTF-8
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<REFUNDRESPONSE><RESPONSECODE>A</RESPONSECODE><RESPONSETEXT>SUCCESS</RESPONSETEXT><ORDERID>TXN-124-57</ORDERID><DATETIME>16-12-2016:12:21:07:583</DATETIME><HASH>0412aec114c04248815d0864af4126c6</HASH></REFUNDRESPONSE>\n"
|
44
|
+
http_version:
|
45
|
+
recorded_at: Fri, 16 Dec 2016 12:13:21 GMT
|
46
|
+
recorded_with: VCR 3.0.3
|