tns_payments 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/.env.example +4 -0
- data/.gitignore +1 -0
- data/lib/tns_payments/connection.rb +74 -52
- data/lib/tns_payments/request.rb +8 -10
- data/lib/tns_payments/response.rb +27 -7
- data/lib/tns_payments/test_support/card_session.rb +77 -0
- data/lib/tns_payments/version.rb +1 -1
- data/test/cassettes/test_amex_successful_purchase.yml +112 -0
- data/test/cassettes/test_available.yml +38 -0
- data/test/cassettes/test_card_enrolled_for_3ds.yml +112 -0
- data/test/cassettes/test_card_not_enrolled_for_3ds.yml +112 -0
- data/test/cassettes/test_deleting_tokenised_card.yml +223 -0
- data/test/cassettes/test_mastercard_successful_purchase.yml +112 -0
- data/test/cassettes/test_refund_successful_purchase.yml +149 -0
- data/test/cassettes/test_tokenise_creditcard_from_session_for_later_purchase.yml +149 -0
- data/test/cassettes/test_unsuccessful_purchase.yml +42 -0
- data/test/cassettes/test_unsupported_3ds_gateway.yml +114 -0
- data/test/cassettes/test_visa_successful_purchase.yml +112 -0
- data/test/helper.rb +48 -0
- data/test/integration/operations_test.rb +187 -0
- data/test/unit/response_test.rb +0 -4
- data/test/unit/transaction_test.rb +2 -0
- data/tns_payments.gemspec +11 -5
- metadata +218 -89
- data/test/unit/conntection_test.rb +0 -311
@@ -0,0 +1,112 @@
|
|
1
|
+
---
|
2
|
+
recorded_with: VCR 2.9.3
|
3
|
+
http_interactions:
|
4
|
+
- request:
|
5
|
+
method: post
|
6
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/session
|
7
|
+
body:
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Content-Type:
|
13
|
+
- Application/json;charset=UTF-8
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip, deflate
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 201
|
19
|
+
message: Created
|
20
|
+
headers:
|
21
|
+
Content-Length:
|
22
|
+
- "149"
|
23
|
+
Content-Type:
|
24
|
+
- application/json;charset=UTF-8
|
25
|
+
Date:
|
26
|
+
- Mon, 11 Jan 2016 23:51:00 GMT
|
27
|
+
Pragma:
|
28
|
+
- no-cache
|
29
|
+
Expires:
|
30
|
+
- "0"
|
31
|
+
Set-Cookie:
|
32
|
+
- TS018aacab=01c9ad79a0e43085f5769c4251d68dd2ac70e6ea0147304df176ea6586ad3aed2b1818724b; Path=/
|
33
|
+
Cache-Control:
|
34
|
+
- no-cache, no-store, must-revalidate
|
35
|
+
body:
|
36
|
+
string: "{\"merchant\":\"<TNS_MERCHANT_ID>\",\"result\":\"SUCCESS\",\"session\":{\"id\":\"SESSION0002851313900E8334787M11\",\"updateStatus\":\"NO_UPDATE\",\"version\":\"2a93074e01\"}}"
|
37
|
+
http_version:
|
38
|
+
recorded_at: Mon, 11 Jan 2016 23:51:01 GMT
|
39
|
+
- request:
|
40
|
+
method: put
|
41
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/session/SESSION0002851313900E8334787M11
|
42
|
+
body:
|
43
|
+
string: "{\"sourceOfFunds\":{\"type\":\"CARD\",\"provided\":{\"card\":{\"number\":\"5123456789012346\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"securityCode\":\"123\"}}}}"
|
44
|
+
headers:
|
45
|
+
Accept:
|
46
|
+
- "*/*"
|
47
|
+
Content-Length:
|
48
|
+
- "139"
|
49
|
+
Content-Type:
|
50
|
+
- Application/json;charset=UTF-8
|
51
|
+
Accept-Encoding:
|
52
|
+
- gzip, deflate
|
53
|
+
response:
|
54
|
+
status:
|
55
|
+
code: 200
|
56
|
+
message: OK
|
57
|
+
headers:
|
58
|
+
Content-Length:
|
59
|
+
- "349"
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=UTF-8
|
62
|
+
Date:
|
63
|
+
- Mon, 11 Jan 2016 23:51:01 GMT
|
64
|
+
Pragma:
|
65
|
+
- no-cache
|
66
|
+
Expires:
|
67
|
+
- "0"
|
68
|
+
Set-Cookie:
|
69
|
+
- TS018aacab=01c9ad79a0c2dc1c1c298eee2506a043f7e808dcc4e9490242d1995a5507c7a862318a5c3c; Path=/
|
70
|
+
Cache-Control:
|
71
|
+
- no-cache, no-store, must-revalidate
|
72
|
+
body:
|
73
|
+
string: "{\"merchant\":\"<TNS_MERCHANT_ID>\",\"session\":{\"id\":\"SESSION0002851313900E8334787M11\",\"updateStatus\":\"SUCCESS\",\"version\":\"04bb918402\"},\"sourceOfFunds\":{\"provided\":{\"card\":{\"brand\":\"MASTERCARD\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"fundingMethod\":\"CREDIT\",\"number\":\"512345xxxxxx2346\",\"scheme\":\"MASTERCARD\",\"securityCode\":\"xxx\"}},\"type\":\"CARD\"},\"version\":\"32\"}"
|
74
|
+
http_version:
|
75
|
+
recorded_at: Mon, 11 Jan 2016 23:51:02 GMT
|
76
|
+
- request:
|
77
|
+
method: put
|
78
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/order/10000001601/transaction/PAY
|
79
|
+
body:
|
80
|
+
string: "{\"apiOperation\":\"PAY\",\"order\":{\"amount\":\"100.00\",\"currency\":\"EUR\",\"reference\":\"PAY\"},\"transaction\":{\"reference\":\"PAY\"},\"sourceOfFunds\":{\"type\":\"CARD\"},\"session\":{\"id\":\"SESSION0002851313900E8334787M11\"}}"
|
81
|
+
headers:
|
82
|
+
Accept:
|
83
|
+
- "*/*"
|
84
|
+
Content-Length:
|
85
|
+
- "202"
|
86
|
+
Content-Type:
|
87
|
+
- Application/json;charset=UTF-8
|
88
|
+
Accept-Encoding:
|
89
|
+
- gzip, deflate
|
90
|
+
response:
|
91
|
+
status:
|
92
|
+
code: 201
|
93
|
+
message: Created
|
94
|
+
headers:
|
95
|
+
Content-Length:
|
96
|
+
- "1622"
|
97
|
+
Content-Type:
|
98
|
+
- application/json;charset=UTF-8
|
99
|
+
Date:
|
100
|
+
- Mon, 11 Jan 2016 23:51:01 GMT
|
101
|
+
Pragma:
|
102
|
+
- no-cache
|
103
|
+
Expires:
|
104
|
+
- "0"
|
105
|
+
Set-Cookie:
|
106
|
+
- TS018aacab=01c9ad79a0796b69ab1ce9b58d484b4f827bac5f1ec6155375c0f35cd940baaf32a2bc7cf0; Path=/
|
107
|
+
Cache-Control:
|
108
|
+
- no-cache, no-store, must-revalidate
|
109
|
+
body:
|
110
|
+
string: "{\"gatewayEntryPoint\":\"WEB_SERVICES_API\",\"merchant\":\"<TNS_MERCHANT_ID>\",\"order\":{\"amount\":100.00,\"creationTime\":\"2016-01-11T23:51:01.592Z\",\"currency\":\"EUR\",\"id\":\"10000001601\",\"reference\":\"PAY\",\"status\":\"CAPTURED\",\"totalAuthorizedAmount\":100.00,\"totalCapturedAmount\":100.00,\"totalRefundedAmount\":0.00},\"response\":{\"acquirerCode\":\"00\",\"acquirerMessage\":\"Approved\",\"cardSecurityCode\":{\"acquirerCode\":\"1\",\"gatewayCode\":\"NOT_PROCESSED\"},\"gatewayCode\":\"APPROVED\"},\"result\":\"SUCCESS\",\"risk\":{\"response\":{\"gatewayCode\":\"ACCEPTED\",\"review\":{\"decision\":\"NOT_REQUIRED\"},\"rule\":[{\"data\":\"512345\",\"name\":\"MERCHANT_BIN_RANGE\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"data\":\"P\",\"name\":\"MERCHANT_CSC\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"name\":\"SUSPECT_CARD_LIST\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"name\":\"TRUSTED_CARD_LIST\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"data\":\"512345\",\"name\":\"MSO_BIN_RANGE\",\"recommendation\":\"NO_ACTION\",\"type\":\"MSO_RULE\"},{\"data\":\"P\",\"name\":\"MSO_CSC\",\"recommendation\":\"NO_ACTION\",\"type\":\"MSO_RULE\"}]}},\"sourceOfFunds\":{\"provided\":{\"card\":{\"brand\":\"MASTERCARD\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"fundingMethod\":\"CREDIT\",\"issuer\":\"BANCO DEL PICHINCHA, C.A.\",\"number\":\"512345xxxxxx2346\",\"scheme\":\"MASTERCARD\"}},\"type\":\"CARD\"},\"timeOfRecord\":\"2016-01-11T23:51:01.592Z\",\"transaction\":{\"acquirer\":{\"batch\":1,\"id\":\"AIB\",\"merchantId\":\"011855511\"},\"amount\":100.00,\"authorizationCode\":\"029325\",\"currency\":\"EUR\",\"frequency\":\"SINGLE\",\"id\":\"PAY\",\"receipt\":\"AAAAC5BN65\",\"reference\":\"PAY\",\"source\":\"MOTO\",\"terminal\":\"31208585\",\"type\":\"PAYMENT\"},\"version\":\"32\"}"
|
111
|
+
http_version:
|
112
|
+
recorded_at: Mon, 11 Jan 2016 23:51:02 GMT
|
@@ -0,0 +1,149 @@
|
|
1
|
+
---
|
2
|
+
recorded_with: VCR 2.9.3
|
3
|
+
http_interactions:
|
4
|
+
- request:
|
5
|
+
method: post
|
6
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/session
|
7
|
+
body:
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Content-Type:
|
13
|
+
- Application/json;charset=UTF-8
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip, deflate
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 201
|
19
|
+
message: Created
|
20
|
+
headers:
|
21
|
+
Content-Length:
|
22
|
+
- "149"
|
23
|
+
Content-Type:
|
24
|
+
- application/json;charset=UTF-8
|
25
|
+
Date:
|
26
|
+
- Mon, 11 Jan 2016 23:51:02 GMT
|
27
|
+
Pragma:
|
28
|
+
- no-cache
|
29
|
+
Expires:
|
30
|
+
- "0"
|
31
|
+
Set-Cookie:
|
32
|
+
- TS018aacab=01c9ad79a07fe37703f6de922bda937330e729affb9f9f203b15264532176b06b28dd8e829; Path=/
|
33
|
+
Cache-Control:
|
34
|
+
- no-cache, no-store, must-revalidate
|
35
|
+
body:
|
36
|
+
string: "{\"merchant\":\"<TNS_MERCHANT_ID>\",\"result\":\"SUCCESS\",\"session\":{\"id\":\"SESSION0002556964795F4171120H28\",\"updateStatus\":\"NO_UPDATE\",\"version\":\"2e1b115e01\"}}"
|
37
|
+
http_version:
|
38
|
+
recorded_at: Mon, 11 Jan 2016 23:51:03 GMT
|
39
|
+
- request:
|
40
|
+
method: put
|
41
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/session/SESSION0002556964795F4171120H28
|
42
|
+
body:
|
43
|
+
string: "{\"sourceOfFunds\":{\"type\":\"CARD\",\"provided\":{\"card\":{\"number\":\"4005550000000001\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"securityCode\":\"123\"}}}}"
|
44
|
+
headers:
|
45
|
+
Accept:
|
46
|
+
- "*/*"
|
47
|
+
Content-Length:
|
48
|
+
- "139"
|
49
|
+
Content-Type:
|
50
|
+
- Application/json;charset=UTF-8
|
51
|
+
Accept-Encoding:
|
52
|
+
- gzip, deflate
|
53
|
+
response:
|
54
|
+
status:
|
55
|
+
code: 200
|
56
|
+
message: OK
|
57
|
+
headers:
|
58
|
+
Content-Length:
|
59
|
+
- "337"
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=UTF-8
|
62
|
+
Date:
|
63
|
+
- Mon, 11 Jan 2016 23:51:02 GMT
|
64
|
+
Pragma:
|
65
|
+
- no-cache
|
66
|
+
Expires:
|
67
|
+
- "0"
|
68
|
+
Set-Cookie:
|
69
|
+
- TS018aacab=01c9ad79a00686829b21781a870b70579cfc29c416f7968de7dd75764673102468bb4a1385; Path=/
|
70
|
+
Cache-Control:
|
71
|
+
- no-cache, no-store, must-revalidate
|
72
|
+
body:
|
73
|
+
string: "{\"merchant\":\"<TNS_MERCHANT_ID>\",\"session\":{\"id\":\"SESSION0002556964795F4171120H28\",\"updateStatus\":\"SUCCESS\",\"version\":\"22628e1e02\"},\"sourceOfFunds\":{\"provided\":{\"card\":{\"brand\":\"VISA\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"fundingMethod\":\"CREDIT\",\"number\":\"400555xxxxxx0001\",\"scheme\":\"VISA\",\"securityCode\":\"xxx\"}},\"type\":\"CARD\"},\"version\":\"32\"}"
|
74
|
+
http_version:
|
75
|
+
recorded_at: Mon, 11 Jan 2016 23:51:03 GMT
|
76
|
+
- request:
|
77
|
+
method: put
|
78
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/order/10000001604/transaction/PAY
|
79
|
+
body:
|
80
|
+
string: "{\"apiOperation\":\"PAY\",\"order\":{\"amount\":\"100.00\",\"currency\":\"EUR\",\"reference\":\"PAY\"},\"transaction\":{\"reference\":\"PAY\"},\"sourceOfFunds\":{\"type\":\"CARD\"},\"session\":{\"id\":\"SESSION0002556964795F4171120H28\"}}"
|
81
|
+
headers:
|
82
|
+
Accept:
|
83
|
+
- "*/*"
|
84
|
+
Content-Length:
|
85
|
+
- "202"
|
86
|
+
Content-Type:
|
87
|
+
- Application/json;charset=UTF-8
|
88
|
+
Accept-Encoding:
|
89
|
+
- gzip, deflate
|
90
|
+
response:
|
91
|
+
status:
|
92
|
+
code: 201
|
93
|
+
message: Created
|
94
|
+
headers:
|
95
|
+
Content-Length:
|
96
|
+
- "1610"
|
97
|
+
Content-Type:
|
98
|
+
- application/json;charset=UTF-8
|
99
|
+
Date:
|
100
|
+
- Mon, 11 Jan 2016 23:51:03 GMT
|
101
|
+
Pragma:
|
102
|
+
- no-cache
|
103
|
+
Expires:
|
104
|
+
- "0"
|
105
|
+
Set-Cookie:
|
106
|
+
- TS018aacab=01c9ad79a04a70845e5f3c7ec4eb8f5675bcd1bb0086e5f227d3c28053c47d7ba2e5748fe1; Path=/
|
107
|
+
Cache-Control:
|
108
|
+
- no-cache, no-store, must-revalidate
|
109
|
+
body:
|
110
|
+
string: "{\"gatewayEntryPoint\":\"WEB_SERVICES_API\",\"merchant\":\"<TNS_MERCHANT_ID>\",\"order\":{\"amount\":100.00,\"creationTime\":\"2016-01-11T23:51:03.179Z\",\"currency\":\"EUR\",\"id\":\"10000001604\",\"reference\":\"PAY\",\"status\":\"CAPTURED\",\"totalAuthorizedAmount\":100.00,\"totalCapturedAmount\":100.00,\"totalRefundedAmount\":0.00},\"response\":{\"acquirerCode\":\"00\",\"acquirerMessage\":\"Approved\",\"cardSecurityCode\":{\"acquirerCode\":\"1\",\"gatewayCode\":\"NOT_PROCESSED\"},\"gatewayCode\":\"APPROVED\"},\"result\":\"SUCCESS\",\"risk\":{\"response\":{\"gatewayCode\":\"ACCEPTED\",\"review\":{\"decision\":\"NOT_REQUIRED\"},\"rule\":[{\"data\":\"400555\",\"name\":\"MERCHANT_BIN_RANGE\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"data\":\"P\",\"name\":\"MERCHANT_CSC\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"name\":\"SUSPECT_CARD_LIST\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"name\":\"TRUSTED_CARD_LIST\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"data\":\"400555\",\"name\":\"MSO_BIN_RANGE\",\"recommendation\":\"NO_ACTION\",\"type\":\"MSO_RULE\"},{\"data\":\"P\",\"name\":\"MSO_CSC\",\"recommendation\":\"NO_ACTION\",\"type\":\"MSO_RULE\"}]}},\"sourceOfFunds\":{\"provided\":{\"card\":{\"brand\":\"VISA\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"fundingMethod\":\"CREDIT\",\"issuer\":\"JPMORGAN CHASE BANK, N.A.\",\"number\":\"400555xxxxxx0001\",\"scheme\":\"VISA\"}},\"type\":\"CARD\"},\"timeOfRecord\":\"2016-01-11T23:51:03.179Z\",\"transaction\":{\"acquirer\":{\"batch\":1,\"id\":\"AIB\",\"merchantId\":\"011855511\"},\"amount\":100.00,\"authorizationCode\":\"029326\",\"currency\":\"EUR\",\"frequency\":\"SINGLE\",\"id\":\"PAY\",\"receipt\":\"AAAAC5BP7X\",\"reference\":\"PAY\",\"source\":\"MOTO\",\"terminal\":\"31208585\",\"type\":\"PAYMENT\"},\"version\":\"32\"}"
|
111
|
+
http_version:
|
112
|
+
recorded_at: Mon, 11 Jan 2016 23:51:04 GMT
|
113
|
+
- request:
|
114
|
+
method: put
|
115
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/order/10000001604/transaction/REFUND
|
116
|
+
body:
|
117
|
+
string: "{\"apiOperation\":\"REFUND\",\"transaction\":{\"amount\":\"100.00\",\"currency\":\"EUR\",\"reference\":\"PAY\"}}"
|
118
|
+
headers:
|
119
|
+
Accept:
|
120
|
+
- "*/*"
|
121
|
+
Content-Length:
|
122
|
+
- "94"
|
123
|
+
Content-Type:
|
124
|
+
- Application/json;charset=UTF-8
|
125
|
+
Accept-Encoding:
|
126
|
+
- gzip, deflate
|
127
|
+
response:
|
128
|
+
status:
|
129
|
+
code: 201
|
130
|
+
message: Created
|
131
|
+
headers:
|
132
|
+
Content-Length:
|
133
|
+
- "1614"
|
134
|
+
Content-Type:
|
135
|
+
- application/json;charset=UTF-8
|
136
|
+
Date:
|
137
|
+
- Mon, 11 Jan 2016 23:51:04 GMT
|
138
|
+
Pragma:
|
139
|
+
- no-cache
|
140
|
+
Expires:
|
141
|
+
- "0"
|
142
|
+
Set-Cookie:
|
143
|
+
- TS018aacab=01c9ad79a09fbae0ec23efad7fa098ce369181d0282365a1bff74b3d3a6552a868dd4b19e3; Path=/
|
144
|
+
Cache-Control:
|
145
|
+
- no-cache, no-store, must-revalidate
|
146
|
+
body:
|
147
|
+
string: "{\"gatewayEntryPoint\":\"WEB_SERVICES_API\",\"merchant\":\"<TNS_MERCHANT_ID>\",\"order\":{\"amount\":100.00,\"creationTime\":\"2016-01-11T23:51:03.179Z\",\"currency\":\"EUR\",\"id\":\"10000001604\",\"reference\":\"PAY\",\"status\":\"REFUNDED\",\"totalAuthorizedAmount\":100.00,\"totalCapturedAmount\":100.00,\"totalRefundedAmount\":100.00},\"response\":{\"acquirerCode\":\"00\",\"acquirerMessage\":\"Approved\",\"cardSecurityCode\":{\"acquirerCode\":\"1\",\"gatewayCode\":\"NOT_PROCESSED\"},\"gatewayCode\":\"APPROVED\"},\"result\":\"SUCCESS\",\"risk\":{\"response\":{\"gatewayCode\":\"ACCEPTED\",\"review\":{\"decision\":\"NOT_REQUIRED\"},\"rule\":[{\"data\":\"400555\",\"name\":\"MERCHANT_BIN_RANGE\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"data\":\"P\",\"name\":\"MERCHANT_CSC\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"name\":\"SUSPECT_CARD_LIST\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"name\":\"TRUSTED_CARD_LIST\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"data\":\"400555\",\"name\":\"MSO_BIN_RANGE\",\"recommendation\":\"NO_ACTION\",\"type\":\"MSO_RULE\"},{\"data\":\"P\",\"name\":\"MSO_CSC\",\"recommendation\":\"NO_ACTION\",\"type\":\"MSO_RULE\"}]}},\"sourceOfFunds\":{\"provided\":{\"card\":{\"brand\":\"VISA\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"fundingMethod\":\"CREDIT\",\"issuer\":\"JPMORGAN CHASE BANK, N.A.\",\"number\":\"400555xxxxxx0001\",\"scheme\":\"VISA\"}},\"type\":\"CARD\"},\"timeOfRecord\":\"2016-01-11T23:51:03.902Z\",\"transaction\":{\"acquirer\":{\"batch\":1,\"id\":\"AIB\",\"merchantId\":\"011855511\"},\"amount\":100.00,\"authorizationCode\":\"029327\",\"currency\":\"EUR\",\"frequency\":\"SINGLE\",\"id\":\"REFUND\",\"receipt\":\"AAAAC5BS26\",\"reference\":\"PAY\",\"source\":\"MOTO\",\"terminal\":\"31208585\",\"type\":\"REFUND\"},\"version\":\"32\"}"
|
148
|
+
http_version:
|
149
|
+
recorded_at: Mon, 11 Jan 2016 23:51:05 GMT
|
@@ -0,0 +1,149 @@
|
|
1
|
+
---
|
2
|
+
recorded_with: VCR 2.9.3
|
3
|
+
http_interactions:
|
4
|
+
- request:
|
5
|
+
method: post
|
6
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/session
|
7
|
+
body:
|
8
|
+
string: ""
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- "*/*"
|
12
|
+
Content-Type:
|
13
|
+
- Application/json;charset=UTF-8
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip, deflate
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 201
|
19
|
+
message: Created
|
20
|
+
headers:
|
21
|
+
Content-Length:
|
22
|
+
- "149"
|
23
|
+
Content-Type:
|
24
|
+
- application/json;charset=UTF-8
|
25
|
+
Date:
|
26
|
+
- Mon, 11 Jan 2016 23:51:05 GMT
|
27
|
+
Pragma:
|
28
|
+
- no-cache
|
29
|
+
Expires:
|
30
|
+
- "0"
|
31
|
+
Set-Cookie:
|
32
|
+
- TS018aacab=01c9ad79a05ab5554cffd02b8cd099d963dd66e671e2d032b1ebbf366616a5001d94e07abd; Path=/
|
33
|
+
Cache-Control:
|
34
|
+
- no-cache, no-store, must-revalidate
|
35
|
+
body:
|
36
|
+
string: "{\"merchant\":\"<TNS_MERCHANT_ID>\",\"result\":\"SUCCESS\",\"session\":{\"id\":\"SESSION0002902011001K5498716E31\",\"updateStatus\":\"NO_UPDATE\",\"version\":\"707f13e001\"}}"
|
37
|
+
http_version:
|
38
|
+
recorded_at: Mon, 11 Jan 2016 23:51:06 GMT
|
39
|
+
- request:
|
40
|
+
method: put
|
41
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/session/SESSION0002902011001K5498716E31
|
42
|
+
body:
|
43
|
+
string: "{\"sourceOfFunds\":{\"type\":\"CARD\",\"provided\":{\"card\":{\"number\":\"4005550000000001\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"securityCode\":\"123\"}}}}"
|
44
|
+
headers:
|
45
|
+
Accept:
|
46
|
+
- "*/*"
|
47
|
+
Content-Length:
|
48
|
+
- "139"
|
49
|
+
Content-Type:
|
50
|
+
- Application/json;charset=UTF-8
|
51
|
+
Accept-Encoding:
|
52
|
+
- gzip, deflate
|
53
|
+
response:
|
54
|
+
status:
|
55
|
+
code: 200
|
56
|
+
message: OK
|
57
|
+
headers:
|
58
|
+
Content-Length:
|
59
|
+
- "337"
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=UTF-8
|
62
|
+
Date:
|
63
|
+
- Mon, 11 Jan 2016 23:51:06 GMT
|
64
|
+
Pragma:
|
65
|
+
- no-cache
|
66
|
+
Expires:
|
67
|
+
- "0"
|
68
|
+
Set-Cookie:
|
69
|
+
- TS018aacab=01c9ad79a00557314a4df94d1661e1e99ad412028d12d2d850e9aae81fdd865bc137dce351; Path=/
|
70
|
+
Cache-Control:
|
71
|
+
- no-cache, no-store, must-revalidate
|
72
|
+
body:
|
73
|
+
string: "{\"merchant\":\"<TNS_MERCHANT_ID>\",\"session\":{\"id\":\"SESSION0002902011001K5498716E31\",\"updateStatus\":\"SUCCESS\",\"version\":\"140e062702\"},\"sourceOfFunds\":{\"provided\":{\"card\":{\"brand\":\"VISA\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"fundingMethod\":\"CREDIT\",\"number\":\"400555xxxxxx0001\",\"scheme\":\"VISA\",\"securityCode\":\"xxx\"}},\"type\":\"CARD\"},\"version\":\"32\"}"
|
74
|
+
http_version:
|
75
|
+
recorded_at: Mon, 11 Jan 2016 23:51:07 GMT
|
76
|
+
- request:
|
77
|
+
method: post
|
78
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/token
|
79
|
+
body:
|
80
|
+
string: "{\"session\":{\"id\":\"SESSION0002902011001K5498716E31\"},\"sourceOfFunds\":{\"type\":\"CARD\"}}"
|
81
|
+
headers:
|
82
|
+
Accept:
|
83
|
+
- "*/*"
|
84
|
+
Content-Length:
|
85
|
+
- "84"
|
86
|
+
Content-Type:
|
87
|
+
- Application/json;charset=UTF-8
|
88
|
+
Accept-Encoding:
|
89
|
+
- gzip, deflate
|
90
|
+
response:
|
91
|
+
status:
|
92
|
+
code: 201
|
93
|
+
message: Created
|
94
|
+
headers:
|
95
|
+
Content-Length:
|
96
|
+
- "495"
|
97
|
+
Content-Type:
|
98
|
+
- application/json;charset=UTF-8
|
99
|
+
Date:
|
100
|
+
- Mon, 11 Jan 2016 23:51:06 GMT
|
101
|
+
Pragma:
|
102
|
+
- no-cache
|
103
|
+
Expires:
|
104
|
+
- "0"
|
105
|
+
Set-Cookie:
|
106
|
+
- TS018aacab=01c9ad79a01337356ad559a6abc9dec2f7bfc825d1eb9409a1f3a2eeb9e45995ab6fe9dae6; Path=/
|
107
|
+
Cache-Control:
|
108
|
+
- no-cache, no-store, must-revalidate
|
109
|
+
body:
|
110
|
+
string: "{\"repositoryId\":\"TESTSUELDO\",\"response\":{\"gatewayCode\":\"BASIC_VERIFICATION_SUCCESSFUL\"},\"result\":\"SUCCESS\",\"sourceOfFunds\":{\"provided\":{\"card\":{\"brand\":\"VISA\",\"expiry\":\"0517\",\"fundingMethod\":\"CREDIT\",\"issuer\":\"JPMORGAN CHASE BANK, N.A.\",\"number\":\"400555xxxxxx0001\",\"scheme\":\"VISA\"}},\"type\":\"CARD\"},\"status\":\"VALID\",\"token\":\"9939572092778310\",\"usage\":{\"lastUpdated\":\"2016-01-11T23:51:06.758Z\",\"lastUpdatedBy\":\"<TNS_MERCHANT_ID>\",\"lastUsed\":\"2016-01-11T23:51:06.758Z\"},\"verificationStrategy\":\"BASIC\"}"
|
111
|
+
http_version:
|
112
|
+
recorded_at: Mon, 11 Jan 2016 23:51:07 GMT
|
113
|
+
- request:
|
114
|
+
method: put
|
115
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/order/10000001605/transaction/PAY
|
116
|
+
body:
|
117
|
+
string: "{\"apiOperation\":\"PAY\",\"order\":{\"amount\":\"100.00\",\"currency\":\"EUR\",\"reference\":\"PAY\"},\"transaction\":{\"reference\":\"PAY\"},\"sourceOfFunds\":{\"type\":\"CARD\",\"token\":\"9939572092778310\"}}"
|
118
|
+
headers:
|
119
|
+
Accept:
|
120
|
+
- "*/*"
|
121
|
+
Content-Length:
|
122
|
+
- "178"
|
123
|
+
Content-Type:
|
124
|
+
- Application/json;charset=UTF-8
|
125
|
+
Accept-Encoding:
|
126
|
+
- gzip, deflate
|
127
|
+
response:
|
128
|
+
status:
|
129
|
+
code: 201
|
130
|
+
message: Created
|
131
|
+
headers:
|
132
|
+
Content-Length:
|
133
|
+
- "1403"
|
134
|
+
Content-Type:
|
135
|
+
- application/json;charset=UTF-8
|
136
|
+
Date:
|
137
|
+
- Mon, 11 Jan 2016 23:51:07 GMT
|
138
|
+
Pragma:
|
139
|
+
- no-cache
|
140
|
+
Expires:
|
141
|
+
- "0"
|
142
|
+
Set-Cookie:
|
143
|
+
- TS018aacab=01c9ad79a033cd988fed23c7693ccb23dd661665991454c1bda28b68a98673eabd66b3a5a0; Path=/
|
144
|
+
Cache-Control:
|
145
|
+
- no-cache, no-store, must-revalidate
|
146
|
+
body:
|
147
|
+
string: "{\"gatewayEntryPoint\":\"WEB_SERVICES_API\",\"merchant\":\"<TNS_MERCHANT_ID>\",\"order\":{\"amount\":100.00,\"creationTime\":\"2016-01-11T23:51:07.167Z\",\"currency\":\"EUR\",\"id\":\"10000001605\",\"reference\":\"PAY\",\"status\":\"CAPTURED\",\"totalAuthorizedAmount\":100.00,\"totalCapturedAmount\":100.00,\"totalRefundedAmount\":0.00},\"response\":{\"acquirerCode\":\"00\",\"acquirerMessage\":\"Approved\",\"gatewayCode\":\"APPROVED\"},\"result\":\"SUCCESS\",\"risk\":{\"response\":{\"gatewayCode\":\"ACCEPTED\",\"review\":{\"decision\":\"NOT_REQUIRED\"},\"rule\":[{\"data\":\"400555\",\"name\":\"MERCHANT_BIN_RANGE\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"name\":\"SUSPECT_CARD_LIST\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"name\":\"TRUSTED_CARD_LIST\",\"recommendation\":\"NO_ACTION\",\"type\":\"MERCHANT_RULE\"},{\"data\":\"400555\",\"name\":\"MSO_BIN_RANGE\",\"recommendation\":\"NO_ACTION\",\"type\":\"MSO_RULE\"}]}},\"sourceOfFunds\":{\"provided\":{\"card\":{\"brand\":\"VISA\",\"expiry\":{\"month\":\"5\",\"year\":\"17\"},\"fundingMethod\":\"CREDIT\",\"issuer\":\"JPMORGAN CHASE BANK, N.A.\",\"number\":\"400555xxxxxx0001\",\"scheme\":\"VISA\"}},\"token\":\"9939572092778310\",\"type\":\"CARD\"},\"timeOfRecord\":\"2016-01-11T23:51:07.167Z\",\"transaction\":{\"acquirer\":{\"batch\":1,\"id\":\"AIB\",\"merchantId\":\"011855511\"},\"amount\":100.00,\"authorizationCode\":\"029329\",\"currency\":\"EUR\",\"frequency\":\"SINGLE\",\"id\":\"PAY\",\"receipt\":\"AAAAC5BJET\",\"reference\":\"PAY\",\"source\":\"MOTO\",\"terminal\":\"31208585\",\"type\":\"PAYMENT\"},\"version\":\"32\"}"
|
148
|
+
http_version:
|
149
|
+
recorded_at: Mon, 11 Jan 2016 23:51:08 GMT
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
recorded_with: VCR 2.9.3
|
3
|
+
http_interactions:
|
4
|
+
- request:
|
5
|
+
method: put
|
6
|
+
uri: https://merchant.<TNS_MERCHANT_ID>:<TNS_API_KEY>@secure.ap.tnspayments.com/api/rest/version/32/merchant/<TNS_MERCHANT_ID>/order/10000001610/transaction/PAY
|
7
|
+
body:
|
8
|
+
string: "{\"apiOperation\":\"PAY\",\"order\":{\"amount\":\"100.00\",\"currency\":\"EUR\",\"reference\":\"PAY\"},\"transaction\":{\"reference\":\"PAY\"},\"sourceOfFunds\":{\"type\":\"CARD\"},\"session\":{\"id\":\"LOLSESSIONTOKEN\"}}"
|
9
|
+
headers:
|
10
|
+
Content-Length:
|
11
|
+
- "186"
|
12
|
+
Content-Type:
|
13
|
+
- Application/json;charset=UTF-8
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip, deflate
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 400
|
21
|
+
message: Bad Request
|
22
|
+
headers:
|
23
|
+
Set-Cookie:
|
24
|
+
- TS018aacab=01c9ad79a024f8ba77781bc8b67db04663fe6926efd8a518008d844aa76324e612d9073f05; Path=/
|
25
|
+
Cache-Control:
|
26
|
+
- no-cache, no-store, must-revalidate
|
27
|
+
Content-Length:
|
28
|
+
- "105"
|
29
|
+
Content-Type:
|
30
|
+
- application/json;charset=UTF-8
|
31
|
+
Pragma:
|
32
|
+
- no-cache
|
33
|
+
X-Cnection:
|
34
|
+
- close
|
35
|
+
Expires:
|
36
|
+
- "0"
|
37
|
+
Date:
|
38
|
+
- Mon, 11 Jan 2016 23:56:11 GMT
|
39
|
+
body:
|
40
|
+
string: "{\"error\":{\"cause\":\"INVALID_REQUEST\",\"explanation\":\"Form Session not found or expired.\"},\"result\":\"ERROR\"}"
|
41
|
+
http_version:
|
42
|
+
recorded_at: Mon, 11 Jan 2016 23:56:12 GMT
|