fat_zebra 3.2.3 → 3.2.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e5d627afd6d3040400fee49c3c191791363e3efbdfcb70477a4452e0b074630
4
- data.tar.gz: daf94f02f48e8b62adb0d2c33f382be605ac5625e6dc9b4836a7eefd3789f0f9
3
+ metadata.gz: ce036c9eb7ff13fb1c6f60e6b0e4230299ccdb3384e4359959426d75c9a8e42b
4
+ data.tar.gz: b55070ec65cbbad8c82ed8974c572dc0cc9eae5d38b3d49a0446dd91febc1570
5
5
  SHA512:
6
- metadata.gz: e4b91bb9e842bd8a4052bf99a1914247a2dc90851a9cd62c805c9c0e56e21580fe26a0767c1e105b82e3e136a5a587b4bbc814bf65545095ffb70e4f0941209f
7
- data.tar.gz: de16ef4131e682b1024e40e97177b1a1a6a9c29f4343a8c8ff67554473007fcd9b9b0576d22a70af0376bc95aa95462dc3a9447ba0dc716a1abbe81d09d4aad0
6
+ metadata.gz: 741c6e12a74bc6f05de8b1b04794476dd3dd1c711db11e093ccba35768e753657c5289d8151458140f8e582f971eb0d0876bd9240151df6ba97ac12b577f8e16
7
+ data.tar.gz: 9aee0585dd4f0addde3fbf1ce4408a8905ccf2c336994a9a46d4fd7b2dd6a0d11d1bf9b1c6a33af4f6148b790cfe097de5739f645395a269c684e34cc6e18b96
@@ -92,5 +92,28 @@ module FatZebra
92
92
  update_from(response)
93
93
  end
94
94
 
95
+ ##
96
+ # Extends an authorization expiry (if not already expired)
97
+ #
98
+ # @param [Hash] options for the request, and configurations (Optional)
99
+ #
100
+ # @return [Response] Purchase response object
101
+ def extend!(options = {})
102
+ response = request(:put, resource_path("purchases/#{id}"), { extend: true }, options)
103
+ update_from(response)
104
+ end
105
+
106
+ ##
107
+ # Increments an authorization amount
108
+ #
109
+ # @param [Int] amount to increment the authorization by
110
+ # @param [Hash] options for the request, and configurations (Optional)
111
+ #
112
+ # @return [Response] Purchase response object
113
+ def increment!(additional_amount, options = {})
114
+ raise ArgumentError, 'Amount must be a positive amount' unless additional_amount > 0
115
+ response = request(:put, resource_path("purchases/#{id}"), { amount: amount + additional_amount }, options)
116
+ update_from(response)
117
+ end
95
118
  end
96
119
  end
@@ -1,3 +1,3 @@
1
1
  module FatZebra
2
- VERSION = '3.2.3'.freeze
2
+ VERSION = '3.2.4'.freeze
3
3
  end
@@ -0,0 +1,109 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"amount":10000,"card_holder":"Matthew Savage","card_number":"5123456789012346","card_expiry":"02/2030","cvv":123,"reference":"bd02a8e19fee89111140c6fa8e05c303","customer_ip":"1.2.3.4","capture":false,"currency":"AUD","test":true}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Authorization:
17
+ - Basic VEVTVDpURVNU
18
+ Content-Type:
19
+ - application/json
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Tue, 08 Jun 2021 23:45:53 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Status:
34
+ - 200 OK
35
+ Cache-Control:
36
+ - no-store
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains
39
+ - max-age=31536000; includeSubDomains
40
+ X-Request-Version:
41
+ - 1.21.8
42
+ Pragma:
43
+ - no-cache
44
+ X-Request-Id:
45
+ - 3fa274fc7c18d23a2b5b2ab0
46
+ X-Runtime:
47
+ - '0.100963'
48
+ X-Backend:
49
+ - gateway
50
+ body:
51
+ encoding: UTF-8
52
+ string: '{"successful":true,"response":{"authorization":"204228","id":"071-P-GPWDTVDA","card_number":"512345XXXXXX2346","card_holder":"Matthew
53
+ Savage","card_expiry":"2030-02-28","card_token":"1ewcmufs5iulu4tdirhq","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"bd02a8e19fee89111140c6fa8e05c303","currency":"AUD","transaction_id":"071-P-GPWDTVDA","settlement_date":null,"transaction_date":"2021-06-09T09:45:53+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PGPWDTVDA","cvv_match":"M","metadata":{"authorization_tracking_id":"","card_sequence_number":"","sca_exemption":"","scheme_token_used":"false","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
54
+ http_version:
55
+ recorded_at: Tue, 08 Jun 2021 23:45:53 GMT
56
+ - request:
57
+ method: put
58
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/071-P-GPWDTVDA
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"extend":true,"test":true}'
62
+ headers:
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ Accept:
66
+ - application/json
67
+ User-Agent:
68
+ - Ruby
69
+ Authorization:
70
+ - Basic VEVTVDpURVNU
71
+ Content-Type:
72
+ - application/json
73
+ response:
74
+ status:
75
+ code: 200
76
+ message: OK
77
+ headers:
78
+ Date:
79
+ - Tue, 08 Jun 2021 23:45:53 GMT
80
+ Content-Type:
81
+ - application/json; charset=utf-8
82
+ Transfer-Encoding:
83
+ - chunked
84
+ Connection:
85
+ - keep-alive
86
+ Status:
87
+ - 200 OK
88
+ Cache-Control:
89
+ - no-store
90
+ Strict-Transport-Security:
91
+ - max-age=31536000; includeSubDomains
92
+ - max-age=31536000; includeSubDomains
93
+ X-Request-Version:
94
+ - 1.21.8
95
+ Pragma:
96
+ - no-cache
97
+ X-Request-Id:
98
+ - 70b9833c5e65f2d7083995cd
99
+ X-Runtime:
100
+ - '0.023373'
101
+ X-Backend:
102
+ - gateway
103
+ body:
104
+ encoding: UTF-8
105
+ string: '{"successful":true,"response":{"authorization":"204228","id":"071-P-GPWDTVDA","card_number":"512345XXXXXX2346","card_holder":"Matthew
106
+ Savage","card_expiry":"2030-02-28","card_token":"1ewcmufs5iulu4tdirhq","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"bd02a8e19fee89111140c6fa8e05c303","currency":"AUD","transaction_id":"071-P-GPWDTVDA","settlement_date":null,"transaction_date":"2021-06-09T09:45:53+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PGPWDTVDA","cvv_match":"M","metadata":{"sca_exemption":"","scheme_token_used":"false","card_sequence_number":"","authorization_tracking_id":"","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
107
+ http_version:
108
+ recorded_at: Tue, 08 Jun 2021 23:45:53 GMT
109
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,109 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"amount":10000,"card_holder":"Matthew Savage","card_number":"5123456789012346","card_expiry":"02/2030","cvv":123,"reference":"12e37abfaccd9514e373648204bc2484","customer_ip":"1.2.3.4","capture":false,"currency":"AUD","test":true}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Authorization:
17
+ - Basic VEVTVDpURVNU
18
+ Content-Type:
19
+ - application/json
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Tue, 08 Jun 2021 23:45:53 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Status:
34
+ - 200 OK
35
+ Cache-Control:
36
+ - no-store
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains
39
+ - max-age=31536000; includeSubDomains
40
+ X-Request-Version:
41
+ - 1.21.8
42
+ Pragma:
43
+ - no-cache
44
+ X-Request-Id:
45
+ - 20203f322426866f79374f52
46
+ X-Runtime:
47
+ - '0.132383'
48
+ X-Backend:
49
+ - gateway
50
+ body:
51
+ encoding: UTF-8
52
+ string: '{"successful":true,"response":{"authorization":"624772","id":"071-P-AJHI43I6","card_number":"512345XXXXXX2346","card_holder":"Matthew
53
+ Savage","card_expiry":"2030-02-28","card_token":"psfyzi66v77olyxk4mvs","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"12e37abfaccd9514e373648204bc2484","currency":"AUD","transaction_id":"071-P-AJHI43I6","settlement_date":null,"transaction_date":"2021-06-09T09:45:53+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PAJHI43I6","cvv_match":"M","metadata":{"authorization_tracking_id":"","card_sequence_number":"","sca_exemption":"","scheme_token_used":"false","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
54
+ http_version:
55
+ recorded_at: Tue, 08 Jun 2021 23:45:53 GMT
56
+ - request:
57
+ method: put
58
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/071-P-AJHI43I6
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"extend":true,"test":true}'
62
+ headers:
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ Accept:
66
+ - application/json
67
+ User-Agent:
68
+ - Ruby
69
+ Authorization:
70
+ - Basic VEVTVDpURVNU
71
+ Content-Type:
72
+ - application/json
73
+ response:
74
+ status:
75
+ code: 200
76
+ message: OK
77
+ headers:
78
+ Date:
79
+ - Tue, 08 Jun 2021 23:45:54 GMT
80
+ Content-Type:
81
+ - application/json; charset=utf-8
82
+ Transfer-Encoding:
83
+ - chunked
84
+ Connection:
85
+ - keep-alive
86
+ Status:
87
+ - 200 OK
88
+ Cache-Control:
89
+ - no-store
90
+ Strict-Transport-Security:
91
+ - max-age=31536000; includeSubDomains
92
+ - max-age=31536000; includeSubDomains
93
+ X-Request-Version:
94
+ - 1.21.8
95
+ Pragma:
96
+ - no-cache
97
+ X-Request-Id:
98
+ - 22dea56176ac419f1358d33e
99
+ X-Runtime:
100
+ - '0.035342'
101
+ X-Backend:
102
+ - gateway
103
+ body:
104
+ encoding: UTF-8
105
+ string: '{"successful":true,"response":{"authorization":"624772","id":"071-P-AJHI43I6","card_number":"512345XXXXXX2346","card_holder":"Matthew
106
+ Savage","card_expiry":"2030-02-28","card_token":"psfyzi66v77olyxk4mvs","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"12e37abfaccd9514e373648204bc2484","currency":"AUD","transaction_id":"071-P-AJHI43I6","settlement_date":null,"transaction_date":"2021-06-09T09:45:53+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PAJHI43I6","cvv_match":"M","metadata":{"sca_exemption":"","scheme_token_used":"false","card_sequence_number":"","authorization_tracking_id":"","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
107
+ http_version:
108
+ recorded_at: Tue, 08 Jun 2021 23:45:54 GMT
109
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,109 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"amount":10000,"card_holder":"Matthew Savage","card_number":"5123456789012346","card_expiry":"02/2030","cvv":123,"reference":"d942e91a6549a7be6fa7ff91e74b2a24","customer_ip":"1.2.3.4","capture":false,"currency":"AUD","test":true}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Authorization:
17
+ - Basic VEVTVDpURVNU
18
+ Content-Type:
19
+ - application/json
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Tue, 08 Jun 2021 23:45:54 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Status:
34
+ - 200 OK
35
+ Cache-Control:
36
+ - no-store
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains
39
+ - max-age=31536000; includeSubDomains
40
+ X-Request-Version:
41
+ - 1.21.8
42
+ Pragma:
43
+ - no-cache
44
+ X-Request-Id:
45
+ - 227b91ff7e9fe49c1a2b757f
46
+ X-Runtime:
47
+ - '0.104138'
48
+ X-Backend:
49
+ - gateway
50
+ body:
51
+ encoding: UTF-8
52
+ string: '{"successful":true,"response":{"authorization":"659832","id":"071-P-3NDVVJM1","card_number":"512345XXXXXX2346","card_holder":"Matthew
53
+ Savage","card_expiry":"2030-02-28","card_token":"2o2rxvvikqtjtb33jkdi","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"d942e91a6549a7be6fa7ff91e74b2a24","currency":"AUD","transaction_id":"071-P-3NDVVJM1","settlement_date":null,"transaction_date":"2021-06-09T09:45:54+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071P3NDVVJM1","cvv_match":"M","metadata":{"authorization_tracking_id":"","card_sequence_number":"","sca_exemption":"","scheme_token_used":"false","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
54
+ http_version:
55
+ recorded_at: Tue, 08 Jun 2021 23:45:54 GMT
56
+ - request:
57
+ method: put
58
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/071-P-3NDVVJM1
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"extend":true,"test":true}'
62
+ headers:
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ Accept:
66
+ - application/json
67
+ User-Agent:
68
+ - Ruby
69
+ Authorization:
70
+ - Basic VEVTVDpURVNU
71
+ Content-Type:
72
+ - application/json
73
+ response:
74
+ status:
75
+ code: 200
76
+ message: OK
77
+ headers:
78
+ Date:
79
+ - Tue, 08 Jun 2021 23:45:54 GMT
80
+ Content-Type:
81
+ - application/json; charset=utf-8
82
+ Transfer-Encoding:
83
+ - chunked
84
+ Connection:
85
+ - keep-alive
86
+ Status:
87
+ - 200 OK
88
+ Cache-Control:
89
+ - no-store
90
+ Strict-Transport-Security:
91
+ - max-age=31536000; includeSubDomains
92
+ - max-age=31536000; includeSubDomains
93
+ X-Request-Version:
94
+ - 1.21.8
95
+ Pragma:
96
+ - no-cache
97
+ X-Request-Id:
98
+ - 68971bf94184f2c522565ba9
99
+ X-Runtime:
100
+ - '0.024456'
101
+ X-Backend:
102
+ - gateway
103
+ body:
104
+ encoding: UTF-8
105
+ string: '{"successful":true,"response":{"authorization":"659832","id":"071-P-3NDVVJM1","card_number":"512345XXXXXX2346","card_holder":"Matthew
106
+ Savage","card_expiry":"2030-02-28","card_token":"2o2rxvvikqtjtb33jkdi","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"d942e91a6549a7be6fa7ff91e74b2a24","currency":"AUD","transaction_id":"071-P-3NDVVJM1","settlement_date":null,"transaction_date":"2021-06-09T09:45:54+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071P3NDVVJM1","cvv_match":"M","metadata":{"sca_exemption":"","scheme_token_used":"false","card_sequence_number":"","authorization_tracking_id":"","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
107
+ http_version:
108
+ recorded_at: Tue, 08 Jun 2021 23:45:54 GMT
109
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,109 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"amount":10000,"card_holder":"Matthew Savage","card_number":"5123456789012346","card_expiry":"02/2030","cvv":123,"reference":"819dd2e6209fb5dd59c4247d976ff495","customer_ip":"1.2.3.4","capture":false,"currency":"AUD","test":true}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Authorization:
17
+ - Basic VEVTVDpURVNU
18
+ Content-Type:
19
+ - application/json
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Tue, 08 Jun 2021 23:45:54 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Status:
34
+ - 200 OK
35
+ Cache-Control:
36
+ - no-store
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains
39
+ - max-age=31536000; includeSubDomains
40
+ X-Request-Version:
41
+ - 1.21.8
42
+ Pragma:
43
+ - no-cache
44
+ X-Request-Id:
45
+ - 4896937635a015fe6614ae77
46
+ X-Runtime:
47
+ - '0.112404'
48
+ X-Backend:
49
+ - gateway
50
+ body:
51
+ encoding: UTF-8
52
+ string: '{"successful":true,"response":{"authorization":"246645","id":"071-P-9BSIJVA2","card_number":"512345XXXXXX2346","card_holder":"Matthew
53
+ Savage","card_expiry":"2030-02-28","card_token":"78za9bfru3ke3jxansar","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"819dd2e6209fb5dd59c4247d976ff495","currency":"AUD","transaction_id":"071-P-9BSIJVA2","settlement_date":null,"transaction_date":"2021-06-09T09:45:54+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071P9BSIJVA2","cvv_match":"M","metadata":{"authorization_tracking_id":"","card_sequence_number":"","sca_exemption":"","scheme_token_used":"false","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
54
+ http_version:
55
+ recorded_at: Tue, 08 Jun 2021 23:45:54 GMT
56
+ - request:
57
+ method: put
58
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/071-P-9BSIJVA2
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"amount":10200,"test":true}'
62
+ headers:
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ Accept:
66
+ - application/json
67
+ User-Agent:
68
+ - Ruby
69
+ Authorization:
70
+ - Basic VEVTVDpURVNU
71
+ Content-Type:
72
+ - application/json
73
+ response:
74
+ status:
75
+ code: 200
76
+ message: OK
77
+ headers:
78
+ Date:
79
+ - Tue, 08 Jun 2021 23:45:54 GMT
80
+ Content-Type:
81
+ - application/json; charset=utf-8
82
+ Transfer-Encoding:
83
+ - chunked
84
+ Connection:
85
+ - keep-alive
86
+ Status:
87
+ - 200 OK
88
+ Cache-Control:
89
+ - no-store
90
+ Strict-Transport-Security:
91
+ - max-age=31536000; includeSubDomains
92
+ - max-age=31536000; includeSubDomains
93
+ X-Request-Version:
94
+ - 1.21.8
95
+ Pragma:
96
+ - no-cache
97
+ X-Request-Id:
98
+ - 014721ad4367448005ba87b0
99
+ X-Runtime:
100
+ - '0.040192'
101
+ X-Backend:
102
+ - gateway
103
+ body:
104
+ encoding: UTF-8
105
+ string: '{"successful":true,"response":{"authorization":"246645","id":"071-P-9BSIJVA2","card_number":"512345XXXXXX2346","card_holder":"Matthew
106
+ Savage","card_expiry":"2030-02-28","card_token":"78za9bfru3ke3jxansar","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10200,"decimal_amount":102.0,"successful":true,"message":"Approved","reference":"819dd2e6209fb5dd59c4247d976ff495","currency":"AUD","transaction_id":"071-P-9BSIJVA2","settlement_date":null,"transaction_date":"2021-06-09T09:45:54+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071P9BSIJVA2","cvv_match":"M","metadata":{"sca_exemption":"","scheme_token_used":"false","card_sequence_number":"","authorization_tracking_id":"","original_transaction_reference":"","original_amount":"10000"},"addendum_data":{}},"errors":[],"test":true}'
107
+ http_version:
108
+ recorded_at: Tue, 08 Jun 2021 23:45:54 GMT
109
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,109 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"amount":10000,"card_holder":"Matthew Savage","card_number":"5123456789012346","card_expiry":"02/2030","cvv":123,"reference":"043a471b5fdb68cdc18df3778d1decaa","customer_ip":"1.2.3.4","capture":false,"currency":"AUD","test":true}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Authorization:
17
+ - Basic VEVTVDpURVNU
18
+ Content-Type:
19
+ - application/json
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Tue, 08 Jun 2021 23:45:54 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Status:
34
+ - 200 OK
35
+ Cache-Control:
36
+ - no-store
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains
39
+ - max-age=31536000; includeSubDomains
40
+ X-Request-Version:
41
+ - 1.21.8
42
+ Pragma:
43
+ - no-cache
44
+ X-Request-Id:
45
+ - 66caacd871e2f31f5c01597d
46
+ X-Runtime:
47
+ - '0.100926'
48
+ X-Backend:
49
+ - gateway
50
+ body:
51
+ encoding: UTF-8
52
+ string: '{"successful":true,"response":{"authorization":"243808","id":"071-P-X436H7FV","card_number":"512345XXXXXX2346","card_holder":"Matthew
53
+ Savage","card_expiry":"2030-02-28","card_token":"mbi7mpgrf4yfcwzwon9x","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"043a471b5fdb68cdc18df3778d1decaa","currency":"AUD","transaction_id":"071-P-X436H7FV","settlement_date":null,"transaction_date":"2021-06-09T09:45:54+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PX436H7FV","cvv_match":"M","metadata":{"authorization_tracking_id":"","card_sequence_number":"","sca_exemption":"","scheme_token_used":"false","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
54
+ http_version:
55
+ recorded_at: Tue, 08 Jun 2021 23:45:54 GMT
56
+ - request:
57
+ method: put
58
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/071-P-X436H7FV
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"amount":10200,"test":true}'
62
+ headers:
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ Accept:
66
+ - application/json
67
+ User-Agent:
68
+ - Ruby
69
+ Authorization:
70
+ - Basic VEVTVDpURVNU
71
+ Content-Type:
72
+ - application/json
73
+ response:
74
+ status:
75
+ code: 200
76
+ message: OK
77
+ headers:
78
+ Date:
79
+ - Tue, 08 Jun 2021 23:45:54 GMT
80
+ Content-Type:
81
+ - application/json; charset=utf-8
82
+ Transfer-Encoding:
83
+ - chunked
84
+ Connection:
85
+ - keep-alive
86
+ Status:
87
+ - 200 OK
88
+ Cache-Control:
89
+ - no-store
90
+ Strict-Transport-Security:
91
+ - max-age=31536000; includeSubDomains
92
+ - max-age=31536000; includeSubDomains
93
+ X-Request-Version:
94
+ - 1.21.8
95
+ Pragma:
96
+ - no-cache
97
+ X-Request-Id:
98
+ - 5235a0f94856bca32692182c
99
+ X-Runtime:
100
+ - '0.038736'
101
+ X-Backend:
102
+ - gateway
103
+ body:
104
+ encoding: UTF-8
105
+ string: '{"successful":true,"response":{"authorization":"243808","id":"071-P-X436H7FV","card_number":"512345XXXXXX2346","card_holder":"Matthew
106
+ Savage","card_expiry":"2030-02-28","card_token":"mbi7mpgrf4yfcwzwon9x","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10200,"decimal_amount":102.0,"successful":true,"message":"Approved","reference":"043a471b5fdb68cdc18df3778d1decaa","currency":"AUD","transaction_id":"071-P-X436H7FV","settlement_date":null,"transaction_date":"2021-06-09T09:45:54+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PX436H7FV","cvv_match":"M","metadata":{"sca_exemption":"","scheme_token_used":"false","card_sequence_number":"","authorization_tracking_id":"","original_transaction_reference":"","original_amount":"10000"},"addendum_data":{}},"errors":[],"test":true}'
107
+ http_version:
108
+ recorded_at: Tue, 08 Jun 2021 23:45:54 GMT
109
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,109 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"amount":10000,"card_holder":"Matthew Savage","card_number":"5123456789012346","card_expiry":"02/2030","cvv":123,"reference":"e5583cc8454b1e8ca386b059d472f9db","customer_ip":"1.2.3.4","capture":false,"currency":"AUD","test":true}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Authorization:
17
+ - Basic VEVTVDpURVNU
18
+ Content-Type:
19
+ - application/json
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Tue, 08 Jun 2021 23:45:55 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Status:
34
+ - 200 OK
35
+ Cache-Control:
36
+ - no-store
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains
39
+ - max-age=31536000; includeSubDomains
40
+ X-Request-Version:
41
+ - 1.21.8
42
+ Pragma:
43
+ - no-cache
44
+ X-Request-Id:
45
+ - 40d8526b36057c1733e4a4c3
46
+ X-Runtime:
47
+ - '0.127190'
48
+ X-Backend:
49
+ - gateway
50
+ body:
51
+ encoding: UTF-8
52
+ string: '{"successful":true,"response":{"authorization":"194901","id":"071-P-TS0BQSDO","card_number":"512345XXXXXX2346","card_holder":"Matthew
53
+ Savage","card_expiry":"2030-02-28","card_token":"0fosofh1yfyum1g1j61b","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"e5583cc8454b1e8ca386b059d472f9db","currency":"AUD","transaction_id":"071-P-TS0BQSDO","settlement_date":null,"transaction_date":"2021-06-09T09:45:54+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PTS0BQSDO","cvv_match":"M","metadata":{"authorization_tracking_id":"","card_sequence_number":"","sca_exemption":"","scheme_token_used":"false","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
54
+ http_version:
55
+ recorded_at: Tue, 08 Jun 2021 23:45:55 GMT
56
+ - request:
57
+ method: put
58
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/071-P-TS0BQSDO
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"amount":10200,"test":true}'
62
+ headers:
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ Accept:
66
+ - application/json
67
+ User-Agent:
68
+ - Ruby
69
+ Authorization:
70
+ - Basic VEVTVDpURVNU
71
+ Content-Type:
72
+ - application/json
73
+ response:
74
+ status:
75
+ code: 200
76
+ message: OK
77
+ headers:
78
+ Date:
79
+ - Tue, 08 Jun 2021 23:45:55 GMT
80
+ Content-Type:
81
+ - application/json; charset=utf-8
82
+ Transfer-Encoding:
83
+ - chunked
84
+ Connection:
85
+ - keep-alive
86
+ Status:
87
+ - 200 OK
88
+ Cache-Control:
89
+ - no-store
90
+ Strict-Transport-Security:
91
+ - max-age=31536000; includeSubDomains
92
+ - max-age=31536000; includeSubDomains
93
+ X-Request-Version:
94
+ - 1.21.8
95
+ Pragma:
96
+ - no-cache
97
+ X-Request-Id:
98
+ - 6a3ff89f391840837027a541
99
+ X-Runtime:
100
+ - '0.036078'
101
+ X-Backend:
102
+ - gateway
103
+ body:
104
+ encoding: UTF-8
105
+ string: '{"successful":true,"response":{"authorization":"194901","id":"071-P-TS0BQSDO","card_number":"512345XXXXXX2346","card_holder":"Matthew
106
+ Savage","card_expiry":"2030-02-28","card_token":"0fosofh1yfyum1g1j61b","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10200,"decimal_amount":102.0,"successful":true,"message":"Approved","reference":"e5583cc8454b1e8ca386b059d472f9db","currency":"AUD","transaction_id":"071-P-TS0BQSDO","settlement_date":null,"transaction_date":"2021-06-09T09:45:54+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PTS0BQSDO","cvv_match":"M","metadata":{"sca_exemption":"","scheme_token_used":"false","card_sequence_number":"","authorization_tracking_id":"","original_transaction_reference":"","original_amount":"10000"},"addendum_data":{}},"errors":[],"test":true}'
107
+ http_version:
108
+ recorded_at: Tue, 08 Jun 2021 23:45:55 GMT
109
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,109 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"amount":10000,"card_holder":"Matthew Savage","card_number":"5123456789012346","card_expiry":"02/2030","cvv":123,"reference":"558867e5b205ddc58db8c30edf5fb7f9","customer_ip":"1.2.3.4","capture":false,"currency":"AUD","test":true}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Authorization:
17
+ - Basic VEVTVDpURVNU
18
+ Content-Type:
19
+ - application/json
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Tue, 08 Jun 2021 23:45:55 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Status:
34
+ - 200 OK
35
+ Cache-Control:
36
+ - no-store
37
+ Strict-Transport-Security:
38
+ - max-age=31536000; includeSubDomains
39
+ - max-age=31536000; includeSubDomains
40
+ X-Request-Version:
41
+ - 1.21.8
42
+ Pragma:
43
+ - no-cache
44
+ X-Request-Id:
45
+ - 222f16437f6e911726a3586d
46
+ X-Runtime:
47
+ - '0.118003'
48
+ X-Backend:
49
+ - gateway
50
+ body:
51
+ encoding: UTF-8
52
+ string: '{"successful":true,"response":{"authorization":"332706","id":"071-P-V9MKMHAL","card_number":"512345XXXXXX2346","card_holder":"Matthew
53
+ Savage","card_expiry":"2030-02-28","card_token":"ca9op0w3dybutwcfsc8i","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10000,"decimal_amount":100.0,"successful":true,"message":"Approved","reference":"558867e5b205ddc58db8c30edf5fb7f9","currency":"AUD","transaction_id":"071-P-V9MKMHAL","settlement_date":null,"transaction_date":"2021-06-09T09:45:55+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PV9MKMHAL","cvv_match":"M","metadata":{"authorization_tracking_id":"","card_sequence_number":"","sca_exemption":"","scheme_token_used":"false","original_transaction_reference":""},"addendum_data":{}},"errors":[],"test":true}'
54
+ http_version:
55
+ recorded_at: Tue, 08 Jun 2021 23:45:55 GMT
56
+ - request:
57
+ method: put
58
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/purchases/071-P-V9MKMHAL
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"amount":10200,"test":true}'
62
+ headers:
63
+ Accept-Encoding:
64
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
65
+ Accept:
66
+ - application/json
67
+ User-Agent:
68
+ - Ruby
69
+ Authorization:
70
+ - Basic VEVTVDpURVNU
71
+ Content-Type:
72
+ - application/json
73
+ response:
74
+ status:
75
+ code: 200
76
+ message: OK
77
+ headers:
78
+ Date:
79
+ - Tue, 08 Jun 2021 23:45:55 GMT
80
+ Content-Type:
81
+ - application/json; charset=utf-8
82
+ Transfer-Encoding:
83
+ - chunked
84
+ Connection:
85
+ - keep-alive
86
+ Status:
87
+ - 200 OK
88
+ Cache-Control:
89
+ - no-store
90
+ Strict-Transport-Security:
91
+ - max-age=31536000; includeSubDomains
92
+ - max-age=31536000; includeSubDomains
93
+ X-Request-Version:
94
+ - 1.21.8
95
+ Pragma:
96
+ - no-cache
97
+ X-Request-Id:
98
+ - 6f5813c4661a0151133fe49d
99
+ X-Runtime:
100
+ - '0.045495'
101
+ X-Backend:
102
+ - gateway
103
+ body:
104
+ encoding: UTF-8
105
+ string: '{"successful":true,"response":{"authorization":"332706","id":"071-P-V9MKMHAL","card_number":"512345XXXXXX2346","card_holder":"Matthew
106
+ Savage","card_expiry":"2030-02-28","card_token":"ca9op0w3dybutwcfsc8i","card_type":"MasterCard","card_category":"Credit","card_subcategory":"Standard","amount":10200,"decimal_amount":102.0,"successful":true,"message":"Approved","reference":"558867e5b205ddc58db8c30edf5fb7f9","currency":"AUD","transaction_id":"071-P-V9MKMHAL","settlement_date":null,"transaction_date":"2021-06-09T09:45:55+10:00","response_code":"00","captured":false,"captured_amount":0,"rrn":"071PV9MKMHAL","cvv_match":"M","metadata":{"sca_exemption":"","scheme_token_used":"false","card_sequence_number":"","authorization_tracking_id":"","original_transaction_reference":"","original_amount":"10000"},"addendum_data":{}},"errors":[],"test":true}'
107
+ http_version:
108
+ recorded_at: Tue, 08 Jun 2021 23:45:55 GMT
109
+ recorded_with: VCR 3.0.3
@@ -102,4 +102,22 @@ describe FatZebra::Purchase do
102
102
  it { expect(settlement.data.first).to be_a(FatZebra::Purchase) }
103
103
  end
104
104
 
105
+ describe '#extend!', :vcr do
106
+ let(:purchase) { FatZebra::Purchase.create(valid_purchase_payload.merge(capture: false)) }
107
+ subject(:extend) { purchase.extend! }
108
+
109
+ it { is_expected.to be_accepted }
110
+ it { is_expected.to be_successful }
111
+ it { expect(extend).to be_a(FatZebra::Purchase) }
112
+ end
113
+
114
+ describe '#increment', :vcr do
115
+ let(:purchase) { FatZebra::Purchase.create(valid_purchase_payload.merge(capture: false)) }
116
+ subject(:increment) { purchase.increment!(200) }
117
+
118
+ it { is_expected.to be_accepted }
119
+ it { is_expected.to be_successful }
120
+ it { expect(increment).to be_a(FatZebra::Purchase) }
121
+ it { expect(increment.amount).to eq(valid_purchase_payload[:amount] + 200) }
122
+ end
105
123
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_zebra
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fat Zebra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-04 00:00:00.000000000 Z
11
+ date: 2021-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -278,10 +278,17 @@ files:
278
278
  - spec/cassettes/FatZebra_Purchase/_create/1_1_9.yml
279
279
  - spec/cassettes/FatZebra_Purchase/_create/bad_request/1_1_14_1.yml
280
280
  - spec/cassettes/FatZebra_Purchase/_create/bad_request/1_1_14_2.yml
281
+ - spec/cassettes/FatZebra_Purchase/_extend_/1_9_1.yml
282
+ - spec/cassettes/FatZebra_Purchase/_extend_/1_9_2.yml
283
+ - spec/cassettes/FatZebra_Purchase/_extend_/1_9_3.yml
281
284
  - spec/cassettes/FatZebra_Purchase/_find/1_2_1.yml
282
285
  - spec/cassettes/FatZebra_Purchase/_find/1_2_2.yml
283
286
  - spec/cassettes/FatZebra_Purchase/_find/1_2_3.yml
284
287
  - spec/cassettes/FatZebra_Purchase/_find/1_2_4.yml
288
+ - spec/cassettes/FatZebra_Purchase/_increment/1_10_1.yml
289
+ - spec/cassettes/FatZebra_Purchase/_increment/1_10_2.yml
290
+ - spec/cassettes/FatZebra_Purchase/_increment/1_10_3.yml
291
+ - spec/cassettes/FatZebra_Purchase/_increment/1_10_4.yml
285
292
  - spec/cassettes/FatZebra_Purchase/_refund/1_4_1.yml
286
293
  - spec/cassettes/FatZebra_Purchase/_refund/1_4_2.yml
287
294
  - spec/cassettes/FatZebra_Purchase/_refund/1_4_3.yml