square.rb 44.0.0.20250820 → 44.0.1.20250820
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 +4 -4
- data/README.md +62 -9
- data/lib/square/apple_pay/client.rb +12 -6
- data/lib/square/bank_accounts/client.rb +40 -19
- data/lib/square/bookings/client.rb +124 -62
- data/lib/square/bookings/custom_attribute_definitions/client.rb +68 -32
- data/lib/square/bookings/custom_attributes/client.rb +80 -38
- data/lib/square/bookings/location_profiles/client.rb +16 -7
- data/lib/square/bookings/team_member_profiles/client.rb +28 -13
- data/lib/square/cards/client.rb +53 -24
- data/lib/square/cash_drawers/shifts/client.rb +48 -21
- data/lib/square/catalog/client.rb +112 -55
- data/lib/square/catalog/images/client.rb +22 -10
- data/lib/square/catalog/object/client.rb +40 -19
- data/lib/square/catalog/object/types/delete_object_request.rb +1 -1
- data/lib/square/catalog/object/types/get_object_request.rb +1 -1
- data/lib/square/checkout/client.rb +48 -24
- data/lib/square/checkout/payment_links/client.rb +64 -31
- data/lib/square/client.rb +1 -1
- data/lib/square/customers/cards/client.rb +24 -12
- data/lib/square/customers/client.rb +128 -62
- data/lib/square/customers/custom_attribute_definitions/client.rb +80 -38
- data/lib/square/customers/custom_attributes/client.rb +56 -26
- data/lib/square/customers/groups/client.rb +88 -43
- data/lib/square/customers/segments/client.rb +28 -13
- data/lib/square/devices/client.rb +28 -13
- data/lib/square/devices/codes/client.rb +40 -19
- data/lib/square/disputes/client.rb +75 -36
- data/lib/square/disputes/evidence/client.rb +40 -19
- data/lib/square/employees/client.rb +28 -13
- data/lib/square/errors/api_error.rb +8 -0
- data/lib/square/errors/client_error.rb +17 -0
- data/lib/square/errors/redirect_error.rb +8 -0
- data/lib/square/errors/response_error.rb +42 -0
- data/lib/square/errors/server_error.rb +11 -0
- data/lib/square/errors/timeout_error.rb +8 -0
- data/lib/square/events/client.rb +52 -25
- data/lib/square/gift_cards/activities/client.rb +28 -14
- data/lib/square/gift_cards/client.rb +88 -43
- data/lib/square/inventory/client.rb +164 -80
- data/lib/square/invoices/client.rb +127 -61
- data/lib/square/labor/break_types/client.rb +64 -31
- data/lib/square/labor/client.rb +132 -66
- data/lib/square/labor/employee_wages/client.rb +28 -13
- data/lib/square/labor/shifts/client.rb +60 -30
- data/lib/square/labor/team_member_wages/client.rb +28 -13
- data/lib/square/labor/workweek_configs/client.rb +28 -13
- data/lib/square/locations/client.rb +60 -30
- data/lib/square/locations/custom_attribute_definitions/client.rb +68 -32
- data/lib/square/locations/custom_attributes/client.rb +80 -38
- data/lib/square/locations/transactions/client.rb +52 -25
- data/lib/square/loyalty/accounts/client.rb +60 -30
- data/lib/square/loyalty/client.rb +12 -6
- data/lib/square/loyalty/programs/client.rb +36 -18
- data/lib/square/loyalty/programs/promotions/client.rb +52 -25
- data/lib/square/loyalty/rewards/client.rb +60 -30
- data/lib/square/merchants/client.rb +28 -13
- data/lib/square/merchants/custom_attribute_definitions/client.rb +68 -32
- data/lib/square/merchants/custom_attributes/client.rb +80 -38
- data/lib/square/mobile/client.rb +12 -6
- data/lib/square/o_auth/client.rb +46 -22
- data/lib/square/orders/client.rb +98 -46
- data/lib/square/orders/custom_attribute_definitions/client.rb +68 -32
- data/lib/square/orders/custom_attributes/client.rb +80 -38
- data/lib/square/payments/client.rb +90 -44
- data/lib/square/payouts/client.rb +44 -20
- data/lib/square/refunds/client.rb +42 -20
- data/lib/square/sites/client.rb +12 -6
- data/lib/square/snippets/client.rb +36 -18
- data/lib/square/subscriptions/client.rb +153 -73
- data/lib/square/team/client.rb +53 -24
- data/lib/square/team_members/client.rb +72 -36
- data/lib/square/team_members/wage_setting/client.rb +24 -12
- data/lib/square/terminal/actions/client.rb +48 -24
- data/lib/square/terminal/checkouts/client.rb +48 -24
- data/lib/square/terminal/client.rb +36 -18
- data/lib/square/terminal/refunds/client.rb +48 -24
- data/lib/square/types/action_cancel_reason.rb +2 -1
- data/lib/square/types/activity_type.rb +2 -1
- data/lib/square/types/application_details_external_square_product.rb +2 -1
- data/lib/square/types/archived_state.rb +2 -1
- data/lib/square/types/bank_account_status.rb +2 -1
- data/lib/square/types/bank_account_type.rb +2 -1
- data/lib/square/types/booking_booking_source.rb +2 -1
- data/lib/square/types/booking_creator_details_creator_type.rb +2 -1
- data/lib/square/types/booking_status.rb +2 -1
- data/lib/square/types/business_appointment_settings_alignment_time.rb +2 -1
- data/lib/square/types/business_appointment_settings_booking_location_type.rb +2 -1
- data/lib/square/types/business_appointment_settings_cancellation_policy.rb +2 -1
- data/lib/square/types/business_appointment_settings_max_appointments_per_day_limit_type.rb +2 -1
- data/lib/square/types/business_booking_profile_booking_policy.rb +2 -1
- data/lib/square/types/business_booking_profile_customer_timezone_choice.rb +2 -1
- data/lib/square/types/card_brand.rb +2 -1
- data/lib/square/types/card_co_brand.rb +2 -1
- data/lib/square/types/card_prepaid_type.rb +2 -1
- data/lib/square/types/card_type.rb +2 -1
- data/lib/square/types/cash_drawer_event_type.rb +2 -1
- data/lib/square/types/cash_drawer_shift_state.rb +2 -1
- data/lib/square/types/catalog_category_type.rb +2 -1
- data/lib/square/types/catalog_custom_attribute_definition_app_visibility.rb +2 -1
- data/lib/square/types/catalog_custom_attribute_definition_seller_visibility.rb +2 -1
- data/lib/square/types/catalog_custom_attribute_definition_type.rb +2 -1
- data/lib/square/types/catalog_discount_modify_tax_basis.rb +2 -1
- data/lib/square/types/catalog_discount_type.rb +2 -1
- data/lib/square/types/catalog_id_mapping.rb +1 -1
- data/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_standard_dietary_preference.rb +2 -1
- data/lib/square/types/catalog_item_food_and_beverage_details_dietary_preference_type.rb +2 -1
- data/lib/square/types/catalog_item_food_and_beverage_details_ingredient_standard_ingredient.rb +2 -1
- data/lib/square/types/catalog_item_product_type.rb +2 -1
- data/lib/square/types/catalog_modifier_list_modifier_type.rb +2 -1
- data/lib/square/types/catalog_modifier_list_selection_type.rb +2 -1
- data/lib/square/types/catalog_object_reference.rb +1 -1
- data/lib/square/types/catalog_object_type.rb +2 -1
- data/lib/square/types/catalog_pricing_type.rb +2 -1
- data/lib/square/types/catalog_quick_amount_type.rb +2 -1
- data/lib/square/types/catalog_quick_amounts_settings_option.rb +2 -1
- data/lib/square/types/change_timing.rb +2 -1
- data/lib/square/types/checkout_location_settings_branding_button_shape.rb +2 -1
- data/lib/square/types/checkout_location_settings_branding_header_type.rb +2 -1
- data/lib/square/types/checkout_options_payment_type.rb +2 -1
- data/lib/square/types/component_component_type.rb +2 -1
- data/lib/square/types/country.rb +2 -1
- data/lib/square/types/create_catalog_image_request.rb +1 -1
- data/lib/square/types/currency.rb +2 -1
- data/lib/square/types/custom_attribute_definition_visibility.rb +2 -1
- data/lib/square/types/customer_creation_source.rb +2 -1
- data/lib/square/types/customer_inclusion_exclusion.rb +2 -1
- data/lib/square/types/customer_sort_field.rb +2 -1
- data/lib/square/types/data_collection_options_input_type.rb +2 -1
- data/lib/square/types/day_of_week.rb +2 -1
- data/lib/square/types/destination_type.rb +2 -1
- data/lib/square/types/device_code_status.rb +2 -1
- data/lib/square/types/device_component_details_external_power.rb +2 -1
- data/lib/square/types/device_status_category.rb +2 -1
- data/lib/square/types/dispute_evidence_type.rb +2 -1
- data/lib/square/types/dispute_reason.rb +2 -1
- data/lib/square/types/dispute_state.rb +2 -1
- data/lib/square/types/ecom_visibility.rb +2 -1
- data/lib/square/types/employee_status.rb +2 -1
- data/lib/square/types/error_category.rb +2 -1
- data/lib/square/types/error_code.rb +2 -1
- data/lib/square/types/exclude_strategy.rb +2 -1
- data/lib/square/types/fulfillment_delivery_details_order_fulfillment_delivery_details_schedule_type.rb +2 -1
- data/lib/square/types/fulfillment_fulfillment_line_item_application.rb +2 -1
- data/lib/square/types/fulfillment_pickup_details_schedule_type.rb +2 -1
- data/lib/square/types/fulfillment_state.rb +2 -1
- data/lib/square/types/fulfillment_type.rb +2 -1
- data/lib/square/types/gift_card_activity_adjust_decrement_reason.rb +2 -1
- data/lib/square/types/gift_card_activity_adjust_increment_reason.rb +2 -1
- data/lib/square/types/gift_card_activity_clear_balance_reason.rb +2 -1
- data/lib/square/types/gift_card_activity_deactivate_reason.rb +2 -1
- data/lib/square/types/gift_card_activity_redeem_status.rb +2 -1
- data/lib/square/types/gift_card_activity_type.rb +2 -1
- data/lib/square/types/gift_card_gan_source.rb +2 -1
- data/lib/square/types/gift_card_status.rb +2 -1
- data/lib/square/types/gift_card_type.rb +2 -1
- data/lib/square/types/inventory_alert_type.rb +2 -1
- data/lib/square/types/inventory_change_type.rb +2 -1
- data/lib/square/types/inventory_state.rb +2 -1
- data/lib/square/types/invoice_attachment.rb +1 -1
- data/lib/square/types/invoice_automatic_payment_source.rb +2 -1
- data/lib/square/types/invoice_custom_field_placement.rb +2 -1
- data/lib/square/types/invoice_delivery_method.rb +2 -1
- data/lib/square/types/invoice_payment_reminder_status.rb +2 -1
- data/lib/square/types/invoice_request_method.rb +2 -1
- data/lib/square/types/invoice_request_type.rb +2 -1
- data/lib/square/types/invoice_status.rb +2 -1
- data/lib/square/types/job_assignment_pay_type.rb +2 -1
- data/lib/square/types/list_payment_refunds_request_sort_field.rb +2 -1
- data/lib/square/types/list_payments_request_sort_field.rb +2 -1
- data/lib/square/types/location_capability.rb +2 -1
- data/lib/square/types/location_status.rb +2 -1
- data/lib/square/types/location_type.rb +2 -1
- data/lib/square/types/loyalty_event_source.rb +2 -1
- data/lib/square/types/loyalty_event_type.rb +2 -1
- data/lib/square/types/loyalty_program_accrual_rule_tax_mode.rb +2 -1
- data/lib/square/types/loyalty_program_accrual_rule_type.rb +2 -1
- data/lib/square/types/loyalty_program_status.rb +2 -1
- data/lib/square/types/loyalty_promotion_incentive_type.rb +2 -1
- data/lib/square/types/loyalty_promotion_status.rb +2 -1
- data/lib/square/types/loyalty_promotion_trigger_limit_interval.rb +2 -1
- data/lib/square/types/loyalty_reward_status.rb +2 -1
- data/lib/square/types/measurement_unit_area.rb +2 -1
- data/lib/square/types/measurement_unit_length.rb +2 -1
- data/lib/square/types/measurement_unit_time.rb +2 -1
- data/lib/square/types/measurement_unit_unit_type.rb +2 -1
- data/lib/square/types/measurement_unit_volume.rb +2 -1
- data/lib/square/types/measurement_unit_weight.rb +2 -1
- data/lib/square/types/merchant_status.rb +2 -1
- data/lib/square/types/oauth_authorization_revoked_event_revoker_type.rb +2 -1
- data/lib/square/types/order_fulfillment_delivery_details_schedule_type.rb +2 -1
- data/lib/square/types/order_fulfillment_fulfillment_line_item_application.rb +2 -1
- data/lib/square/types/order_fulfillment_pickup_details_schedule_type.rb +2 -1
- data/lib/square/types/order_fulfillment_state.rb +2 -1
- data/lib/square/types/order_fulfillment_type.rb +2 -1
- data/lib/square/types/order_line_item_discount_scope.rb +2 -1
- data/lib/square/types/order_line_item_discount_type.rb +2 -1
- data/lib/square/types/order_line_item_item_type.rb +2 -1
- data/lib/square/types/order_line_item_tax_scope.rb +2 -1
- data/lib/square/types/order_line_item_tax_type.rb +2 -1
- data/lib/square/types/order_service_charge_calculation_phase.rb +2 -1
- data/lib/square/types/order_service_charge_scope.rb +2 -1
- data/lib/square/types/order_service_charge_treatment_type.rb +2 -1
- data/lib/square/types/order_service_charge_type.rb +2 -1
- data/lib/square/types/order_state.rb +2 -1
- data/lib/square/types/payment_options_delay_action.rb +2 -1
- data/lib/square/types/payout_fee_type.rb +2 -1
- data/lib/square/types/payout_status.rb +2 -1
- data/lib/square/types/payout_type.rb +2 -1
- data/lib/square/types/product.rb +2 -1
- data/lib/square/types/refund_status.rb +2 -1
- data/lib/square/types/register_domain_response_status.rb +2 -1
- data/lib/square/types/risk_evaluation_risk_level.rb +2 -1
- data/lib/square/types/scheduled_shift_filter_assignment_status.rb +2 -1
- data/lib/square/types/scheduled_shift_filter_scheduled_shift_status.rb +2 -1
- data/lib/square/types/scheduled_shift_notification_audience.rb +2 -1
- data/lib/square/types/scheduled_shift_sort_field.rb +2 -1
- data/lib/square/types/scheduled_shift_workday_matcher.rb +2 -1
- data/lib/square/types/search_catalog_items_request_stock_level.rb +2 -1
- data/lib/square/types/search_orders_sort_field.rb +2 -1
- data/lib/square/types/search_vendors_request_sort_field.rb +2 -1
- data/lib/square/types/shift_filter_status.rb +2 -1
- data/lib/square/types/shift_sort_field.rb +2 -1
- data/lib/square/types/shift_status.rb +2 -1
- data/lib/square/types/shift_workday_matcher.rb +2 -1
- data/lib/square/types/sort_order.rb +2 -1
- data/lib/square/types/subscription_action_type.rb +2 -1
- data/lib/square/types/subscription_cadence.rb +2 -1
- data/lib/square/types/subscription_event_info_code.rb +2 -1
- data/lib/square/types/subscription_event_subscription_event_type.rb +2 -1
- data/lib/square/types/subscription_pricing_type.rb +2 -1
- data/lib/square/types/subscription_status.rb +2 -1
- data/lib/square/types/tax_calculation_phase.rb +2 -1
- data/lib/square/types/tax_inclusion_type.rb +2 -1
- data/lib/square/types/team_member_assigned_locations_assignment_type.rb +2 -1
- data/lib/square/types/team_member_invitation_status.rb +2 -1
- data/lib/square/types/team_member_status.rb +2 -1
- data/lib/square/types/tender_bank_account_details_status.rb +2 -1
- data/lib/square/types/tender_buy_now_pay_later_details_brand.rb +2 -1
- data/lib/square/types/tender_buy_now_pay_later_details_status.rb +2 -1
- data/lib/square/types/tender_card_details_entry_method.rb +2 -1
- data/lib/square/types/tender_card_details_status.rb +2 -1
- data/lib/square/types/tender_square_account_details_status.rb +2 -1
- data/lib/square/types/tender_type.rb +2 -1
- data/lib/square/types/terminal_action_action_type.rb +2 -1
- data/lib/square/types/timecard_filter_status.rb +2 -1
- data/lib/square/types/timecard_sort_field.rb +2 -1
- data/lib/square/types/timecard_status.rb +2 -1
- data/lib/square/types/timecard_workday_matcher.rb +2 -1
- data/lib/square/types/transaction_product.rb +2 -1
- data/lib/square/types/transaction_type.rb +2 -1
- data/lib/square/types/v_1_order_history_entry_action.rb +2 -1
- data/lib/square/types/v_1_order_state.rb +2 -1
- data/lib/square/types/v_1_tender_card_brand.rb +2 -1
- data/lib/square/types/v_1_tender_entry_method.rb +2 -1
- data/lib/square/types/v_1_tender_type.rb +2 -1
- data/lib/square/types/v_1_update_order_request_action.rb +2 -1
- data/lib/square/types/vendor_status.rb +2 -1
- data/lib/square/types/visibility_filter.rb +2 -1
- data/lib/square/types/weekday.rb +2 -1
- data/lib/square/v_1_transactions/client.rb +40 -15
- data/lib/square/vendors/client.rb +84 -42
- data/lib/square/version.rb +5 -0
- data/lib/square/webhooks/event_types/client.rb +16 -7
- data/lib/square/webhooks/subscriptions/client.rb +88 -43
- data/lib/square.rb +7 -6
- data/test/square/integration/client_tests/test_catalog.rb +3 -0
- metadata +9 -2
@@ -20,17 +20,23 @@ module Square
|
|
20
20
|
# @return [Square::Types::CreateSubscriptionResponse]
|
21
21
|
def create(request_options: {}, **params)
|
22
22
|
_request = Square::Internal::JSON::Request.new(
|
23
|
-
base_url: request_options[:base_url] || Square::Environment::
|
23
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
24
24
|
method: "POST",
|
25
25
|
path: "v2/subscriptions",
|
26
26
|
body: params
|
27
27
|
)
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
begin
|
29
|
+
_response = @client.send(_request)
|
30
|
+
rescue Net::HTTPRequestTimeout
|
31
|
+
raise Square::Errors::TimeoutError
|
32
|
+
end
|
33
|
+
code = _response.code.to_i
|
34
|
+
if code.between?(200, 299)
|
35
|
+
Square::Types::CreateSubscriptionResponse.load(_response.body)
|
36
|
+
else
|
37
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
38
|
+
raise error_class.new(_response.body, code: code)
|
31
39
|
end
|
32
|
-
|
33
|
-
raise _response.body
|
34
40
|
end
|
35
41
|
|
36
42
|
# Schedules a plan variation change for all active subscriptions under a given plan
|
@@ -39,17 +45,23 @@ module Square
|
|
39
45
|
# @return [Square::Types::BulkSwapPlanResponse]
|
40
46
|
def bulk_swap_plan(request_options: {}, **params)
|
41
47
|
_request = Square::Internal::JSON::Request.new(
|
42
|
-
base_url: request_options[:base_url] || Square::Environment::
|
48
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
43
49
|
method: "POST",
|
44
50
|
path: "v2/subscriptions/bulk-swap-plan",
|
45
51
|
body: params
|
46
52
|
)
|
47
|
-
|
48
|
-
|
49
|
-
|
53
|
+
begin
|
54
|
+
_response = @client.send(_request)
|
55
|
+
rescue Net::HTTPRequestTimeout
|
56
|
+
raise Square::Errors::TimeoutError
|
57
|
+
end
|
58
|
+
code = _response.code.to_i
|
59
|
+
if code.between?(200, 299)
|
60
|
+
Square::Types::BulkSwapPlanResponse.load(_response.body)
|
61
|
+
else
|
62
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
63
|
+
raise error_class.new(_response.body, code: code)
|
50
64
|
end
|
51
|
-
|
52
|
-
raise _response.body
|
53
65
|
end
|
54
66
|
|
55
67
|
# Searches for subscriptions.
|
@@ -70,39 +82,54 @@ module Square
|
|
70
82
|
# @return [Square::Types::SearchSubscriptionsResponse]
|
71
83
|
def search(request_options: {}, **params)
|
72
84
|
_request = Square::Internal::JSON::Request.new(
|
73
|
-
base_url: request_options[:base_url] || Square::Environment::
|
85
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
74
86
|
method: "POST",
|
75
87
|
path: "v2/subscriptions/search",
|
76
88
|
body: params
|
77
89
|
)
|
78
|
-
|
79
|
-
|
80
|
-
|
90
|
+
begin
|
91
|
+
_response = @client.send(_request)
|
92
|
+
rescue Net::HTTPRequestTimeout
|
93
|
+
raise Square::Errors::TimeoutError
|
94
|
+
end
|
95
|
+
code = _response.code.to_i
|
96
|
+
if code.between?(200, 299)
|
97
|
+
Square::Types::SearchSubscriptionsResponse.load(_response.body)
|
98
|
+
else
|
99
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
100
|
+
raise error_class.new(_response.body, code: code)
|
81
101
|
end
|
82
|
-
|
83
|
-
raise _response.body
|
84
102
|
end
|
85
103
|
|
86
104
|
# Retrieves a specific subscription.
|
87
105
|
#
|
88
106
|
# @return [Square::Types::GetSubscriptionResponse]
|
89
107
|
def get(request_options: {}, **params)
|
90
|
-
_query_param_names = [
|
108
|
+
_query_param_names = [
|
109
|
+
["include"],
|
110
|
+
%i[include]
|
111
|
+
].flatten
|
91
112
|
_query = params.slice(*_query_param_names)
|
92
113
|
params = params.except(*_query_param_names)
|
93
114
|
|
94
115
|
_request = Square::Internal::JSON::Request.new(
|
95
|
-
base_url: request_options[:base_url] || Square::Environment::
|
116
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
96
117
|
method: "GET",
|
97
118
|
path: "v2/subscriptions/#{params[:subscription_id]}",
|
98
119
|
query: _query
|
99
120
|
)
|
100
|
-
|
101
|
-
|
102
|
-
|
121
|
+
begin
|
122
|
+
_response = @client.send(_request)
|
123
|
+
rescue Net::HTTPRequestTimeout
|
124
|
+
raise Square::Errors::TimeoutError
|
125
|
+
end
|
126
|
+
code = _response.code.to_i
|
127
|
+
if code.between?(200, 299)
|
128
|
+
Square::Types::GetSubscriptionResponse.load(_response.body)
|
129
|
+
else
|
130
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
131
|
+
raise error_class.new(_response.body, code: code)
|
103
132
|
end
|
104
|
-
|
105
|
-
raise _response.body
|
106
133
|
end
|
107
134
|
|
108
135
|
# Updates a subscription by modifying or clearing `subscription` field values.
|
@@ -113,17 +140,23 @@ module Square
|
|
113
140
|
_path_param_names = ["subscription_id"]
|
114
141
|
|
115
142
|
_request = Square::Internal::JSON::Request.new(
|
116
|
-
base_url: request_options[:base_url] || Square::Environment::
|
143
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
117
144
|
method: "PUT",
|
118
145
|
path: "v2/subscriptions/#{params[:subscription_id]}",
|
119
146
|
body: params.except(*_path_param_names)
|
120
147
|
)
|
121
|
-
|
122
|
-
|
123
|
-
|
148
|
+
begin
|
149
|
+
_response = @client.send(_request)
|
150
|
+
rescue Net::HTTPRequestTimeout
|
151
|
+
raise Square::Errors::TimeoutError
|
152
|
+
end
|
153
|
+
code = _response.code.to_i
|
154
|
+
if code.between?(200, 299)
|
155
|
+
Square::Types::UpdateSubscriptionResponse.load(_response.body)
|
156
|
+
else
|
157
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
158
|
+
raise error_class.new(_response.body, code: code)
|
124
159
|
end
|
125
|
-
|
126
|
-
raise _response.body
|
127
160
|
end
|
128
161
|
|
129
162
|
# Deletes a scheduled action for a subscription.
|
@@ -131,16 +164,22 @@ module Square
|
|
131
164
|
# @return [Square::Types::DeleteSubscriptionActionResponse]
|
132
165
|
def delete_action(request_options: {}, **params)
|
133
166
|
_request = Square::Internal::JSON::Request.new(
|
134
|
-
base_url: request_options[:base_url] || Square::Environment::
|
167
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
135
168
|
method: "DELETE",
|
136
169
|
path: "v2/subscriptions/#{params[:subscription_id]}/actions/#{params[:action_id]}"
|
137
170
|
)
|
138
|
-
|
139
|
-
|
140
|
-
|
171
|
+
begin
|
172
|
+
_response = @client.send(_request)
|
173
|
+
rescue Net::HTTPRequestTimeout
|
174
|
+
raise Square::Errors::TimeoutError
|
175
|
+
end
|
176
|
+
code = _response.code.to_i
|
177
|
+
if code.between?(200, 299)
|
178
|
+
Square::Types::DeleteSubscriptionActionResponse.load(_response.body)
|
179
|
+
else
|
180
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
181
|
+
raise error_class.new(_response.body, code: code)
|
141
182
|
end
|
142
|
-
|
143
|
-
raise _response.body
|
144
183
|
end
|
145
184
|
|
146
185
|
# Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates)
|
@@ -151,17 +190,23 @@ module Square
|
|
151
190
|
_path_param_names = ["subscription_id"]
|
152
191
|
|
153
192
|
_request = Square::Internal::JSON::Request.new(
|
154
|
-
base_url: request_options[:base_url] || Square::Environment::
|
193
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
155
194
|
method: "POST",
|
156
195
|
path: "v2/subscriptions/#{params[:subscription_id]}/billing-anchor",
|
157
196
|
body: params.except(*_path_param_names)
|
158
197
|
)
|
159
|
-
|
160
|
-
|
161
|
-
|
198
|
+
begin
|
199
|
+
_response = @client.send(_request)
|
200
|
+
rescue Net::HTTPRequestTimeout
|
201
|
+
raise Square::Errors::TimeoutError
|
202
|
+
end
|
203
|
+
code = _response.code.to_i
|
204
|
+
if code.between?(200, 299)
|
205
|
+
Square::Types::ChangeBillingAnchorDateResponse.load(_response.body)
|
206
|
+
else
|
207
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
208
|
+
raise error_class.new(_response.body, code: code)
|
162
209
|
end
|
163
|
-
|
164
|
-
raise _response.body
|
165
210
|
end
|
166
211
|
|
167
212
|
# Schedules a `CANCEL` action to cancel an active subscription. This
|
@@ -171,38 +216,53 @@ module Square
|
|
171
216
|
# @return [Square::Types::CancelSubscriptionResponse]
|
172
217
|
def cancel(request_options: {}, **params)
|
173
218
|
_request = Square::Internal::JSON::Request.new(
|
174
|
-
base_url: request_options[:base_url] || Square::Environment::
|
219
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
175
220
|
method: "POST",
|
176
221
|
path: "v2/subscriptions/#{params[:subscription_id]}/cancel"
|
177
222
|
)
|
178
|
-
|
179
|
-
|
180
|
-
|
223
|
+
begin
|
224
|
+
_response = @client.send(_request)
|
225
|
+
rescue Net::HTTPRequestTimeout
|
226
|
+
raise Square::Errors::TimeoutError
|
227
|
+
end
|
228
|
+
code = _response.code.to_i
|
229
|
+
if code.between?(200, 299)
|
230
|
+
Square::Types::CancelSubscriptionResponse.load(_response.body)
|
231
|
+
else
|
232
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
233
|
+
raise error_class.new(_response.body, code: code)
|
181
234
|
end
|
182
|
-
|
183
|
-
raise _response.body
|
184
235
|
end
|
185
236
|
|
186
237
|
# Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription.
|
187
238
|
#
|
188
239
|
# @return [Square::Types::ListSubscriptionEventsResponse]
|
189
240
|
def list_events(request_options: {}, **params)
|
190
|
-
_query_param_names =
|
241
|
+
_query_param_names = [
|
242
|
+
%w[cursor limit],
|
243
|
+
%i[cursor limit]
|
244
|
+
].flatten
|
191
245
|
_query = params.slice(*_query_param_names)
|
192
246
|
params = params.except(*_query_param_names)
|
193
247
|
|
194
248
|
_request = Square::Internal::JSON::Request.new(
|
195
|
-
base_url: request_options[:base_url] || Square::Environment::
|
249
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
196
250
|
method: "GET",
|
197
251
|
path: "v2/subscriptions/#{params[:subscription_id]}/events",
|
198
252
|
query: _query
|
199
253
|
)
|
200
|
-
|
201
|
-
|
202
|
-
|
254
|
+
begin
|
255
|
+
_response = @client.send(_request)
|
256
|
+
rescue Net::HTTPRequestTimeout
|
257
|
+
raise Square::Errors::TimeoutError
|
258
|
+
end
|
259
|
+
code = _response.code.to_i
|
260
|
+
if code.between?(200, 299)
|
261
|
+
Square::Types::ListSubscriptionEventsResponse.load(_response.body)
|
262
|
+
else
|
263
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
264
|
+
raise error_class.new(_response.body, code: code)
|
203
265
|
end
|
204
|
-
|
205
|
-
raise _response.body
|
206
266
|
end
|
207
267
|
|
208
268
|
# Schedules a `PAUSE` action to pause an active subscription.
|
@@ -212,17 +272,23 @@ module Square
|
|
212
272
|
_path_param_names = ["subscription_id"]
|
213
273
|
|
214
274
|
_request = Square::Internal::JSON::Request.new(
|
215
|
-
base_url: request_options[:base_url] || Square::Environment::
|
275
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
216
276
|
method: "POST",
|
217
277
|
path: "v2/subscriptions/#{params[:subscription_id]}/pause",
|
218
278
|
body: params.except(*_path_param_names)
|
219
279
|
)
|
220
|
-
|
221
|
-
|
222
|
-
|
280
|
+
begin
|
281
|
+
_response = @client.send(_request)
|
282
|
+
rescue Net::HTTPRequestTimeout
|
283
|
+
raise Square::Errors::TimeoutError
|
284
|
+
end
|
285
|
+
code = _response.code.to_i
|
286
|
+
if code.between?(200, 299)
|
287
|
+
Square::Types::PauseSubscriptionResponse.load(_response.body)
|
288
|
+
else
|
289
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
290
|
+
raise error_class.new(_response.body, code: code)
|
223
291
|
end
|
224
|
-
|
225
|
-
raise _response.body
|
226
292
|
end
|
227
293
|
|
228
294
|
# Schedules a `RESUME` action to resume a paused or a deactivated subscription.
|
@@ -232,17 +298,23 @@ module Square
|
|
232
298
|
_path_param_names = ["subscription_id"]
|
233
299
|
|
234
300
|
_request = Square::Internal::JSON::Request.new(
|
235
|
-
base_url: request_options[:base_url] || Square::Environment::
|
301
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
236
302
|
method: "POST",
|
237
303
|
path: "v2/subscriptions/#{params[:subscription_id]}/resume",
|
238
304
|
body: params.except(*_path_param_names)
|
239
305
|
)
|
240
|
-
|
241
|
-
|
242
|
-
|
306
|
+
begin
|
307
|
+
_response = @client.send(_request)
|
308
|
+
rescue Net::HTTPRequestTimeout
|
309
|
+
raise Square::Errors::TimeoutError
|
310
|
+
end
|
311
|
+
code = _response.code.to_i
|
312
|
+
if code.between?(200, 299)
|
313
|
+
Square::Types::ResumeSubscriptionResponse.load(_response.body)
|
314
|
+
else
|
315
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
316
|
+
raise error_class.new(_response.body, code: code)
|
243
317
|
end
|
244
|
-
|
245
|
-
raise _response.body
|
246
318
|
end
|
247
319
|
|
248
320
|
# Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription.
|
@@ -253,15 +325,23 @@ module Square
|
|
253
325
|
_path_param_names = ["subscription_id"]
|
254
326
|
|
255
327
|
_request = Square::Internal::JSON::Request.new(
|
256
|
-
base_url: request_options[:base_url] || Square::Environment::
|
328
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
257
329
|
method: "POST",
|
258
330
|
path: "v2/subscriptions/#{params[:subscription_id]}/swap-plan",
|
259
331
|
body: params.except(*_path_param_names)
|
260
332
|
)
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
333
|
+
begin
|
334
|
+
_response = @client.send(_request)
|
335
|
+
rescue Net::HTTPRequestTimeout
|
336
|
+
raise Square::Errors::TimeoutError
|
337
|
+
end
|
338
|
+
code = _response.code.to_i
|
339
|
+
if code.between?(200, 299)
|
340
|
+
Square::Types::SwapPlanResponse.load(_response.body)
|
341
|
+
else
|
342
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
343
|
+
raise error_class.new(_response.body, code: code)
|
344
|
+
end
|
265
345
|
end
|
266
346
|
end
|
267
347
|
end
|
data/lib/square/team/client.rb
CHANGED
@@ -12,20 +12,31 @@ module Square
|
|
12
12
|
#
|
13
13
|
# @return [Square::Types::ListJobsResponse]
|
14
14
|
def list_jobs(request_options: {}, **params)
|
15
|
-
_query_param_names = [
|
15
|
+
_query_param_names = [
|
16
|
+
["cursor"],
|
17
|
+
%i[cursor]
|
18
|
+
].flatten
|
16
19
|
_query = params.slice(*_query_param_names)
|
17
20
|
params.except(*_query_param_names)
|
18
21
|
|
19
22
|
_request = Square::Internal::JSON::Request.new(
|
20
|
-
base_url: request_options[:base_url] || Square::Environment::
|
23
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
21
24
|
method: "GET",
|
22
25
|
path: "v2/team-members/jobs",
|
23
26
|
query: _query
|
24
27
|
)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
begin
|
29
|
+
_response = @client.send(_request)
|
30
|
+
rescue Net::HTTPRequestTimeout
|
31
|
+
raise Square::Errors::TimeoutError
|
32
|
+
end
|
33
|
+
code = _response.code.to_i
|
34
|
+
if code.between?(200, 299)
|
35
|
+
Square::Types::ListJobsResponse.load(_response.body)
|
36
|
+
else
|
37
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
38
|
+
raise error_class.new(_response.body, code: code)
|
39
|
+
end
|
29
40
|
end
|
30
41
|
|
31
42
|
# Creates a job in a seller account. A job defines a title and tip eligibility. Note that
|
@@ -34,17 +45,23 @@ module Square
|
|
34
45
|
# @return [Square::Types::CreateJobResponse]
|
35
46
|
def create_job(request_options: {}, **params)
|
36
47
|
_request = Square::Internal::JSON::Request.new(
|
37
|
-
base_url: request_options[:base_url] || Square::Environment::
|
48
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
38
49
|
method: "POST",
|
39
50
|
path: "v2/team-members/jobs",
|
40
51
|
body: params
|
41
52
|
)
|
42
|
-
|
43
|
-
|
44
|
-
|
53
|
+
begin
|
54
|
+
_response = @client.send(_request)
|
55
|
+
rescue Net::HTTPRequestTimeout
|
56
|
+
raise Square::Errors::TimeoutError
|
57
|
+
end
|
58
|
+
code = _response.code.to_i
|
59
|
+
if code.between?(200, 299)
|
60
|
+
Square::Types::CreateJobResponse.load(_response.body)
|
61
|
+
else
|
62
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
63
|
+
raise error_class.new(_response.body, code: code)
|
45
64
|
end
|
46
|
-
|
47
|
-
raise _response.body
|
48
65
|
end
|
49
66
|
|
50
67
|
# Retrieves a specified job.
|
@@ -52,16 +69,22 @@ module Square
|
|
52
69
|
# @return [Square::Types::RetrieveJobResponse]
|
53
70
|
def retrieve_job(request_options: {}, **params)
|
54
71
|
_request = Square::Internal::JSON::Request.new(
|
55
|
-
base_url: request_options[:base_url] || Square::Environment::
|
72
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
56
73
|
method: "GET",
|
57
74
|
path: "v2/team-members/jobs/#{params[:job_id]}"
|
58
75
|
)
|
59
|
-
|
60
|
-
|
61
|
-
|
76
|
+
begin
|
77
|
+
_response = @client.send(_request)
|
78
|
+
rescue Net::HTTPRequestTimeout
|
79
|
+
raise Square::Errors::TimeoutError
|
80
|
+
end
|
81
|
+
code = _response.code.to_i
|
82
|
+
if code.between?(200, 299)
|
83
|
+
Square::Types::RetrieveJobResponse.load(_response.body)
|
84
|
+
else
|
85
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
86
|
+
raise error_class.new(_response.body, code: code)
|
62
87
|
end
|
63
|
-
|
64
|
-
raise _response.body
|
65
88
|
end
|
66
89
|
|
67
90
|
# Updates the title or tip eligibility of a job. Changes to the title propagate to all
|
@@ -73,17 +96,23 @@ module Square
|
|
73
96
|
_path_param_names = ["job_id"]
|
74
97
|
|
75
98
|
_request = Square::Internal::JSON::Request.new(
|
76
|
-
base_url: request_options[:base_url] || Square::Environment::
|
99
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
77
100
|
method: "PUT",
|
78
101
|
path: "v2/team-members/jobs/#{params[:job_id]}",
|
79
102
|
body: params.except(*_path_param_names)
|
80
103
|
)
|
81
|
-
|
82
|
-
|
83
|
-
|
104
|
+
begin
|
105
|
+
_response = @client.send(_request)
|
106
|
+
rescue Net::HTTPRequestTimeout
|
107
|
+
raise Square::Errors::TimeoutError
|
108
|
+
end
|
109
|
+
code = _response.code.to_i
|
110
|
+
if code.between?(200, 299)
|
111
|
+
Square::Types::UpdateJobResponse.load(_response.body)
|
112
|
+
else
|
113
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
114
|
+
raise error_class.new(_response.body, code: code)
|
84
115
|
end
|
85
|
-
|
86
|
-
raise _response.body
|
87
116
|
end
|
88
117
|
end
|
89
118
|
end
|
@@ -18,17 +18,23 @@ module Square
|
|
18
18
|
# @return [Square::Types::CreateTeamMemberResponse]
|
19
19
|
def create(request_options: {}, **params)
|
20
20
|
_request = Square::Internal::JSON::Request.new(
|
21
|
-
base_url: request_options[:base_url] || Square::Environment::
|
21
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
22
22
|
method: "POST",
|
23
23
|
path: "v2/team-members",
|
24
24
|
body: Square::Types::CreateTeamMemberRequest.new(params).to_h
|
25
25
|
)
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
begin
|
27
|
+
_response = @client.send(_request)
|
28
|
+
rescue Net::HTTPRequestTimeout
|
29
|
+
raise Square::Errors::TimeoutError
|
30
|
+
end
|
31
|
+
code = _response.code.to_i
|
32
|
+
if code.between?(200, 299)
|
33
|
+
Square::Types::CreateTeamMemberResponse.load(_response.body)
|
34
|
+
else
|
35
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
36
|
+
raise error_class.new(_response.body, code: code)
|
29
37
|
end
|
30
|
-
|
31
|
-
raise _response.body
|
32
38
|
end
|
33
39
|
|
34
40
|
# Creates multiple `TeamMember` objects. The created `TeamMember` objects are returned on successful creates.
|
@@ -41,17 +47,23 @@ module Square
|
|
41
47
|
# @return [Square::Types::BatchCreateTeamMembersResponse]
|
42
48
|
def batch_create(request_options: {}, **params)
|
43
49
|
_request = Square::Internal::JSON::Request.new(
|
44
|
-
base_url: request_options[:base_url] || Square::Environment::
|
50
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
45
51
|
method: "POST",
|
46
52
|
path: "v2/team-members/bulk-create",
|
47
53
|
body: params
|
48
54
|
)
|
49
|
-
|
50
|
-
|
51
|
-
|
55
|
+
begin
|
56
|
+
_response = @client.send(_request)
|
57
|
+
rescue Net::HTTPRequestTimeout
|
58
|
+
raise Square::Errors::TimeoutError
|
59
|
+
end
|
60
|
+
code = _response.code.to_i
|
61
|
+
if code.between?(200, 299)
|
62
|
+
Square::Types::BatchCreateTeamMembersResponse.load(_response.body)
|
63
|
+
else
|
64
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
65
|
+
raise error_class.new(_response.body, code: code)
|
52
66
|
end
|
53
|
-
|
54
|
-
raise _response.body
|
55
67
|
end
|
56
68
|
|
57
69
|
# Updates multiple `TeamMember` objects. The updated `TeamMember` objects are returned on successful updates.
|
@@ -63,17 +75,23 @@ module Square
|
|
63
75
|
# @return [Square::Types::BatchUpdateTeamMembersResponse]
|
64
76
|
def batch_update(request_options: {}, **params)
|
65
77
|
_request = Square::Internal::JSON::Request.new(
|
66
|
-
base_url: request_options[:base_url] || Square::Environment::
|
78
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
67
79
|
method: "POST",
|
68
80
|
path: "v2/team-members/bulk-update",
|
69
81
|
body: params
|
70
82
|
)
|
71
|
-
|
72
|
-
|
73
|
-
|
83
|
+
begin
|
84
|
+
_response = @client.send(_request)
|
85
|
+
rescue Net::HTTPRequestTimeout
|
86
|
+
raise Square::Errors::TimeoutError
|
87
|
+
end
|
88
|
+
code = _response.code.to_i
|
89
|
+
if code.between?(200, 299)
|
90
|
+
Square::Types::BatchUpdateTeamMembersResponse.load(_response.body)
|
91
|
+
else
|
92
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
93
|
+
raise error_class.new(_response.body, code: code)
|
74
94
|
end
|
75
|
-
|
76
|
-
raise _response.body
|
77
95
|
end
|
78
96
|
|
79
97
|
# Returns a paginated list of `TeamMember` objects for a business.
|
@@ -83,17 +101,23 @@ module Square
|
|
83
101
|
# @return [Square::Types::SearchTeamMembersResponse]
|
84
102
|
def search(request_options: {}, **params)
|
85
103
|
_request = Square::Internal::JSON::Request.new(
|
86
|
-
base_url: request_options[:base_url] || Square::Environment::
|
104
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
87
105
|
method: "POST",
|
88
106
|
path: "v2/team-members/search",
|
89
107
|
body: params
|
90
108
|
)
|
91
|
-
|
92
|
-
|
93
|
-
|
109
|
+
begin
|
110
|
+
_response = @client.send(_request)
|
111
|
+
rescue Net::HTTPRequestTimeout
|
112
|
+
raise Square::Errors::TimeoutError
|
113
|
+
end
|
114
|
+
code = _response.code.to_i
|
115
|
+
if code.between?(200, 299)
|
116
|
+
Square::Types::SearchTeamMembersResponse.load(_response.body)
|
117
|
+
else
|
118
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
119
|
+
raise error_class.new(_response.body, code: code)
|
94
120
|
end
|
95
|
-
|
96
|
-
raise _response.body
|
97
121
|
end
|
98
122
|
|
99
123
|
# Retrieves a `TeamMember` object for the given `TeamMember.id`.
|
@@ -102,16 +126,22 @@ module Square
|
|
102
126
|
# @return [Square::Types::GetTeamMemberResponse]
|
103
127
|
def get(request_options: {}, **params)
|
104
128
|
_request = Square::Internal::JSON::Request.new(
|
105
|
-
base_url: request_options[:base_url] || Square::Environment::
|
129
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
106
130
|
method: "GET",
|
107
131
|
path: "v2/team-members/#{params[:team_member_id]}"
|
108
132
|
)
|
109
|
-
|
110
|
-
|
111
|
-
|
133
|
+
begin
|
134
|
+
_response = @client.send(_request)
|
135
|
+
rescue Net::HTTPRequestTimeout
|
136
|
+
raise Square::Errors::TimeoutError
|
137
|
+
end
|
138
|
+
code = _response.code.to_i
|
139
|
+
if code.between?(200, 299)
|
140
|
+
Square::Types::GetTeamMemberResponse.load(_response.body)
|
141
|
+
else
|
142
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
143
|
+
raise error_class.new(_response.body, code: code)
|
112
144
|
end
|
113
|
-
|
114
|
-
raise _response.body
|
115
145
|
end
|
116
146
|
|
117
147
|
# Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates.
|
@@ -122,17 +152,23 @@ module Square
|
|
122
152
|
_path_param_names = ["team_member_id"]
|
123
153
|
|
124
154
|
_request = Square::Internal::JSON::Request.new(
|
125
|
-
base_url: request_options[:base_url] || Square::Environment::
|
155
|
+
base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
|
126
156
|
method: "PUT",
|
127
157
|
path: "v2/team-members/#{params[:team_member_id]}",
|
128
158
|
body: params.except(*_path_param_names)
|
129
159
|
)
|
130
|
-
|
131
|
-
|
132
|
-
|
160
|
+
begin
|
161
|
+
_response = @client.send(_request)
|
162
|
+
rescue Net::HTTPRequestTimeout
|
163
|
+
raise Square::Errors::TimeoutError
|
164
|
+
end
|
165
|
+
code = _response.code.to_i
|
166
|
+
if code.between?(200, 299)
|
167
|
+
Square::Types::UpdateTeamMemberResponse.load(_response.body)
|
168
|
+
else
|
169
|
+
error_class = Square::Errors::ResponseError.subclass_for_code(code)
|
170
|
+
raise error_class.new(_response.body, code: code)
|
133
171
|
end
|
134
|
-
|
135
|
-
raise _response.body
|
136
172
|
end
|
137
173
|
|
138
174
|
# @return [Square::WageSetting::Client]
|