fat_zebra 3.2.6 → 3.2.7

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: ace23c2e07a9ce8da166d78fe441521986143f949a155160c7c97e21455f3ca9
4
- data.tar.gz: 9515304dde5b7cec6f304718406c9191e4a1c32aad45f907c60040a0b413fa3b
3
+ metadata.gz: 491b920591c1b96455bdaf8267c96c0a1fa7ae4470dc9bd728e3ec2004159d62
4
+ data.tar.gz: 9cddd1413bb011093c8543c3c82bb72805384ce576d68ff5049b57bfcaf75889
5
5
  SHA512:
6
- metadata.gz: 6f49354b516cd1093acc086815ff7c9099959cb2a671f16861c794b4b83e19ffb3261a2f09fd77657c622283191df4c7bb5c2eab8f46f04488b35abf6af87649
7
- data.tar.gz: 2dfe966670f924e523aa6347804ff2e9acc17734cd37bdba678b2563306c77f3dde1e7c0737564e231b86a4b33e621afa49e1953996e3f4e4925b8793aef5ac9
6
+ metadata.gz: 0a0b351e5dbfa940924e50f24dd38342e3583f97296c4714ae59ed26e4e252f6628735fec7b8fd2ea06fb7c85f26f9b1dda937b6749eecac81c773f269378b39
7
+ data.tar.gz: 4e41b448bb9987d2633ab1b50e57d0fdfd8be24614be8b300a655bd025fed0c4698272c8da0b81714e50e5d507308f5c26c62ab6ba84f87f2d244c9dec8f67c6
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FatZebra
4
+ module Utilities
5
+ module ApplePay
6
+ class Domain < APIResource
7
+
8
+ ENDPOINT_URL = '/v1.0/utilities/apple_pay/domains'
9
+
10
+ class << self
11
+
12
+ ##
13
+ # Register an Apple Pay (web) domain
14
+ #
15
+ # @return [FatZebra::Utilities::ApplePay::Domains] response
16
+ def register!(domain, params = {})
17
+ response = request(:post, path(domain), params)
18
+ initialize_from(response)
19
+ end
20
+
21
+ ##
22
+ # Check registration status of an Apple Pay (web) domain
23
+ #
24
+ # @return [FatZebra::Utilities::ApplePay::Domains] response
25
+ def find!(domain)
26
+ response = request(:get, path(domain))
27
+ initialize_from(response)
28
+ end
29
+
30
+ ##
31
+ # Delete an Apple Pay (web) domain
32
+ #
33
+ # @return [FatZebra::Utilities::ApplePay::Domains] response
34
+ def delete!(domain)
35
+ response = request(:delete, path(domain))
36
+ initialize_from(response)
37
+ end
38
+
39
+ private
40
+
41
+ def path(domain)
42
+ "#{ENDPOINT_URL}/#{domain}"
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FatZebra
4
- VERSION = '3.2.6'
4
+ VERSION = '3.2.7'
5
+
5
6
  end
data/lib/fat_zebra.rb CHANGED
@@ -42,7 +42,8 @@ require 'fat_zebra/bank_account'
42
42
  require 'fat_zebra/web_hook'
43
43
  require 'fat_zebra/batch'
44
44
 
45
- # Utilities/Mastercard
45
+ # Utilities
46
+ require 'fat_zebra/utilities/apple_pay/domain'
46
47
  require 'fat_zebra/utilities/mastercard/click_to_pay/registration'
47
48
 
48
49
  # Paypal API Resources
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: delete
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/utilities/apple_pay/domains/www.example99.com
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"test":true}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Authorization:
17
+ - Basic VEVTVDpURVNU
18
+ response:
19
+ status:
20
+ code: 202
21
+ message: Accepted
22
+ headers:
23
+ Date:
24
+ - Mon, 04 Mar 2024 01:10:33 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Status:
32
+ - 202 Accepted
33
+ Cache-Control:
34
+ - no-store
35
+ Vary:
36
+ - Accept
37
+ Pragma:
38
+ - no-cache
39
+ X-Request-Id:
40
+ - 3f319fea5d6aa95004cab8f5
41
+ X-Runtime:
42
+ - '0.033681'
43
+ X-Backend:
44
+ - gateway
45
+ Strict-Transport-Security:
46
+ - max-age=31536000; includeSubDomains
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"successful":true,"response":{},"errors":[],"test":true}'
50
+ http_version:
51
+ recorded_at: Mon, 04 Mar 2024 01:10:33 GMT
52
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/utilities/apple_pay/domains/www.example.com?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
+ Date:
28
+ - Mon, 04 Mar 2024 01:10:33 GMT
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Status:
36
+ - 200 OK
37
+ Cache-Control:
38
+ - no-store
39
+ Vary:
40
+ - Accept
41
+ Pragma:
42
+ - no-cache
43
+ X-Request-Id:
44
+ - 5347a0df5e2ebe022d005a3a
45
+ X-Runtime:
46
+ - '0.030516'
47
+ X-Backend:
48
+ - gateway
49
+ Strict-Transport-Security:
50
+ - max-age=31536000; includeSubDomains
51
+ Content-Security-Policy-Report-Only:
52
+ - 'child-src ''self'' blob: *.cardinalcommerce.com fatzebra.statuspage.io; connect-src
53
+ ''self'' *.mastercard.com *.forter.com *.pmnts-staging.io *.rollbar.com *.nr-data.net
54
+ *.cardinalcommerce.com fatzebra.statuspage.io *.googleapis.com *.google-analytics.com;
55
+ default-src ''self'' ''unsafe-eval'' ''unsafe-inline'' *.forter.com *.nr-data.net
56
+ blob: *.pmnts-sandbox.io *.rollbar.com fatzebra.statuspage.io *.iovation.com
57
+ data: *.googleapis.com *.gstatic.com *.newrelic.com *.bootstrapcdn.com www.google.com
58
+ pay.google.com *.google-analytics.com *.gravatar.com; font-src ''self'' cdnjs.cloudflare.com
59
+ data: *.gstatic.com *.bootstrapcdn.com *.aexp-static.com; form-action ''self''
60
+ *.cardinalcommerce.com; frame-ancestors ''self''; frame-src ''self'' fatzebra.statuspage.io
61
+ *.americanexpress.com www.google.com pay.google.com *.masterpass.com *.visa.com
62
+ *.mastercard.com; img-src ''self'' *.visa.com data: *.googleapis.com *.gstatic.com
63
+ masterpass.com *.masterpass.com *.americanexpress.com *.google-analytics.com
64
+ *.gravatar.com; script-src ''self'' ''unsafe-eval'' ''unsafe-inline'' *.forter.com
65
+ *.nr-data.net *.pmnts-sandbox.io *.pmnts-staging.io *.rollbar.com fatzebra.statuspage.io
66
+ cdnjs.cloudflare.com *.iovation.com *.jquery.com *.newrelic.com *.googleapis.com
67
+ *.cardinalcommerce.com *.bootstrapcdn.com wasm-eval *.google-analytics.com
68
+ *.googletagmanager.com; script-src-attr ''unsafe-inline''; script-src-elem
69
+ ''self'' ''unsafe-inline'' *.forter.com *.nr-data.net *.pmnts-sandbox.io *.rollbar.com
70
+ fatzebra.statuspage.io *.iovation.com *.jquery.com cdnjs.cloudflare.com *.pmnts-staging.io
71
+ *.aexp-static.com *.newrelic.com *.googleapis.com *.americanexpress.com www.google.com
72
+ pay.google.com *.visa.com *.masterpass.com *.mastercard.com *.google-analytics.com
73
+ *.gstatic.com *.bootstrapcdn.com; style-src ''self'' ''unsafe-eval'' ''unsafe-inline''
74
+ *.bootstrapcdn.com *.googleapis.com; style-src-attr ''unsafe-inline''; style-src-elem
75
+ ''unsafe-inline'' ''self'' *.googleapis.com cdnjs.cloudflare.com *.bootstrapcdn.com;
76
+ worker-src blob:; report-uri https://fatzebra.report-uri.com/r/d/csp/wizard'
77
+ Nel:
78
+ - '{"report_to":"default","max_age":31536000,"include_subdomains":true}'
79
+ Report-To:
80
+ - '{"group":"default","max_age":31536000,"endpoints":[{"url":"https://fatzebra.report-uri.com/a/d/g"}],"include_subdomains":true}'
81
+ body:
82
+ encoding: UTF-8
83
+ string: '{"successful":true,"response":{"status":"Active","domain":"www.example.com","created_at":"2023-04-14T15:15:45+10:00","updated_at":"2023-04-14T05:15:47+00:00"},"errors":[],"test":true}'
84
+ http_version:
85
+ recorded_at: Mon, 04 Mar 2024 01:10:32 GMT
86
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,84 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://gateway.sandbox.fatzebra.com.au/v1.0/utilities/apple_pay/domains/www.example99.com
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"async":false,"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
+ - Mon, 04 Mar 2024 01:10:32 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
+ Vary:
38
+ - Accept
39
+ Pragma:
40
+ - no-cache
41
+ X-Request-Id:
42
+ - 298c3b404da4ccb5139e44ce
43
+ X-Runtime:
44
+ - '3.097708'
45
+ X-Backend:
46
+ - gateway
47
+ Strict-Transport-Security:
48
+ - max-age=31536000; includeSubDomains
49
+ Content-Security-Policy-Report-Only:
50
+ - 'child-src ''self'' blob: *.cardinalcommerce.com fatzebra.statuspage.io; connect-src
51
+ ''self'' *.mastercard.com *.forter.com *.pmnts-staging.io *.rollbar.com *.nr-data.net
52
+ *.cardinalcommerce.com fatzebra.statuspage.io *.googleapis.com *.google-analytics.com;
53
+ default-src ''self'' ''unsafe-eval'' ''unsafe-inline'' *.forter.com *.nr-data.net
54
+ blob: *.pmnts-sandbox.io *.rollbar.com fatzebra.statuspage.io *.iovation.com
55
+ data: *.googleapis.com *.gstatic.com *.newrelic.com *.bootstrapcdn.com www.google.com
56
+ pay.google.com *.google-analytics.com *.gravatar.com; font-src ''self'' cdnjs.cloudflare.com
57
+ data: *.gstatic.com *.bootstrapcdn.com *.aexp-static.com; form-action ''self''
58
+ *.cardinalcommerce.com; frame-ancestors ''self''; frame-src ''self'' fatzebra.statuspage.io
59
+ *.americanexpress.com www.google.com pay.google.com *.masterpass.com *.visa.com
60
+ *.mastercard.com; img-src ''self'' *.visa.com data: *.googleapis.com *.gstatic.com
61
+ masterpass.com *.masterpass.com *.americanexpress.com *.google-analytics.com
62
+ *.gravatar.com; script-src ''self'' ''unsafe-eval'' ''unsafe-inline'' *.forter.com
63
+ *.nr-data.net *.pmnts-sandbox.io *.pmnts-staging.io *.rollbar.com fatzebra.statuspage.io
64
+ cdnjs.cloudflare.com *.iovation.com *.jquery.com *.newrelic.com *.googleapis.com
65
+ *.cardinalcommerce.com *.bootstrapcdn.com wasm-eval *.google-analytics.com
66
+ *.googletagmanager.com; script-src-attr ''unsafe-inline''; script-src-elem
67
+ ''self'' ''unsafe-inline'' *.forter.com *.nr-data.net *.pmnts-sandbox.io *.rollbar.com
68
+ fatzebra.statuspage.io *.iovation.com *.jquery.com cdnjs.cloudflare.com *.pmnts-staging.io
69
+ *.aexp-static.com *.newrelic.com *.googleapis.com *.americanexpress.com www.google.com
70
+ pay.google.com *.visa.com *.masterpass.com *.mastercard.com *.google-analytics.com
71
+ *.gstatic.com *.bootstrapcdn.com; style-src ''self'' ''unsafe-eval'' ''unsafe-inline''
72
+ *.bootstrapcdn.com *.googleapis.com; style-src-attr ''unsafe-inline''; style-src-elem
73
+ ''unsafe-inline'' ''self'' *.googleapis.com cdnjs.cloudflare.com *.bootstrapcdn.com;
74
+ worker-src blob:; report-uri https://fatzebra.report-uri.com/r/d/csp/wizard'
75
+ Nel:
76
+ - '{"report_to":"default","max_age":31536000,"include_subdomains":true}'
77
+ Report-To:
78
+ - '{"group":"default","max_age":31536000,"endpoints":[{"url":"https://fatzebra.report-uri.com/a/d/g"}],"include_subdomains":true}'
79
+ body:
80
+ encoding: UTF-8
81
+ string: '{"successful":true,"response":{"status":"Active","domain":"www.example99.com","created_at":"2024-03-04T12:10:29+11:00","updated_at":"2024-03-04T01:10:31+00:00"},"errors":[],"test":true}'
82
+ http_version:
83
+ recorded_at: Mon, 04 Mar 2024 01:10:32 GMT
84
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ describe FatZebra::Utilities::ApplePay::Domain do
4
+
5
+ describe '.register!', :vcr do
6
+ subject(:create) { FatZebra::Utilities::ApplePay::Domain.register!(domain, valid_payload) }
7
+
8
+ let!(:domain) { "www.example99.com" }
9
+ let!(:valid_payload) {{
10
+ async: false
11
+ }}
12
+
13
+ it "creates the domain" do
14
+ expect(create).to be_accepted
15
+ expect(create.domain).to eq(domain)
16
+ expect(create.status).to eq("Active")
17
+ end
18
+ end
19
+
20
+ describe '.find!', :vcr do
21
+ subject(:find) { FatZebra::Utilities::ApplePay::Domain.find!(domain) }
22
+ let!(:domain) { "www.example.com" }
23
+
24
+ it "fetches the domain" do
25
+ expect(find).to be_accepted
26
+ expect(find.domain).to eq(domain)
27
+ expect(find.status).to eq("Active")
28
+ end
29
+ end
30
+
31
+ describe '.delete!', :vcr do
32
+ subject(:delete) { FatZebra::Utilities::ApplePay::Domain.delete!(domain) }
33
+ let!(:domain) { "www.example99.com" }
34
+
35
+ it "deletes the domain" do
36
+ expect(delete).to be_accepted
37
+ end
38
+ end
39
+ 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.6
4
+ version: 3.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fat Zebra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-04 00:00:00.000000000 Z
11
+ date: 2024-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -147,6 +147,7 @@ files:
147
147
  - lib/fat_zebra/request/multipart/part.rb
148
148
  - lib/fat_zebra/request/multipart/stream.rb
149
149
  - lib/fat_zebra/util.rb
150
+ - lib/fat_zebra/utilities/apple_pay/domain.rb
150
151
  - lib/fat_zebra/utilities/mastercard/click_to_pay/registration.rb
151
152
  - lib/fat_zebra/validation.rb
152
153
  - lib/fat_zebra/version.rb
@@ -330,6 +331,9 @@ files:
330
331
  - spec/cassettes/FatZebra_Refund/_void/1_4_2.yml
331
332
  - spec/cassettes/FatZebra_Refund/_void/1_4_3.yml
332
333
  - spec/cassettes/FatZebra_Refund/_void/1_4_4.yml
334
+ - spec/cassettes/FatZebra_Utilities_ApplePay_Domain/_delete_/deletes_the_domain.yml
335
+ - spec/cassettes/FatZebra_Utilities_ApplePay_Domain/_find_/fetches_the_domain.yml
336
+ - spec/cassettes/FatZebra_Utilities_ApplePay_Domain/_register_/creates_the_domain.yml
333
337
  - spec/cassettes/FatZebra_WebHook/_create/1_1_1.yml
334
338
  - spec/cassettes/FatZebra_WebHook/_create/1_1_2.yml
335
339
  - spec/cassettes/FatZebra_WebHook/_create/1_1_3.yml
@@ -360,6 +364,7 @@ files:
360
364
  - spec/lib/fat_zebra/refund_spec.rb
361
365
  - spec/lib/fat_zebra/request_spec.rb
362
366
  - spec/lib/fat_zebra/util_spec.rb
367
+ - spec/lib/fat_zebra/utilities/apple_pay/domain_spec.rb
363
368
  - spec/lib/fat_zebra/validation_spec.rb
364
369
  - spec/lib/fat_zebra/web_hook_spec.rb
365
370
  - spec/spec_helper.rb