fat_zebra_multi 3.1.0.2 → 3.2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30b49748c51f992c3f462d71599ab4c1e5402195acc4095863bbcc8461fbc53d
4
- data.tar.gz: 32328e35812fe9fd26b4b6cd79064424281af729efe2f7ad37ca57cacde060a6
3
+ metadata.gz: d8cc64078a0d4550e82e685fd5f4ff5a863050d0cf0def2fc44685f02ed89328
4
+ data.tar.gz: 496cc0182bcac8d5bbc07ff030ab15b0332acad2d912a4ce11fce1eefebdb2a6
5
5
  SHA512:
6
- metadata.gz: c027f53ef49d052621cb67c5b1e2fcf6a7f2487f608d09c28c43b9089cb32a1438de0b18d03049b90c1cc7b9ff6c985bfed21c41746da9cb4b55b8b1f1485995
7
- data.tar.gz: 9ee40b044316b1138485be042d1526da0d87ed7ef4585fd9f4f51fc17b770dc29ba00d107ddd165d7bf3ba900786adaad961f23dafa5cd77340eefbe6bc3a72f
6
+ metadata.gz: d072ffcf46a12cd7755953e6da610564e399d6dde9cee3c6bd4c5ec8321b139bfa5fada2656229a9523eaaa964e2905eae0ee1397599ce63f2a41863396f1834
7
+ data.tar.gz: 99a13904c3238ff24a0bdc495129e4894c3550ee85fff8dfb07ec79a98b802cbe5b187e6bb6782e868e5cfd303e98aa2f3ab914ebd424be412c18983bdcdc965
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.email = ['matt@amasses.net', 'aidan.samuel@supporterhub.com']
11
11
  s.homepage = ''
12
12
  s.summary = 'Unofficial fork of the Fat Zebra API client - integrate your Ruby app with Fat Zebra'
13
- s.description = 'Unofficial fork. Provides integration with the Fat Zebra internet payment gateway (www.fatzebra.com.au), including purchase, refund, auth, capture and recurring billing functionality.'
13
+ s.description = 'Unofficial fork. Integrate with the Fat Zebra internet payment gateway (www.fatzebra.com.au), including purchase, refund, auth, capture and recurring billing functionality.'
14
14
 
15
15
  s.files = `git ls-files`.split("\n")
16
16
  s.test_files = `git ls-files -- {spec}/*`.split("\n")
@@ -28,6 +28,7 @@ require 'fat_zebra/api_operation/void'
28
28
  require 'fat_zebra/purchase'
29
29
  require 'fat_zebra/information'
30
30
  require 'fat_zebra/card'
31
+ require 'fat_zebra/authorise'
31
32
  require 'fat_zebra/refund'
32
33
  require 'fat_zebra/payment_plan'
33
34
  require 'fat_zebra/customer'
@@ -0,0 +1,49 @@
1
+ module FatZebra
2
+ ##
3
+ # == FatZebra \Authorise
4
+ #
5
+ # Manage 3DS authorisation for the API
6
+ #
7
+ # * token
8
+ # * authorise
9
+ #
10
+ class Authorise < APIResource
11
+ @resource_name = 'authorise'
12
+
13
+ validates :card_number, required: true, on: :authorise
14
+ validates :card_expiry, required: true, on: :authorise
15
+ validates :threeds, required: true, on: :authorise
16
+
17
+ class << self
18
+
19
+ ##
20
+ # Returns a JWT token for the 3DS authorisation process
21
+ #
22
+ # @param [Hash] params
23
+ # @param [Hash] options for the request, and configurations (Optional)
24
+ #
25
+ # @return [FatZebra::Authorise]
26
+ def jwt_token(params = {}, options = {})
27
+ valid!(params, :jwt_token) if respond_to?(:valid!)
28
+
29
+ response = request(:get, "#{resource_path}/jwt_token", params, options)
30
+ initialize_from(response)
31
+ end
32
+
33
+ ##
34
+ # Creates a lookup request to 3DS server
35
+ #
36
+ # @param [Hash] params
37
+ # @param [Hash] options for the request, and configurations (Optional)
38
+ #
39
+ # @return [FatZebra::Authorise]
40
+ def authorise(params = {}, options = {})
41
+ valid!(params, :authorise) if respond_to?(:valid!)
42
+
43
+ response = request(:post, resource_path, params, options)
44
+ initialize_from(response)
45
+ end
46
+ end
47
+
48
+ end
49
+ end
@@ -1,3 +1,3 @@
1
1
  module FatZebra
2
- VERSION = '3.1.0.2'.freeze
2
+ VERSION = '3.2.0.1'.freeze
3
3
  end
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"card_number":"4111111111111111","card_expiry":"09/2020","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
+ ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"d11506cf96cdbb83badc","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"118884994ef0db99f4f5","shipping_address1":"SOME
10
+ ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
+ ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
+ ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104008","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - application/json
18
+ User-Agent:
19
+ - Ruby
20
+ Authorization:
21
+ - Basic VEVTVDpURVNU
22
+ Content-Type:
23
+ - application/json
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Cache-Control:
30
+ - no-store
31
+ Pragma:
32
+ - no-cache
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ X-Request-Version:
36
+ - 1.21.8
37
+ X-Request-Id:
38
+ - 67d00e9d5db8ed66fbbb01dee8150f11
39
+ X-Runtime:
40
+ - '1.262001'
41
+ Transfer-Encoding:
42
+ - chunked
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"successful":true,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"Y","ErrorDesc":null,"ErrorNo":"0","EciFlag":"07","OrderId":"8000143411954523","TransactionId":"KJpHTe72N6ePm5HTxYk0","TransactionType":null,"SignatureVerification":null,"CardBrand":"VISA","CardBin":"411111","DSTransactionId":null,"RawACSUrl":"https://someacsurl.com","ACSUrl":"https://someacsurl.com","StepUpUrl":"https://somestepupurl.com","Cavv":null,"PAResStatus":null,"Payload":"551f6bb1db7ba013570c9d96a1aa","Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":null,"test":true}'
46
+ http_version:
47
+ recorded_at: Mon, 02 Sep 2019 00:40:09 GMT
48
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"card_number":"4111111111111111","card_expiry":"09/2020","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
+ ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"2bcec7c03322c1603ce0","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"eb6932557e2500078ac1","shipping_address1":"SOME
10
+ ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
+ ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
+ ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104009","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - application/json
18
+ User-Agent:
19
+ - Ruby
20
+ Authorization:
21
+ - Basic VEVTVDpURVNU
22
+ Content-Type:
23
+ - application/json
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Cache-Control:
30
+ - no-store
31
+ Pragma:
32
+ - no-cache
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ X-Request-Version:
36
+ - 1.21.8
37
+ X-Request-Id:
38
+ - a31f46e23fa3e98ede0c58f789916eeb
39
+ X-Runtime:
40
+ - '1.011716'
41
+ Transfer-Encoding:
42
+ - chunked
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"successful":true,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"Y","ErrorDesc":null,"ErrorNo":"0","EciFlag":"07","OrderId":"8000087145309035","TransactionId":"p3gebCQ2vbqT7jKzquU0","TransactionType":null,"SignatureVerification":null,"CardBrand":"VISA","CardBin":"411111","DSTransactionId":null,"RawACSUrl":"https://someacsurl.com","ACSUrl":"https://someacsurl.com","StepUpUrl":"https://somestepupurl.com","Cavv":null,"PAResStatus":null,"Payload":"39b8551f6bb1db7ba013570c9d96a1aa","Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":null,"test":true}'
46
+ http_version:
47
+ recorded_at: Mon, 02 Sep 2019 00:40:10 GMT
48
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"card_number":"4000000000001000","card_expiry":"09/2020","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
+ ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"9b078159eefbc57e34fb","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"c2123ed55ff5c2d9e024","shipping_address1":"SOME
10
+ ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
+ ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
+ ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104005","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - application/json
18
+ User-Agent:
19
+ - Ruby
20
+ Authorization:
21
+ - Basic VEVTVDpURVNU
22
+ Content-Type:
23
+ - application/json
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Cache-Control:
30
+ - no-store
31
+ Pragma:
32
+ - no-cache
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ X-Request-Version:
36
+ - 1.21.8
37
+ X-Request-Id:
38
+ - 57648875a0bcbe1d7d5fa04695234c31
39
+ X-Runtime:
40
+ - '1.365493'
41
+ Transfer-Encoding:
42
+ - chunked
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"successful":true,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"Y","ErrorDesc":null,"ErrorNo":"0","EciFlag":"07","OrderId":"8000785369280523","TransactionId":"3UFULPbYKAJtaKXx41S0","TransactionType":null,"SignatureVerification":null,"CardBrand":"VISA","CardBin":"400000","DSTransactionId":null,"RawACSUrl":null,"ACSUrl":null,"StepUpUrl":null,"Cavv":null,"PAResStatus":null,"Payload":null,"Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":null,"test":true}'
46
+ http_version:
47
+ recorded_at: Mon, 02 Sep 2019 00:40:07 GMT
48
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"card_number":"4000000000001000","card_expiry":"09/2020","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
+ ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"e65ac29e83de2dcb6fec","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"0b6724482dfdf72a0dff","shipping_address1":"SOME
10
+ ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
+ ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
+ ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104007","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - application/json
18
+ User-Agent:
19
+ - Ruby
20
+ Authorization:
21
+ - Basic VEVTVDpURVNU
22
+ Content-Type:
23
+ - application/json
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Cache-Control:
30
+ - no-store
31
+ Pragma:
32
+ - no-cache
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ X-Request-Version:
36
+ - 1.21.8
37
+ X-Request-Id:
38
+ - 3e75bd7fc1cc1e64a5373a1909d64c10
39
+ X-Runtime:
40
+ - '1.313599'
41
+ Transfer-Encoding:
42
+ - chunked
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"successful":true,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"Y","ErrorDesc":null,"ErrorNo":"0","EciFlag":"07","OrderId":"8000886189302370","TransactionId":"SJjPCuSo1xgEQmxhWqz0","TransactionType":null,"SignatureVerification":null,"CardBrand":"VISA","CardBin":"400000","DSTransactionId":null,"RawACSUrl":null,"ACSUrl":null,"StepUpUrl":null,"Cavv":null,"PAResStatus":null,"Payload":null,"Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":null,"test":true}'
46
+ http_version:
47
+ recorded_at: Mon, 02 Sep 2019 00:40:08 GMT
48
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"card_number":"5123456789012346","card_expiry":"08/2019","threeds":{"enabled":true,"amount":100,"billing_address1":"SOME
9
+ ADDRESS","billing_city":"Sydney","billing_country_code":"036","billing_first_name":"John","billing_last_name":"Smith","billing_postal_code":"2000","billing_state":"NSW","currency_code":"036","df_reference_id":"ae9c3a1e8a26f09c3312","mobile_phone":"1234567890","email":"dev@fatzebra.com.au","transaction_mode":"mobile","transaction_type":"C","order_number":"7515ae6a2fc575777efa","shipping_address1":"SOME
10
+ ADDRESS","shipping_state":"NSW","shipping_city":"Sydney","shipping_country_code":"036","shipping_address2":"SOME
11
+ ADDRESS","shipping_address3":"SOME ADDRESS","shipping_postal_code":"2000","billing_phone":"1234567890","work_phone":"1234567890","billing_address2":"SOME
12
+ ADDRESS","billing_address3":"SOME ADDRESS","authentication_indicator":"01","product_code":"PHY","installment":2,"purchase_date":"20200902104004","recurring_end":"20200902","recurring_frequency":31},"test":true}'
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - application/json
18
+ User-Agent:
19
+ - Ruby
20
+ Authorization:
21
+ - Basic VEVTVDpURVNU
22
+ Content-Type:
23
+ - application/json
24
+ response:
25
+ status:
26
+ code: 422
27
+ message: Unprocessable Entity
28
+ headers:
29
+ Cache-Control:
30
+ - no-store
31
+ Pragma:
32
+ - no-cache
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ X-Request-Version:
36
+ - 1.21.8
37
+ X-Request-Id:
38
+ - 38c5e6b4a7af7dc35fb8f6608ae52b4c
39
+ X-Runtime:
40
+ - '1.637937'
41
+ Transfer-Encoding:
42
+ - chunked
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"successful":false,"response":{"ThreeDSVersion":"1.0.2","Enrolled":"U","ErrorDesc":"Error
46
+ Validating Credit Card Expiration Information Passed (YYMM)","ErrorNo":"4000","EciFlag":"00","OrderId":"8010307730195369","TransactionId":"EBw7c1ZzTL50yr3JH7S0","TransactionType":null,"SignatureVerification":null,"CardBrand":"MASTERCARD","CardBin":"512345","DSTransactionId":null,"RawACSUrl":null,"ACSUrl":null,"StepUpUrl":null,"Cavv":null,"PAResStatus":null,"Payload":null,"Xid":null,"ReasonCode":null,"ReasonDesc":null,"ChallengeRequired":null,"StatusReason":null,"ACSTransactionId":null,"ThreeDSServerTransactionId":null},"errors":"Error
47
+ Validating Credit Card Expiration Information Passed (YYMM)","test":true}'
48
+ http_version:
49
+ recorded_at: Mon, 02 Sep 2019 00:40:05 GMT
50
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise/jwt_token?amount=100&confirm_url=https://example.com&currency_code=036&order_number=xxxx-xxxx-xxxx&reference_id=xxxx-xxxx-xxxx&test=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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
+ Host:
17
+ - gateway.sandbox.fatzebra.com.au
18
+ Authorization:
19
+ - Basic VEVTVDpURVNU
20
+ Content-Type:
21
+ - application/json
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Cache-Control:
28
+ - no-store
29
+ Pragma:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Request-Version:
34
+ - 1.21.8
35
+ X-Request-Id:
36
+ - ca35fe7e5bb33bf91045771b066e3225
37
+ X-Runtime:
38
+ - '2.541608'
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"successful":true,"response":{"jwt":"eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NjczOTkyMDMsImlhdCI6MTU2NzM4NDgwMywiaXNzIjoiNTgyZTBhMjAzM2ZhZGQxMjYwZjk5MGY2IiwianRpIjoiNzJjYzkzZTktY2I0Ni00NjNiLTllZWMtNWFjYzViMzRlZDk2IiwiT3JnVW5pdElkIjoiNTgyYmU5ZGVkYTUyOTMyYTk0NmM0NWM0IiwiT2JqZWN0aWZ5UGF5bG9hZCI6dHJ1ZSwiUmVmZXJlbmNlSWQiOiJlMTdkMGIxNy1jYTViLTRhYzQtYWE3YS0xN2ZhYzQzMDNiM2IifQ.pslZfApXY1MtDA2OKks9OhkEY_KIFkc-XTrO4Xc7zIg","reference_id":"e17d0b17-ca5b-4ac4-aa7a-17fac4303b3b"},"errors":[],"test":true}'
44
+ http_version:
45
+ recorded_at: Mon, 02 Sep 2019 00:40:03 GMT
46
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise/jwt_token?test=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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
+ Host:
17
+ - gateway.sandbox.fatzebra.com.au
18
+ Authorization:
19
+ - Basic VEVTVDpURVNU
20
+ Content-Type:
21
+ - application/json
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Cache-Control:
28
+ - no-store
29
+ Pragma:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Request-Version:
34
+ - 1.21.8
35
+ X-Request-Id:
36
+ - 2cb2771998d04b67bf479f83c41cad0e
37
+ X-Runtime:
38
+ - '0.045799'
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"successful":true,"response":{"jwt":"eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NjczOTkyMDQsImlhdCI6MTU2NzM4NDgwNCwiaXNzIjoiNTgyZTBhMjAzM2ZhZGQxMjYwZjk5MGY2IiwianRpIjoiNmQzZDcxZTktMGE5YS00OTFlLWJkZmQtYjA5YWVlZDU5ZmY5IiwiT3JnVW5pdElkIjoiNTgyYmU5ZGVkYTUyOTMyYTk0NmM0NWM0IiwiT2JqZWN0aWZ5UGF5bG9hZCI6dHJ1ZSwiUmVmZXJlbmNlSWQiOiJlNjQ2MGFhNy05YjhhLTQ2MTQtOTZiOC02YjdhNzAxMmQxMDEifQ.KjC2WU5UUegB1h56jvGZ7XVU-0EuYE0MVepuwG9H-O8","reference_id":"e6460aa7-9b8a-4614-96b8-6b7a7012d101"},"errors":[],"test":true}'
44
+ http_version:
45
+ recorded_at: Mon, 02 Sep 2019 00:40:04 GMT
46
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/authorise/jwt_token?amount=100&confirm_url=https://example.com&currency_code=036&order_number=xxxx-xxxx-xxxx&test=true
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
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
+ Host:
17
+ - gateway.sandbox.fatzebra.com.au
18
+ Authorization:
19
+ - Basic VEVTVDpURVNU
20
+ Content-Type:
21
+ - application/json
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Cache-Control:
28
+ - no-store
29
+ Pragma:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ X-Request-Version:
34
+ - 1.21.8
35
+ X-Request-Id:
36
+ - baa38892840aad6e85125b672b0f3264
37
+ X-Runtime:
38
+ - '0.265561'
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"successful":true,"response":{"jwt":"eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NjczOTkyMDMsImlhdCI6MTU2NzM4NDgwMywiaXNzIjoiNTgyZTBhMjAzM2ZhZGQxMjYwZjk5MGY2IiwianRpIjoiZDZkMTFjYzItYzJlNS00MDk1LWJhMjktMmY2NDhiNzJjNzU1IiwiT3JnVW5pdElkIjoiNTgyYmU5ZGVkYTUyOTMyYTk0NmM0NWM0IiwiT2JqZWN0aWZ5UGF5bG9hZCI6dHJ1ZSwiUmVmZXJlbmNlSWQiOiJiODg2MDAzZi1lYTJiLTQwMjAtOGVlNC01NjFlYTdjMTI3MzEifQ.w2EKM09LU0lF7iq5luyVbpwXx6p_np3DApXsP5XpTWw","reference_id":"b886003f-ea2b-4020-8ee4-561ea7c12731"},"errors":[],"test":true}'
44
+ http_version:
45
+ recorded_at: Mon, 02 Sep 2019 00:40:03 GMT
46
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,101 @@
1
+ require 'spec_helper'
2
+
3
+ describe FatZebra::Authorise do
4
+
5
+ describe '.jwt_token', :vcr do
6
+ subject(:token) { FatZebra::Authorise.jwt_token(valid_3ds_token_payload) }
7
+
8
+ let(:valid_3ds_token_payload) {{
9
+ reference_id: 'xxxx-xxxx-xxxx',
10
+ confirm_url: 'https://example.com',
11
+ order_number: 'xxxx-xxxx-xxxx',
12
+ currency_code: '036',
13
+ amount: 100
14
+ }}
15
+
16
+ it 'returns JWT with given params' do
17
+ is_expected.to be_accepted
18
+ expect(token.jwt).to be_truthy
19
+ expect(token.reference_id).to be_truthy
20
+ end
21
+
22
+ it 'returns JWT with some params' do
23
+ valid_3ds_token_payload.delete(:reference_id)
24
+ is_expected.to be_accepted
25
+ expect(token.jwt).to be_truthy
26
+ expect(token.reference_id).to be_truthy
27
+ end
28
+
29
+ it 'returns JWT with no params' do
30
+ valid_3ds_token_payload.clear
31
+ is_expected.to be_accepted
32
+ expect(token.jwt).to be_truthy
33
+ expect(token.reference_id).to be_truthy
34
+ end
35
+ end
36
+
37
+ describe '.authorise', :vcr do
38
+ subject(:authorise) { FatZebra::Authorise.authorise(valid_3ds_authorise_payload) }
39
+
40
+ context 'with invalid input' do
41
+ before do
42
+ valid_3ds_authorise_payload[:card_expiry] = DateTime.now.prev_month.strftime('%m/%Y')
43
+ end
44
+
45
+ it do
46
+ is_expected.not_to be_accepted
47
+ expect(authorise.errors).to match(/Error Validating Credit Card Expiration/)
48
+ end
49
+ end
50
+
51
+ context 'with frictionless response' do
52
+ before do
53
+ valid_3ds_authorise_payload[:card_number] = '4000000000001000'
54
+ end
55
+
56
+ it do
57
+ is_expected.to be_accepted
58
+ expect(authorise.keys).to include('Enrolled', 'ACSUrl', 'CardBin', 'TransactionId')
59
+ expect(authorise.errors).not_to be_truthy
60
+ end
61
+
62
+ it do
63
+ expect(authorise.Enrolled).to eq('Y')
64
+ expect(authorise.ACSUrl).not_to be_truthy
65
+ expect(authorise.CardBin).to be_truthy
66
+ expect(authorise.ErrorNo).to eq('0')
67
+ expect(authorise.ErrorDesc).not_to be_truthy
68
+ expect(authorise.CardBrand).to be_truthy
69
+ expect(authorise.TransactionId).to be_truthy
70
+ end
71
+ end
72
+
73
+ context 'with challenge response' do
74
+ before do
75
+ valid_3ds_authorise_payload[:card_number] = '4111111111111111'
76
+ end
77
+
78
+ it do
79
+ is_expected.to be_accepted
80
+ expect(authorise.keys).to include('Enrolled', 'ACSUrl', 'CardBin', 'TransactionId')
81
+ expect(authorise.errors).not_to be_truthy
82
+ end
83
+
84
+ it do
85
+ expect(authorise.Enrolled).to eq('Y')
86
+ expect(authorise.ACSUrl).to be_truthy
87
+ expect(authorise.CardBin).to be_truthy
88
+ expect(authorise.ErrorNo).to eq('0')
89
+ expect(authorise.ErrorDesc).not_to be_truthy
90
+ expect(authorise.CardBrand).to be_truthy
91
+ expect(authorise.TransactionId).to be_truthy
92
+ end
93
+ end
94
+
95
+ context 'validations' do
96
+ let(:valid_3ds_authorise_payload) {{}}
97
+
98
+ it { expect{ authorise }.to raise_error(FatZebra::RequestValidationError) }
99
+ end
100
+ end
101
+ end
@@ -15,6 +15,7 @@ VCR.configure do |config|
15
15
  config.hook_into :webmock
16
16
  config.configure_rspec_metadata!
17
17
  config.allow_http_connections_when_no_cassette = false
18
+ # config.debug_logger = $stdout
18
19
 
19
20
  config.register_request_matcher :uri_ignoring_trailing_id do |*requests|
20
21
  requests.map(&:uri).map { |uri|
@@ -26,9 +27,10 @@ VCR.configure do |config|
26
27
 
27
28
  config.register_request_matcher :fuzzy_body do |*requests|
28
29
  requests.map(&:body).map { |body|
29
- body.gsub /\b\h{32}(-\d)?\b/, 'REFERENCE-NUMBER'
30
+ body.gsub /\b\h{20}\h{12}?(-\d)?\b/, 'REFERENCE-NUMBER'
30
31
  }.map { |body|
31
- body.gsub /\b(19|20)\d\d(-?)(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])\b/, '9999\299\299'
32
+ body.gsub /\b(19|20)\d\d(-?)(0[1-9]|1[012])\2((0[1-9]|[12]\d|3[01])([012]\d([0-5]\d){1,2})?)?\b/, '9999\299\299'
33
+ # yyyyyyyyyy mmmmmmmmmmmmm dddddddddddddddddddd hhhhhhh msmsmsmsmsmsm
32
34
  }.reduce &:==
33
35
  end
34
36
 
@@ -40,4 +40,46 @@ shared_context 'payloads' do
40
40
  }
41
41
  }}
42
42
 
43
+ let(:valid_3ds_authorise_payload) {{
44
+ card_number: '5123456789012346',
45
+ card_expiry: DateTime.now.next_year.strftime('%m/%Y'),
46
+ threeds: {
47
+ enabled: true,
48
+ amount: 100,
49
+ billing_address1: 'SOME ADDRESS',
50
+ billing_city: 'Sydney',
51
+ billing_country_code: '036', # Australia
52
+ billing_first_name: 'John',
53
+ billing_last_name: 'Smith',
54
+ billing_postal_code: '2000',
55
+ billing_state: 'NSW',
56
+ currency_code: '036',
57
+ df_reference_id: SecureRandom.hex(10),
58
+ mobile_phone: '1234567890',
59
+ email: 'dev@fatzebra.com.au',
60
+ transaction_mode: 'mobile',
61
+ transaction_type: 'C',
62
+ order_number: SecureRandom.hex(10),
63
+
64
+ shipping_address1: 'SOME ADDRESS',
65
+ shipping_state: 'NSW',
66
+ shipping_city: 'Sydney',
67
+ shipping_country_code: '036',
68
+ shipping_address2: 'SOME ADDRESS',
69
+ shipping_address3: 'SOME ADDRESS',
70
+ shipping_postal_code: '2000',
71
+ billing_phone: '1234567890',
72
+ work_phone: '1234567890',
73
+ billing_address2: 'SOME ADDRESS',
74
+ billing_address3: 'SOME ADDRESS',
75
+ authentication_indicator: '01',
76
+ product_code: 'PHY',
77
+
78
+ installment: 2,
79
+ purchase_date: DateTime.now.next_year.strftime('%Y%m%d%H%M%S'),
80
+ recurring_end: DateTime.now.next_year.strftime('%Y%m%d'),
81
+ recurring_frequency: 31
82
+ }
83
+ }}
84
+
43
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_zebra_multi
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.2
4
+ version: 3.2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Savage
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-06-04 00:00:00.000000000 Z
12
+ date: 2019-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
@@ -95,9 +95,9 @@ dependencies:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
97
  version: '3.0'
98
- description: Unofficial fork. Provides integration with the Fat Zebra internet payment
99
- gateway (www.fatzebra.com.au), including purchase, refund, auth, capture and recurring
100
- billing functionality.
98
+ description: Unofficial fork. Integrate with the Fat Zebra internet payment gateway
99
+ (www.fatzebra.com.au), including purchase, refund, auth, capture and recurring billing
100
+ functionality.
101
101
  email:
102
102
  - matt@amasses.net
103
103
  - aidan.samuel@supporterhub.com
@@ -121,6 +121,7 @@ files:
121
121
  - lib/fat_zebra/api_operation/search.rb
122
122
  - lib/fat_zebra/api_operation/void.rb
123
123
  - lib/fat_zebra/api_resource.rb
124
+ - lib/fat_zebra/authorise.rb
124
125
  - lib/fat_zebra/bank_account.rb
125
126
  - lib/fat_zebra/batch.rb
126
127
  - lib/fat_zebra/card.rb
@@ -145,6 +146,14 @@ files:
145
146
  - lib/fat_zebra/validation.rb
146
147
  - lib/fat_zebra/version.rb
147
148
  - lib/fat_zebra/web_hook.rb
149
+ - spec/cassettes/FatZebra_Authorise/_authorise/with_challenge_response/1_2_3_1.yml
150
+ - spec/cassettes/FatZebra_Authorise/_authorise/with_challenge_response/1_2_3_2.yml
151
+ - spec/cassettes/FatZebra_Authorise/_authorise/with_frictionless_response/1_2_2_1.yml
152
+ - spec/cassettes/FatZebra_Authorise/_authorise/with_frictionless_response/1_2_2_2.yml
153
+ - spec/cassettes/FatZebra_Authorise/_authorise/with_invalid_input/1_2_1_1.yml
154
+ - spec/cassettes/FatZebra_Authorise/_jwt_token/returns_JWT_with_given_params.yml
155
+ - spec/cassettes/FatZebra_Authorise/_jwt_token/returns_JWT_with_no_params.yml
156
+ - spec/cassettes/FatZebra_Authorise/_jwt_token/returns_JWT_with_some_params.yml
148
157
  - spec/cassettes/FatZebra_BankAccount/_create/1_1_1.yml
149
158
  - spec/cassettes/FatZebra_BankAccount/_create/1_1_2.yml
150
159
  - spec/cassettes/FatZebra_BankAccount/_search/1_2_1.yml
@@ -294,6 +303,7 @@ files:
294
303
  - spec/cassettes/Multiple_accounts/The_basics/1_1_6.yml
295
304
  - spec/fixtures/batch_test.csv
296
305
  - spec/lib/fat_zebra/api_resource_spec.rb
306
+ - spec/lib/fat_zebra/authorise_spec.rb
297
307
  - spec/lib/fat_zebra/bank_account_spec.rb
298
308
  - spec/lib/fat_zebra/batch_spec.rb
299
309
  - spec/lib/fat_zebra/card_spec.rb
@@ -332,7 +342,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
342
  - !ruby/object:Gem::Version
333
343
  version: '0'
334
344
  requirements: []
335
- rubygems_version: 3.0.3
345
+ rubyforge_project:
346
+ rubygems_version: 2.7.6.2
336
347
  signing_key:
337
348
  specification_version: 4
338
349
  summary: Unofficial fork of the Fat Zebra API client - integrate your Ruby app with