diff --git a/test/square/integration/client_tests/test_cash_drawers.rb b/test/square/integration/client_tests/test_cash_drawers.rb index 2cfd0a4c..4acf25dd 100644 --- a/test/square/integration/client_tests/test_cash_drawers.rb +++ b/test/square/integration/client_tests/test_cash_drawers.rb @@ -17,7 +17,7 @@ puts "request #{_request.to_h}" if verbose? - response = client.cash_drawers.shifts.list(request: _request.to_h) + response = client.cash_drawers.shifts.list(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::ListCashDrawerShiftsResponse diff --git a/test/square/integration/client_tests/test_catalog.rb b/test/square/integration/client_tests/test_catalog.rb index 611604aa..dbbaf560 100644 --- a/test/square/integration/client_tests/test_catalog.rb +++ b/test/square/integration/client_tests/test_catalog.rb @@ -29,7 +29,7 @@ def delete_all_catalog_objects(client) _batch_delete_request = Square::Catalog::Types::BatchDeleteCatalogObjectsRequest.new( object_ids: object_ids ) - client.catalog.batch_delete(request: _batch_delete_request.to_h) + client.catalog.batch_delete(**_batch_delete_request.to_h) end def create_test_catalog_item(name: "Test Item #{SecureRandom.uuid}", description: "Test Description", abbreviation: "TI", price: 100, variation_name: "Regular") @@ -138,7 +138,7 @@ def get_test_file puts "request #{_request.to_h}" if verbose? - response = client.catalog.batch_upsert(request: _request.to_h) + response = client.catalog.batch_upsert(**_request.to_h) refute_nil response puts "response #{response.to_h}" if verbose? @@ -193,7 +193,7 @@ def get_test_file puts "request #{_request.to_h}" if verbose? - response = client.catalog.batch_upsert(request: _request.to_h) + response = client.catalog.batch_upsert(**_request.to_h) assert response assert_equal 2, response.objects.length @@ -236,7 +236,7 @@ def get_test_file puts "request #{_request.to_h}" if verbose? # Create the catalog objects in a bulk request - create_catalog_objects_resp = client.catalog.batch_upsert(request: _request.to_h) + create_catalog_objects_resp = client.catalog.batch_upsert(**_request.to_h) assert_equal 200, create_catalog_objects_resp.objects.length assert_equal create_catalog_objects_resp.class, Square::Types::BatchUpsertCatalogObjectsResponse sleep(2) # Wait after bulk creation @@ -305,7 +305,7 @@ def get_test_file puts "create_catalog_request #{_create_request.keys}" if verbose? - create_catalog_resp = client.catalog.batch_upsert(request: _create_request.to_h) + create_catalog_resp = client.catalog.batch_upsert(**_create_request.to_h) puts 'Catalog object created' if verbose? assert_equal 1, create_catalog_resp.objects.length @@ -338,7 +338,7 @@ def get_test_file puts "image_upload_request #{_image_request[:request].to_h}" if verbose? - create_catalog_image_resp = client.catalog.images.create(request: _image_request.to_h) + create_catalog_image_resp = client.catalog.images.create(**_image_request.to_h) puts 'Image uploaded successfully' if verbose? assert create_catalog_image_resp.image @@ -353,7 +353,7 @@ def get_test_file _batch_delete_request = Square::Catalog::Types::BatchDeleteCatalogObjectsRequest.new( object_ids: [created_catalog_object.id, create_catalog_image_resp.image.id] ) - _batch_delete_resp = client.catalog.batch_delete(request: _batch_delete_request.to_h) + _batch_delete_resp = client.catalog.batch_delete(**_batch_delete_request.to_h) refute_nil _batch_delete_resp assert_equal _batch_delete_resp.class, Square::Types::BatchDeleteCatalogObjectsResponse @@ -409,7 +409,7 @@ def get_test_file limit: 1 ) - response = client.catalog.search(request: _request.to_h) + response = client.catalog.search(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::SearchCatalogObjectsResponse @@ -445,7 +445,7 @@ def get_test_file puts "request #{_request.to_h}" if verbose? - response = client.catalog.batch_get(request: _request.to_h) + response = client.catalog.batch_get(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::BatchRetrieveCatalogObjectsResponse @@ -479,7 +479,7 @@ def get_test_file puts "request #{_request.to_h}" if verbose? - response = client.catalog.update_item_taxes(request: _request.to_h) + response = client.catalog.update_item_taxes(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::UpdateItemTaxesResponse @@ -517,7 +517,7 @@ def get_test_file puts "request #{_request.to_h}" if verbose? - response = client.catalog.update_item_modifier_lists(request: _request.to_h) + response = client.catalog.update_item_modifier_lists(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::UpdateItemModifierListsResponse @@ -569,7 +569,7 @@ def get_test_file puts "request #{_request.to_h}" if verbose? - response = client.catalog.object.upsert(request: _request.to_h) + response = client.catalog.object.upsert(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::UpsertCatalogObjectResponse refute_nil response.catalog_object @@ -596,7 +596,7 @@ def get_test_file puts "request #{_request.to_h}" if verbose? - response = client.catalog.object.upsert(request: _request.to_h) + response = client.catalog.object.upsert(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::UpsertCatalogObjectResponse refute_nil response.catalog_object @@ -629,7 +629,7 @@ def get_test_file puts "create_request #{_create_request.keys}" if verbose? - create_resp = client.catalog.object.upsert(request: _create_request.to_h) + create_resp = client.catalog.object.upsert(**_create_request.to_h) sleep(2) # Wait before retrieve diff --git a/test/square/integration/client_tests/test_customers.rb b/test/square/integration/client_tests/test_customers.rb index 1eb37bf8..3dcd30dd 100644 --- a/test/square/integration/client_tests/test_customers.rb +++ b/test/square/integration/client_tests/test_customers.rb @@ -25,7 +25,7 @@ puts "create customer request #{_create_request.to_h}" if verbose? - response = client.customers.create(request: _create_request.to_h) + response = client.customers.create(**_create_request.to_h) refute_nil response assert_equal response.class, Square::Types::CreateCustomerResponse refute_nil response.customer.id @@ -39,7 +39,7 @@ puts "delete customer request #{_delete_request.to_h}" if verbose? - response = client.customers.delete(request: _delete_request.to_h) + response = client.customers.delete(**_delete_request.to_h) refute_nil response assert_equal response.class, Square::Types::DeleteCustomerResponse assert_nil response.errors diff --git a/test/square/integration/client_tests/test_customers_groups.rb b/test/square/integration/client_tests/test_customers_groups.rb index f429a61b..2520a6ec 100644 --- a/test/square/integration/client_tests/test_customers_groups.rb +++ b/test/square/integration/client_tests/test_customers_groups.rb @@ -10,7 +10,7 @@ def create_test_customer_group name: "Default-#{SecureRandom.uuid}" } ) - _create_resp = client.customers.groups.create(request: _create_request.to_h) + _create_resp = client.customers.groups.create(**_create_request.to_h) refute_nil _create_resp assert_equal _create_resp.class, Square::Types::CreateCustomerGroupResponse refute_nil _create_resp.group @@ -20,7 +20,7 @@ def delete_test_customer_group(group_id) _delete_request = Square::Customers::Groups::Types::DeleteGroupsRequest.new( group_id: group_id ) - _delete_resp = client.customers.groups.delete(request: _delete_request.to_h) + _delete_resp = client.customers.groups.delete(**_delete_request.to_h) refute_nil _delete_resp assert_equal _delete_resp.class, Square::Types::DeleteCustomerGroupResponse end @@ -146,7 +146,7 @@ def delete_test_customer_group(group_id) puts "request #{_request.to_h}" if verbose? assert_raises(Square::SquareError) do - client.customers.groups.create(request: _request.to_h) + client.customers.groups.create(**_request.to_h) end end end diff --git a/test/square/integration/client_tests/test_customers_segments.rb b/test/square/integration/client_tests/test_customers_segments.rb index 84495c29..dd72e8b8 100644 --- a/test/square/integration/client_tests/test_customers_segments.rb +++ b/test/square/integration/client_tests/test_customers_segments.rb @@ -26,7 +26,7 @@ segment_id: segment_id ) - response = client.customers.segments.get(request: _request.to_h) + response = client.customers.segments.get(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::GetCustomerSegmentResponse refute_nil response.segment diff --git a/test/square/integration/client_tests/test_devices.rb b/test/square/integration/client_tests/test_devices.rb index 07702e6c..9882ada4 100644 --- a/test/square/integration/client_tests/test_devices.rb +++ b/test/square/integration/client_tests/test_devices.rb @@ -11,7 +11,7 @@ product_type: "TERMINAL_API" ) ) - create_response = client.devices.codes.create(request: _create_request.to_h) + create_response = client.devices.codes.create(**_create_request.to_h) @device_code_id = create_response.device_code.id end @@ -41,7 +41,7 @@ puts "request #{_request.to_h}" if verbose? - response = client.devices.codes.create(request: _request.to_h) + response = client.devices.codes.create(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::CreateDeviceCodeResponse refute_nil response.device_code @@ -58,7 +58,7 @@ id: @device_code_id ) - response = client.devices.codes.get(request: _request.to_h) + response = client.devices.codes.get(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::GetDeviceCodeResponse refute_nil response.device_code diff --git a/test/square/integration/client_tests/test_inventory.rb b/test/square/integration/client_tests/test_inventory.rb index f9c319c0..3a3f82fa 100644 --- a/test/square/integration/client_tests/test_inventory.rb +++ b/test/square/integration/client_tests/test_inventory.rb @@ -20,7 +20,7 @@ puts "request #{_request.to_h}" if verbose? - response = client.inventory.batch_get_changes(request: _request.to_h) + response = client.inventory.batch_get_changes(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::BatchGetInventoryChangesResponse refute_nil response.changes diff --git a/test/square/integration/client_tests/test_merchants.rb b/test/square/integration/client_tests/test_merchants.rb index 89fe6485..10d6d5b3 100644 --- a/test/square/integration/client_tests/test_merchants.rb +++ b/test/square/integration/client_tests/test_merchants.rb @@ -31,7 +31,7 @@ merchant_id: @merchant_id ) - response = client.merchants.get(request: _request.to_h) + response = client.merchants.get(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::GetMerchantResponse refute_nil response.merchant diff --git a/test/square/integration/client_tests/test_mobile.rb b/test/square/integration/client_tests/test_mobile.rb index 3dd24bf3..f870f284 100644 --- a/test/square/integration/client_tests/test_mobile.rb +++ b/test/square/integration/client_tests/test_mobile.rb @@ -10,7 +10,7 @@ location_id: client.locations.list.locations.first.id ) - response = client.mobile.authorization_code(request: _request.to_h) + response = client.mobile.authorization_code(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::AuthorizationCodeResponse refute_nil response.authorization_code diff --git a/test/square/integration/client_tests/test_orders.rb b/test/square/integration/client_tests/test_orders.rb index 802b05bb..7e68e844 100644 --- a/test/square/integration/client_tests/test_orders.rb +++ b/test/square/integration/client_tests/test_orders.rb @@ -24,7 +24,7 @@ ) ) # Create initial order for testing - order_response = client.orders.create(request: _create_request.to_h) + order_response = client.orders.create(**_create_request.to_h) refute_nil order_response assert_equal order_response.class, Square::Types::CreateOrderResponse refute_nil order_response.order @@ -57,7 +57,7 @@ puts "request #{_request.to_h}" if verbose? - response = client.orders.create(request: _request.to_h) + response = client.orders.create(**_request.to_h) refute_nil response.order assert_equal response.class, Square::Types::CreateOrderResponse assert_equal @location_id, response.order.location_id @@ -74,7 +74,7 @@ order_ids: [@order_id] ) - response = client.orders.batch_get(request: _request.to_h) + response = client.orders.batch_get(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::BatchGetOrdersResponse refute_nil response.orders @@ -92,7 +92,7 @@ location_ids: [@location_id] ) - response = client.orders.search(request: _request.to_h) + response = client.orders.search(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::SearchOrdersResponse refute_nil response.orders @@ -126,7 +126,7 @@ fields_to_clear: ["line_items[#{@line_item_uid}]"] ) - response = client.orders.update(request: _request.to_h) + response = client.orders.update(**_request.to_h) refute_nil response.order assert_equal @order_id, response.order.id assert_equal "Updated Item", response.order.line_items.first.name @@ -145,7 +145,7 @@ payment_ids: [] ) - response = client.orders.pay(request: _request.to_h) + response = client.orders.pay(**_request.to_h) refute_nil response.order assert_equal @order_id, response.order.id @@ -172,7 +172,7 @@ ) ) - response = client.orders.calculate(request: _request.to_h) + response = client.orders.calculate(**_request.to_h) refute_nil response.order refute_nil response.order.total_money assert_equal response.class, Square::Types::CalculateOrderResponse diff --git a/test/square/integration/client_tests/test_payments.rb b/test/square/integration/client_tests/test_payments.rb index 3a28a2f0..14535338 100644 --- a/test/square/integration/client_tests/test_payments.rb +++ b/test/square/integration/client_tests/test_payments.rb @@ -14,7 +14,7 @@ currency: "USD" ), ) - payment_response = client.payments.create(request: _create_request.to_h) + payment_response = client.payments.create(**_create_request.to_h) refute_nil payment_response assert_equal payment_response.class, Square::Types::CreatePaymentResponse refute_nil payment_response.payment @@ -57,7 +57,7 @@ autocomplete: true ) - response = client.payments.create(request: _request.to_h) + response = client.payments.create(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::CreatePaymentResponse refute_nil response.payment @@ -77,7 +77,7 @@ payment_id: @payment_id ) - response = client.payments.get(request: _request.to_h) + response = client.payments.get(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::GetPaymentResponse refute_nil response.payment @@ -94,7 +94,7 @@ payment_id: @payment_id ) - response = client.payments.cancel(request: _request.to_h) + response = client.payments.cancel(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::CancelPaymentResponse refute_nil response.payment @@ -159,13 +159,13 @@ ), autocomplete: false ) - create_response = client.payments.create(request: _create_request.to_h) + create_response = client.payments.create(**_create_request.to_h) _request = Square::Payments::Types::CompletePaymentRequest.new( payment_id: create_response.payment.id ) - response = client.payments.complete(request: _request.to_h) + response = client.payments.complete(**_request.to_h) refute_nil response.payment assert_equal "COMPLETED", response.payment.status diff --git a/test/square/integration/client_tests/test_refunds.rb b/test/square/integration/client_tests/test_refunds.rb index 837c3d87..d0caad1c 100644 --- a/test/square/integration/client_tests/test_refunds.rb +++ b/test/square/integration/client_tests/test_refunds.rb @@ -14,7 +14,7 @@ currency: "USD" ) ) - payment_response = client.payments.create(request: _create_request.to_h) + payment_response = client.payments.create(**_create_request.to_h) refute_nil payment_response assert_equal payment_response.class, Square::Types::CreatePaymentResponse refute_nil payment_response.payment @@ -24,7 +24,7 @@ @payment_id = payment_response.payment.id # Create initial refund for testing - refund_response = client.refunds.refund_payment(request: _refund_request.to_h) + refund_response = client.refunds.refund_payment(**_refund_request.to_h) refute_nil refund_response assert_equal refund_response.class, Square::Types::RefundPaymentResponse refute_nil refund_response.refund @@ -66,7 +66,7 @@ ), autocomplete: true ) - payment_response = client.payments.create(request: _create_request.to_h) + payment_response = client.payments.create(**_create_request.to_h) refute_nil payment_response assert_equal payment_response.class, Square::Types::CreatePaymentResponse refute_nil payment_response.payment @@ -84,7 +84,7 @@ ) ) - response = client.refunds.refund_payment(request: _refund_request.to_h) + response = client.refunds.refund_payment(**_refund_request.to_h) refute_nil response assert_equal response.class, Square::Types::RefundPaymentResponse refute_nil response.refund @@ -105,7 +105,7 @@ puts "request #{_request.to_h}" if verbose? - response = client.refunds.get(request: _request.to_h) + response = client.refunds.get(**_request.to_h) refute_nil response.refund assert_equal response.class, Square::Types::GetRefundResponse assert_equal @refund_id, response.refund.id @@ -125,7 +125,7 @@ puts "request #{_request.to_h}" if verbose? assert_raises(Square::SquareError) do - client.refunds.get(request: _request.to_h) + client.refunds.get(**_request.to_h) end end end diff --git a/test/square/integration/client_tests/test_team_members.rb b/test/square/integration/client_tests/test_team_members.rb index 760e2f53..e7d6891a 100644 --- a/test/square/integration/client_tests/test_team_members.rb +++ b/test/square/integration/client_tests/test_team_members.rb @@ -41,7 +41,7 @@ def create_test_team_member(location_ids) puts "create_request #{_create_request.to_h}" if verbose? - create_members_resp = client.team_members.batch_create(request: _create_request.to_h) + create_members_resp = client.team_members.batch_create(**_create_request.to_h) refute_nil create_members_resp.team_members assert_equal create_members_resp.class, Square::Types::BatchCreateTeamMembersResponse @@ -74,7 +74,7 @@ def create_test_team_member(location_ids) puts "update_request #{_update_request.to_h}" if verbose? - update_team_members_resp = client.team_members.batch_update(request: _update_request.to_h) + update_team_members_resp = client.team_members.batch_update(**_update_request.to_h) refute_nil update_team_members_resp assert_equal update_team_members_resp.class, Square::Types::BatchUpdateTeamMembersResponse diff --git a/test/square/integration/client_tests/test_terminal.rb b/test/square/integration/client_tests/test_terminal.rb index 43e60ab6..c052a403 100644 --- a/test/square/integration/client_tests/test_terminal.rb +++ b/test/square/integration/client_tests/test_terminal.rb @@ -20,7 +20,7 @@ ) ) ) - checkout_response = client.terminal.checkouts.create(request: _create_response.to_h) + checkout_response = client.terminal.checkouts.create(**_create_response.to_h) refute_nil checkout_response assert_equal checkout_response.class, Square::Types::CreateTerminalCheckoutResponse @checkout_id = checkout_response.checkout.id @@ -44,7 +44,7 @@ puts "request #{_request.to_h}" if verbose? - response = client.terminal.checkouts.create(request: _request.to_h) + response = client.terminal.checkouts.create(**_request.to_h) refute_nil response.checkout assert_equal @sandbox_device_id, response.checkout.device_options.device_id assert_equal 100, response.checkout.amount_money.amount @@ -62,7 +62,7 @@ puts "request #{_request.to_h}" if verbose? - response = client.terminal.checkouts.search(request: _request.to_h) + response = client.terminal.checkouts.search(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::SearchTerminalCheckoutsResponse refute_nil response.checkouts @@ -81,7 +81,7 @@ puts "request #{_request.to_h}" if verbose? - response = client.terminal.checkouts.get(request: _request.to_h) + response = client.terminal.checkouts.get(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::GetTerminalCheckoutResponse refute_nil response.checkout @@ -100,7 +100,7 @@ puts "request #{_request.to_h}" if verbose? - response = client.terminal.checkouts.cancel(request: _request.to_h) + response = client.terminal.checkouts.cancel(**_request.to_h) refute_nil response assert_equal response.class, Square::Types::CancelTerminalCheckoutResponse refute_nil response.checkout