From 0ac31ea3d77c3fce15b814d18eab7828d6babea8 Mon Sep 17 00:00:00 2001 From: An Vu Date: Thu, 4 Apr 2024 09:19:05 +1030 Subject: [PATCH 1/4] pass params and options through to domain methods --- lib/fat_zebra/utilities/apple_pay/domain.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/fat_zebra/utilities/apple_pay/domain.rb b/lib/fat_zebra/utilities/apple_pay/domain.rb index ce8685e..97d7c2c 100644 --- a/lib/fat_zebra/utilities/apple_pay/domain.rb +++ b/lib/fat_zebra/utilities/apple_pay/domain.rb @@ -13,8 +13,8 @@ class << self # List Apple Pay (web) domains # # @return [FatZebra::Utilities::ApplePay::Domains] response - def list - response = request(:get, ENDPOINT_URL) + def list(options = {}) + response = request(:get, ENDPOINT_URL, {}, options) initialize_from(response) end @@ -22,8 +22,8 @@ def list # Register an Apple Pay (web) domain # # @return [FatZebra::Utilities::ApplePay::Domains] response - def register!(domain, params = {}) - response = request(:post, path(domain), params) + def register!(domain, params = {}, options = {}) + response = request(:post, path(domain), params, options) initialize_from(response) end @@ -31,8 +31,8 @@ def register!(domain, params = {}) # Check registration status of an Apple Pay (web) domain # # @return [FatZebra::Utilities::ApplePay::Domains] response - def find!(domain) - response = request(:get, path(domain)) + def find!(domain, options = {}) + response = request(:get, path(domain), {}, options) initialize_from(response) end @@ -40,8 +40,8 @@ def find!(domain) # Delete an Apple Pay (web) domain # # @return [FatZebra::Utilities::ApplePay::Domains] response - def delete!(domain) - response = request(:delete, path(domain)) + def delete!(domain, options = {}) + response = request(:delete, path(domain), {}, options) initialize_from(response) end From 80e5cf80e05f406ffa188b44a57ac38158b8612b Mon Sep 17 00:00:00 2001 From: An Vu Date: Thu, 4 Apr 2024 11:48:59 +1030 Subject: [PATCH 2/4] bump version to 3.2.9 --- lib/fat_zebra/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fat_zebra/version.rb b/lib/fat_zebra/version.rb index d40b9ba..e738705 100644 --- a/lib/fat_zebra/version.rb +++ b/lib/fat_zebra/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module FatZebra - VERSION = '3.2.8' + VERSION = '3.2.9' end From a4d46f1b8e71b6f7bc084a00db681d425299863d Mon Sep 17 00:00:00 2001 From: An Vu Date: Thu, 4 Apr 2024 13:31:47 +1030 Subject: [PATCH 3/4] refactor after code review --- lib/fat_zebra/utilities/apple_pay/domain.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/fat_zebra/utilities/apple_pay/domain.rb b/lib/fat_zebra/utilities/apple_pay/domain.rb index 97d7c2c..d394a22 100644 --- a/lib/fat_zebra/utilities/apple_pay/domain.rb +++ b/lib/fat_zebra/utilities/apple_pay/domain.rb @@ -13,8 +13,9 @@ class << self # List Apple Pay (web) domains # # @return [FatZebra::Utilities::ApplePay::Domains] response - def list(options = {}) - response = request(:get, ENDPOINT_URL, {}, options) + def list(options: {}) + params = {} + response = request(:get, ENDPOINT_URL, params, options) initialize_from(response) end @@ -22,7 +23,7 @@ def list(options = {}) # Register an Apple Pay (web) domain # # @return [FatZebra::Utilities::ApplePay::Domains] response - def register!(domain, params = {}, options = {}) + def register!(domain, params = {}, options: {}) response = request(:post, path(domain), params, options) initialize_from(response) end @@ -31,8 +32,9 @@ def register!(domain, params = {}, options = {}) # Check registration status of an Apple Pay (web) domain # # @return [FatZebra::Utilities::ApplePay::Domains] response - def find!(domain, options = {}) - response = request(:get, path(domain), {}, options) + def find!(domain, options: {}) + params = {} + response = request(:get, path(domain), params, options) initialize_from(response) end @@ -40,8 +42,9 @@ def find!(domain, options = {}) # Delete an Apple Pay (web) domain # # @return [FatZebra::Utilities::ApplePay::Domains] response - def delete!(domain, options = {}) - response = request(:delete, path(domain), {}, options) + def delete!(domain, options: {}) + params = {} + response = request(:delete, path(domain), params, options) initialize_from(response) end From 3883c54c7183a306ea5bd1740b3d86e0571b4557 Mon Sep 17 00:00:00 2001 From: An Vu Date: Thu, 4 Apr 2024 13:39:21 +1030 Subject: [PATCH 4/4] document args --- lib/fat_zebra/utilities/apple_pay/domain.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/fat_zebra/utilities/apple_pay/domain.rb b/lib/fat_zebra/utilities/apple_pay/domain.rb index d394a22..d5d74a9 100644 --- a/lib/fat_zebra/utilities/apple_pay/domain.rb +++ b/lib/fat_zebra/utilities/apple_pay/domain.rb @@ -12,6 +12,8 @@ class << self ## # List Apple Pay (web) domains # + # @param [Hash] options for the request, and configurations (Optional) + # # @return [FatZebra::Utilities::ApplePay::Domains] response def list(options: {}) params = {} @@ -22,6 +24,10 @@ def list(options: {}) ## # Register an Apple Pay (web) domain # + # @param [String] domain + # @param [Hash] params + # @param [Hash] options for the request, and configurations (Optional) + # # @return [FatZebra::Utilities::ApplePay::Domains] response def register!(domain, params = {}, options: {}) response = request(:post, path(domain), params, options) @@ -31,6 +37,9 @@ def register!(domain, params = {}, options: {}) ## # Check registration status of an Apple Pay (web) domain # + # @param [String] domain + # @param [Hash] options for the request, and configurations (Optional) + # # @return [FatZebra::Utilities::ApplePay::Domains] response def find!(domain, options: {}) params = {} @@ -41,6 +50,9 @@ def find!(domain, options: {}) ## # Delete an Apple Pay (web) domain # + # @param [String] domain + # @param [Hash] options for the request, and configurations (Optional) + # # @return [FatZebra::Utilities::ApplePay::Domains] response def delete!(domain, options: {}) params = {}