univapay-apimatic-sdk 0.0.1
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 +7 -0
- data/LICENSE +28 -0
- data/README.md +224 -0
- data/bin/console +15 -0
- data/lib/univapay_client_sdk/api_helper.rb +10 -0
- data/lib/univapay_client_sdk/apis/base_api.rb +67 -0
- data/lib/univapay_client_sdk/apis/cancels_api.rb +293 -0
- data/lib/univapay_client_sdk/apis/charges_api.rb +903 -0
- data/lib/univapay_client_sdk/apis/merchants_api.rb +57 -0
- data/lib/univapay_client_sdk/apis/refunds_api.rb +298 -0
- data/lib/univapay_client_sdk/apis/stores_api.rb +126 -0
- data/lib/univapay_client_sdk/apis/subscriptions_api.rb +1014 -0
- data/lib/univapay_client_sdk/apis/transaction_tokens_api.rb +455 -0
- data/lib/univapay_client_sdk/apis/webhooks_api.rb +463 -0
- data/lib/univapay_client_sdk/client.rb +116 -0
- data/lib/univapay_client_sdk/configuration.rb +178 -0
- data/lib/univapay_client_sdk/events/unknown_event.rb +32 -0
- data/lib/univapay_client_sdk/events/webhooks/bank_transfer_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/cancel_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/charge_finished_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/charge_updated_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/customs_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/recurring_token_deleted_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/refund_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_canceled_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_completed_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_created_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_failure_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_payment_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_suspended_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_created_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_cvv_auth_check_updated_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_cvv_auth_updated_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_replaced_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_three_ds_updated_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_updated_handler.rb +37 -0
- data/lib/univapay_client_sdk/exceptions/api_error_exception.rb +199 -0
- data/lib/univapay_client_sdk/exceptions/api_exception.rb +21 -0
- data/lib/univapay_client_sdk/http/api_response.rb +19 -0
- data/lib/univapay_client_sdk/http/auth/oauth_2.rb +53 -0
- data/lib/univapay_client_sdk/http/http_call_back.rb +10 -0
- data/lib/univapay_client_sdk/http/http_method_enum.rb +10 -0
- data/lib/univapay_client_sdk/http/http_request.rb +10 -0
- data/lib/univapay_client_sdk/http/http_response.rb +10 -0
- data/lib/univapay_client_sdk/http/proxy_settings.rb +22 -0
- data/lib/univapay_client_sdk/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/univapay_client_sdk/logging/sdk_logger.rb +17 -0
- data/lib/univapay_client_sdk/models/api_error_detail.rb +87 -0
- data/lib/univapay_client_sdk/models/api_error_status.rb +26 -0
- data/lib/univapay_client_sdk/models/bank_transfer_event.rb +27 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger.rb +199 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger_bank_ledger_type.rb +36 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger_list.rb +104 -0
- data/lib/univapay_client_sdk/models/bank_transfer_ledger_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/bank_transfer_payment_status.rb +44 -0
- data/lib/univapay_client_sdk/models/bank_transfer_status_data.rb +229 -0
- data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback.rb +134 -0
- data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback_extension.rb +75 -0
- data/lib/univapay_client_sdk/models/base_bank_transfer_data.rb +100 -0
- data/lib/univapay_client_sdk/models/base_konbini_data.rb +99 -0
- data/lib/univapay_client_sdk/models/base_konbini_data_convenience_store.rb +60 -0
- data/lib/univapay_client_sdk/models/base_model.rb +110 -0
- data/lib/univapay_client_sdk/models/base_online_data.rb +123 -0
- data/lib/univapay_client_sdk/models/base_online_data_brand.rb +48 -0
- data/lib/univapay_client_sdk/models/base_online_data_call_method.rb +52 -0
- data/lib/univapay_client_sdk/models/base_online_data_os_type.rb +36 -0
- data/lib/univapay_client_sdk/models/base_online_data_user_identifier_source.rb +36 -0
- data/lib/univapay_client_sdk/models/cancel.rb +183 -0
- data/lib/univapay_client_sdk/models/cancel_create_request.rb +77 -0
- data/lib/univapay_client_sdk/models/cancel_event.rb +26 -0
- data/lib/univapay_client_sdk/models/cancel_list.rb +94 -0
- data/lib/univapay_client_sdk/models/cancel_status.rb +44 -0
- data/lib/univapay_client_sdk/models/cancel_update_request.rb +76 -0
- data/lib/univapay_client_sdk/models/cancel_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/cancel_webhook_callback_extension.rb +74 -0
- data/lib/univapay_client_sdk/models/card_processor_installment_config.rb +89 -0
- data/lib/univapay_client_sdk/models/charge.rb +411 -0
- data/lib/univapay_client_sdk/models/charge_capture_request.rb +84 -0
- data/lib/univapay_client_sdk/models/charge_create_request.rb +179 -0
- data/lib/univapay_client_sdk/models/charge_create_request_client_metadata.rb +76 -0
- data/lib/univapay_client_sdk/models/charge_create_request_redirect.rb +75 -0
- data/lib/univapay_client_sdk/models/charge_create_request_three_ds.rb +88 -0
- data/lib/univapay_client_sdk/models/charge_create_request_three_ds_mode.rb +44 -0
- data/lib/univapay_client_sdk/models/charge_finished_webhook_callback.rb +131 -0
- data/lib/univapay_client_sdk/models/charge_list.rb +104 -0
- data/lib/univapay_client_sdk/models/charge_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/charge_redirect.rb +96 -0
- data/lib/univapay_client_sdk/models/charge_status.rb +56 -0
- data/lib/univapay_client_sdk/models/charge_three_ds.rb +97 -0
- data/lib/univapay_client_sdk/models/charge_transaction_token_type.rb +40 -0
- data/lib/univapay_client_sdk/models/charge_update_request.rb +75 -0
- data/lib/univapay_client_sdk/models/charge_updated_webhook_callback.rb +131 -0
- data/lib/univapay_client_sdk/models/cursor_direction_query.rb +36 -0
- data/lib/univapay_client_sdk/models/customs_declaration_create_request.rb +106 -0
- data/lib/univapay_client_sdk/models/customs_declaration_event.rb +27 -0
- data/lib/univapay_client_sdk/models/customs_declaration_patch_request.rb +77 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback.rb +135 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback_extension.rb +76 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_data.rb +232 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb +121 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_error.rb +127 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_other_error.rb +120 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_result.rb +125 -0
- data/lib/univapay_client_sdk/models/customs_declaration_webhook_status.rb +44 -0
- data/lib/univapay_client_sdk/models/generic_metadata.rb +111 -0
- data/lib/univapay_client_sdk/models/installment_fixed_cycles.rb +70 -0
- data/lib/univapay_client_sdk/models/installment_plan_type.rb +36 -0
- data/lib/univapay_client_sdk/models/issuer_token.rb +177 -0
- data/lib/univapay_client_sdk/models/issuer_token_call_method.rb +51 -0
- data/lib/univapay_client_sdk/models/issuer_token_payload.rb +105 -0
- data/lib/univapay_client_sdk/models/issuer_token_payment_type.rb +36 -0
- data/lib/univapay_client_sdk/models/merchant.rb +179 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_bank_transfer_configuration.rb +342 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_card_brand_percent_fees.rb +167 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_card_configuration.rb +301 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_checkout_configuration.rb +87 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_checkout_toggle.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_configuration.rb +505 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_convenience_configuration.rb +88 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_customer_management_configuration.rb +99 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb +139 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_limit_charge_by_card_configuration.rb +88 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb +100 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_money_amount.rb +85 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_online_configuration.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_paidy_configuration.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_qr_merchant_configuration.rb +77 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_qr_scan_configuration.rb +93 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_recurring_cvv_confirmation_config.rb +97 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb +109 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_security_configuration.rb +234 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_subscription_configuration.rb +138 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb +138 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_transfer_schedule_configuration.rb +159 -0
- data/lib/univapay_client_sdk/models/merchant_webhook_user_transactions_configuration.rb +349 -0
- data/lib/univapay_client_sdk/models/mode_query.rb +36 -0
- data/lib/univapay_client_sdk/models/payment_error.rb +178 -0
- data/lib/univapay_client_sdk/models/plan_settings_type.rb +36 -0
- data/lib/univapay_client_sdk/models/recurring_token_deleted_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/refund.rb +240 -0
- data/lib/univapay_client_sdk/models/refund_create_request.rb +118 -0
- data/lib/univapay_client_sdk/models/refund_event.rb +26 -0
- data/lib/univapay_client_sdk/models/refund_list.rb +104 -0
- data/lib/univapay_client_sdk/models/refund_reason_request.rb +42 -0
- data/lib/univapay_client_sdk/models/refund_reason_response.rb +62 -0
- data/lib/univapay_client_sdk/models/refund_status.rb +47 -0
- data/lib/univapay_client_sdk/models/refund_update_request.rb +99 -0
- data/lib/univapay_client_sdk/models/refund_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/refund_webhook_callback_extension.rb +74 -0
- data/lib/univapay_client_sdk/models/restrict_ip_after_failed_charge_config.rb +99 -0
- data/lib/univapay_client_sdk/models/store.rb +119 -0
- data/lib/univapay_client_sdk/models/store_list.rb +104 -0
- data/lib/univapay_client_sdk/models/store_list_item.rb +114 -0
- data/lib/univapay_client_sdk/models/subscription.rb +310 -0
- data/lib/univapay_client_sdk/models/subscription_canceled_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_completed_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_create_request.rb +216 -0
- data/lib/univapay_client_sdk/models/subscription_created_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_failure_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_installment_plan.rb +86 -0
- data/lib/univapay_client_sdk/models/subscription_list.rb +104 -0
- data/lib/univapay_client_sdk/models/subscription_list_item.rb +352 -0
- data/lib/univapay_client_sdk/models/subscription_next_payment.rb +222 -0
- data/lib/univapay_client_sdk/models/subscription_patch_payment_request.rb +117 -0
- data/lib/univapay_client_sdk/models/subscription_patch_token_request.rb +79 -0
- data/lib/univapay_client_sdk/models/subscription_payment.rb +185 -0
- data/lib/univapay_client_sdk/models/subscription_payment_list.rb +94 -0
- data/lib/univapay_client_sdk/models/subscription_payment_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_period.rb +56 -0
- data/lib/univapay_client_sdk/models/subscription_plan_settings.rb +98 -0
- data/lib/univapay_client_sdk/models/subscription_schedule_settings.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_status.rb +56 -0
- data/lib/univapay_client_sdk/models/subscription_suspend_request.rb +79 -0
- data/lib/univapay_client_sdk/models/subscription_suspended_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/subscription_terminate_with_status.rb +36 -0
- data/lib/univapay_client_sdk/models/subscription_termination_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/subscription_update_next_payment.rb +104 -0
- data/lib/univapay_client_sdk/models/subscription_update_request.rb +134 -0
- data/lib/univapay_client_sdk/models/subscription_update_schedule_settings.rb +110 -0
- data/lib/univapay_client_sdk/models/subscription_update_status.rb +37 -0
- data/lib/univapay_client_sdk/models/subscription_user_data.rb +134 -0
- data/lib/univapay_client_sdk/models/suspend_schedule_settings.rb +78 -0
- data/lib/univapay_client_sdk/models/three_ds_issuer_token.rb +116 -0
- data/lib/univapay_client_sdk/models/three_ds_issuer_token_call_method.rb +26 -0
- data/lib/univapay_client_sdk/models/three_ds_issuer_token_payment_type.rb +26 -0
- data/lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb +122 -0
- data/lib/univapay_client_sdk/models/token_create_card_data.rb +231 -0
- data/lib/univapay_client_sdk/models/token_create_card_data_cvv_authorize.rb +95 -0
- data/lib/univapay_client_sdk/models/token_create_card_data_three_ds.rb +97 -0
- data/lib/univapay_client_sdk/models/token_create_konbini_data.rb +147 -0
- data/lib/univapay_client_sdk/models/token_create_online_data.rb +142 -0
- data/lib/univapay_client_sdk/models/token_create_phone_number.rb +104 -0
- data/lib/univapay_client_sdk/models/token_created_webhook_callback.rb +131 -0
- data/lib/univapay_client_sdk/models/token_cvv_auth_check_updated_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/token_cvv_auth_updated_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/token_replaced_webhook_callback.rb +131 -0
- data/lib/univapay_client_sdk/models/token_response_bank_transfer_data.rb +181 -0
- data/lib/univapay_client_sdk/models/token_response_card_data.rb +129 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_billing.rb +153 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_card.rb +187 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize.rb +132 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb +118 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb +142 -0
- data/lib/univapay_client_sdk/models/token_response_card_data_three_ds_status.rb +48 -0
- data/lib/univapay_client_sdk/models/token_response_konbini_data.rb +135 -0
- data/lib/univapay_client_sdk/models/token_response_online_data.rb +158 -0
- data/lib/univapay_client_sdk/models/token_response_phone_number.rb +96 -0
- data/lib/univapay_client_sdk/models/token_three_ds_updated_webhook_callback.rb +132 -0
- data/lib/univapay_client_sdk/models/token_updated_webhook_callback.rb +131 -0
- data/lib/univapay_client_sdk/models/transaction_token.rb +250 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request.rb +161 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request_metadata.rb +124 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request_payment_type.rb +44 -0
- data/lib/univapay_client_sdk/models/transaction_token_create_request_type.rb +40 -0
- data/lib/univapay_client_sdk/models/transaction_token_list.rb +104 -0
- data/lib/univapay_client_sdk/models/transaction_token_list_item.rb +204 -0
- data/lib/univapay_client_sdk/models/transaction_token_list_item_user_data.rb +96 -0
- data/lib/univapay_client_sdk/models/transaction_token_mode.rb +36 -0
- data/lib/univapay_client_sdk/models/transaction_token_payment_type.rb +48 -0
- data/lib/univapay_client_sdk/models/transaction_token_type.rb +40 -0
- data/lib/univapay_client_sdk/models/transaction_token_update_request.rb +95 -0
- data/lib/univapay_client_sdk/models/transaction_token_update_request_data.rb +184 -0
- data/lib/univapay_client_sdk/models/transaction_token_update_request_data_phone_number.rb +86 -0
- data/lib/univapay_client_sdk/models/webhook.rb +191 -0
- data/lib/univapay_client_sdk/models/webhook_callback_envelope.rb +98 -0
- data/lib/univapay_client_sdk/models/webhook_create_request.rb +97 -0
- data/lib/univapay_client_sdk/models/webhook_event.rb +166 -0
- data/lib/univapay_client_sdk/models/webhook_event_list.rb +94 -0
- data/lib/univapay_client_sdk/models/webhook_list.rb +94 -0
- data/lib/univapay_client_sdk/models/webhook_trigger.rb +104 -0
- data/lib/univapay_client_sdk/models/webhook_update_request.rb +108 -0
- data/lib/univapay_client_sdk/utilities/date_time_helper.rb +11 -0
- data/lib/univapay_client_sdk/utilities/file_wrapper.rb +28 -0
- data/lib/univapay_client_sdk/utilities/union_type_lookup.rb +242 -0
- data/lib/univapay_client_sdk.rb +322 -0
- data/test/apis/api_test_base.rb +23 -0
- data/test/apis/test_cancels_api.rb +162 -0
- data/test/apis/test_charges_api.rb +564 -0
- data/test/apis/test_merchants_api.rb +50 -0
- data/test/apis/test_refunds_api.rb +172 -0
- data/test/apis/test_stores_api.rb +86 -0
- data/test/apis/test_subscriptions_api.rb +579 -0
- data/test/apis/test_transaction_tokens_api.rb +305 -0
- data/test/apis/test_webhooks_api.rb +245 -0
- data/test/events/webhooks/test_bank_transfer_handler.rb +95 -0
- data/test/events/webhooks/test_cancel_handler.rb +90 -0
- data/test/events/webhooks/test_charge_finished_handler.rb +95 -0
- data/test/events/webhooks/test_charge_updated_handler.rb +95 -0
- data/test/events/webhooks/test_customs_handler.rb +100 -0
- data/test/events/webhooks/test_recurring_token_deleted_handler.rb +92 -0
- data/test/events/webhooks/test_refund_handler.rb +95 -0
- data/test/events/webhooks/test_subscription_canceled_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_completed_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_created_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_failure_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_payment_handler.rb +101 -0
- data/test/events/webhooks/test_subscription_suspended_handler.rb +101 -0
- data/test/events/webhooks/test_token_created_handler.rb +92 -0
- data/test/events/webhooks/test_token_cvv_auth_check_updated_handler.rb +92 -0
- data/test/events/webhooks/test_token_cvv_auth_updated_handler.rb +92 -0
- data/test/events/webhooks/test_token_replaced_handler.rb +92 -0
- data/test/events/webhooks/test_token_three_ds_updated_handler.rb +92 -0
- data/test/events/webhooks/test_token_updated_handler.rb +92 -0
- data/test/framework_integrations/rails_app_test_helper.rb +14 -0
- data/test/framework_integrations/webhooks/apps/hanami_charge_updated_app.rb +61 -0
- data/test/framework_integrations/webhooks/apps/rails_charge_updated_app.rb +24 -0
- data/test/framework_integrations/webhooks/apps/sinatra_charge_updated_app.rb +27 -0
- data/test/framework_integrations/webhooks/test/test_hanami_charge_updated_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_rails_charge_updated_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_sinatra_charge_updated_app.rb +58 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +397 -0
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
# univapay_client_sdk
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for Univapay
|
|
4
|
+
# by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module UnivapayClientSdk
|
|
7
|
+
# WebhooksApi
|
|
8
|
+
class WebhooksApi < BaseApi
|
|
9
|
+
# Returns a paginated list of webhooks for the specified store. Requires a
|
|
10
|
+
# secret-bearing token.
|
|
11
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
12
|
+
# of the store.
|
|
13
|
+
# @param [Integer] limit Optional parameter: Maximum number of resources to
|
|
14
|
+
# return in one page.
|
|
15
|
+
# @param [UUID | String] cursor Optional parameter: Cursor pointing to the
|
|
16
|
+
# resource after which pagination should continue.
|
|
17
|
+
# @param [CursorDirectionQuery] cursor_direction Optional parameter:
|
|
18
|
+
# Pagination direction relative to the supplied cursor.
|
|
19
|
+
# @param [TrueClass | FalseClass] active Optional parameter: Filter by
|
|
20
|
+
# active status.
|
|
21
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
22
|
+
def list_webhooks(store_id,
|
|
23
|
+
limit: 10,
|
|
24
|
+
cursor: nil,
|
|
25
|
+
cursor_direction: CursorDirectionQuery::DESC,
|
|
26
|
+
active: nil)
|
|
27
|
+
@api_call
|
|
28
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
29
|
+
'/stores/{storeId}/webhooks',
|
|
30
|
+
Server::DEFAULT)
|
|
31
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
32
|
+
.is_required(true)
|
|
33
|
+
.should_encode(true))
|
|
34
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
35
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
36
|
+
.query_param(new_parameter(cursor_direction, key: 'cursor_direction'))
|
|
37
|
+
.query_param(new_parameter(active, key: 'active'))
|
|
38
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
39
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
40
|
+
.response(new_response_handler
|
|
41
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
42
|
+
.deserialize_into(WebhookList.method(:from_hash))
|
|
43
|
+
.is_api_response(true)
|
|
44
|
+
.local_error_template('401',
|
|
45
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
46
|
+
ApiErrorException)
|
|
47
|
+
.local_error_template('404',
|
|
48
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
49
|
+
ApiErrorException)
|
|
50
|
+
.local_error_template('400',
|
|
51
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
52
|
+
APIException)
|
|
53
|
+
.local_error_template('403',
|
|
54
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
55
|
+
APIException)
|
|
56
|
+
.local_error_template('409',
|
|
57
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
58
|
+
APIException)
|
|
59
|
+
.local_error_template('429',
|
|
60
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
61
|
+
APIException)
|
|
62
|
+
.local_error_template('500',
|
|
63
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
64
|
+
APIException)
|
|
65
|
+
.local_error_template('503',
|
|
66
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
67
|
+
APIException)
|
|
68
|
+
.local_error_template('504',
|
|
69
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
70
|
+
APIException)
|
|
71
|
+
.local_error_template('default',
|
|
72
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
73
|
+
APIException))
|
|
74
|
+
.execute
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Creates a new webhook subscription for the specified store. Requires a
|
|
78
|
+
# secret-bearing token. Duplicate URLs within the same scope are not
|
|
79
|
+
# allowed. There is a maximum limit on the number of webhooks per store.
|
|
80
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
81
|
+
# of the store.
|
|
82
|
+
# @param [WebhookCreateRequest] body Required parameter: Request payload for
|
|
83
|
+
# creating a store webhook subscription.
|
|
84
|
+
# @param [String] idempotency_key Optional parameter: An optional
|
|
85
|
+
# idempotency key to prevent double charges and duplicate operations. We
|
|
86
|
+
# recommend a randomly generated UUID (v4).
|
|
87
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
88
|
+
def create_webhook(store_id,
|
|
89
|
+
body,
|
|
90
|
+
idempotency_key: nil)
|
|
91
|
+
@api_call
|
|
92
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
93
|
+
'/stores/{storeId}/webhooks',
|
|
94
|
+
Server::DEFAULT)
|
|
95
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
96
|
+
.is_required(true)
|
|
97
|
+
.should_encode(true))
|
|
98
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
99
|
+
.body_param(new_parameter(body)
|
|
100
|
+
.is_required(true))
|
|
101
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
102
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
103
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
104
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
105
|
+
.response(new_response_handler
|
|
106
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
107
|
+
.deserialize_into(Webhook.method(:from_hash))
|
|
108
|
+
.is_api_response(true)
|
|
109
|
+
.local_error_template('400',
|
|
110
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
111
|
+
ApiErrorException)
|
|
112
|
+
.local_error_template('401',
|
|
113
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
114
|
+
ApiErrorException)
|
|
115
|
+
.local_error_template('403',
|
|
116
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
117
|
+
APIException)
|
|
118
|
+
.local_error_template('404',
|
|
119
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
120
|
+
APIException)
|
|
121
|
+
.local_error_template('409',
|
|
122
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
123
|
+
APIException)
|
|
124
|
+
.local_error_template('429',
|
|
125
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
126
|
+
APIException)
|
|
127
|
+
.local_error_template('500',
|
|
128
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
129
|
+
APIException)
|
|
130
|
+
.local_error_template('503',
|
|
131
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
132
|
+
APIException)
|
|
133
|
+
.local_error_template('504',
|
|
134
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
135
|
+
APIException)
|
|
136
|
+
.local_error_template('default',
|
|
137
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
138
|
+
APIException))
|
|
139
|
+
.execute
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Retrieves a specific webhook by ID.
|
|
143
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
144
|
+
# of the store.
|
|
145
|
+
# @param [UUID | String] id Required parameter: The unique identifier of the
|
|
146
|
+
# resource.
|
|
147
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
148
|
+
def get_webhook(store_id,
|
|
149
|
+
id)
|
|
150
|
+
@api_call
|
|
151
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
152
|
+
'/stores/{storeId}/webhooks/{id}',
|
|
153
|
+
Server::DEFAULT)
|
|
154
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
155
|
+
.is_required(true)
|
|
156
|
+
.should_encode(true))
|
|
157
|
+
.template_param(new_parameter(id, key: 'id')
|
|
158
|
+
.is_required(true)
|
|
159
|
+
.should_encode(true))
|
|
160
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
161
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
162
|
+
.response(new_response_handler
|
|
163
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
164
|
+
.deserialize_into(Webhook.method(:from_hash))
|
|
165
|
+
.is_api_response(true)
|
|
166
|
+
.local_error_template('401',
|
|
167
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
168
|
+
ApiErrorException)
|
|
169
|
+
.local_error_template('404',
|
|
170
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
171
|
+
ApiErrorException)
|
|
172
|
+
.local_error_template('400',
|
|
173
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
174
|
+
APIException)
|
|
175
|
+
.local_error_template('403',
|
|
176
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
177
|
+
APIException)
|
|
178
|
+
.local_error_template('409',
|
|
179
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
180
|
+
APIException)
|
|
181
|
+
.local_error_template('429',
|
|
182
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
183
|
+
APIException)
|
|
184
|
+
.local_error_template('500',
|
|
185
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
186
|
+
APIException)
|
|
187
|
+
.local_error_template('503',
|
|
188
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
189
|
+
APIException)
|
|
190
|
+
.local_error_template('504',
|
|
191
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
192
|
+
APIException)
|
|
193
|
+
.local_error_template('default',
|
|
194
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
195
|
+
APIException))
|
|
196
|
+
.execute
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Updates an existing webhook. All fields are optional; omitted fields are
|
|
200
|
+
# left unchanged. Duplicate URLs within the same scope are not allowed.
|
|
201
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
202
|
+
# of the store.
|
|
203
|
+
# @param [UUID | String] id Required parameter: The unique identifier of the
|
|
204
|
+
# resource.
|
|
205
|
+
# @param [WebhookUpdateRequest] body Required parameter: Request payload for
|
|
206
|
+
# updating a store webhook subscription.
|
|
207
|
+
# @param [String] idempotency_key Optional parameter: An optional
|
|
208
|
+
# idempotency key to prevent double charges and duplicate operations. We
|
|
209
|
+
# recommend a randomly generated UUID (v4).
|
|
210
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
211
|
+
def update_webhook(store_id,
|
|
212
|
+
id,
|
|
213
|
+
body,
|
|
214
|
+
idempotency_key: nil)
|
|
215
|
+
@api_call
|
|
216
|
+
.request(new_request_builder(HttpMethodEnum::PATCH,
|
|
217
|
+
'/stores/{storeId}/webhooks/{id}',
|
|
218
|
+
Server::DEFAULT)
|
|
219
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
220
|
+
.is_required(true)
|
|
221
|
+
.should_encode(true))
|
|
222
|
+
.template_param(new_parameter(id, key: 'id')
|
|
223
|
+
.is_required(true)
|
|
224
|
+
.should_encode(true))
|
|
225
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
226
|
+
.body_param(new_parameter(body)
|
|
227
|
+
.is_required(true))
|
|
228
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
229
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
230
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
231
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
232
|
+
.response(new_response_handler
|
|
233
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
234
|
+
.deserialize_into(Webhook.method(:from_hash))
|
|
235
|
+
.is_api_response(true)
|
|
236
|
+
.local_error_template('400',
|
|
237
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
238
|
+
ApiErrorException)
|
|
239
|
+
.local_error_template('401',
|
|
240
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
241
|
+
ApiErrorException)
|
|
242
|
+
.local_error_template('403',
|
|
243
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
244
|
+
ApiErrorException)
|
|
245
|
+
.local_error_template('404',
|
|
246
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
247
|
+
ApiErrorException)
|
|
248
|
+
.local_error_template('409',
|
|
249
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
250
|
+
APIException)
|
|
251
|
+
.local_error_template('429',
|
|
252
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
253
|
+
APIException)
|
|
254
|
+
.local_error_template('500',
|
|
255
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
256
|
+
APIException)
|
|
257
|
+
.local_error_template('503',
|
|
258
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
259
|
+
APIException)
|
|
260
|
+
.local_error_template('504',
|
|
261
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
262
|
+
APIException)
|
|
263
|
+
.local_error_template('default',
|
|
264
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
265
|
+
APIException))
|
|
266
|
+
.execute
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Deactivates and deletes a webhook subscription.
|
|
270
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
271
|
+
# of the store.
|
|
272
|
+
# @param [UUID | String] id Required parameter: The unique identifier of the
|
|
273
|
+
# resource.
|
|
274
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
275
|
+
def delete_webhook(store_id,
|
|
276
|
+
id)
|
|
277
|
+
@api_call
|
|
278
|
+
.request(new_request_builder(HttpMethodEnum::DELETE,
|
|
279
|
+
'/stores/{storeId}/webhooks/{id}',
|
|
280
|
+
Server::DEFAULT)
|
|
281
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
282
|
+
.is_required(true)
|
|
283
|
+
.should_encode(true))
|
|
284
|
+
.template_param(new_parameter(id, key: 'id')
|
|
285
|
+
.is_required(true)
|
|
286
|
+
.should_encode(true))
|
|
287
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
288
|
+
.response(new_response_handler
|
|
289
|
+
.is_response_void(true)
|
|
290
|
+
.is_api_response(true)
|
|
291
|
+
.local_error_template('401',
|
|
292
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
293
|
+
ApiErrorException)
|
|
294
|
+
.local_error_template('403',
|
|
295
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
296
|
+
ApiErrorException)
|
|
297
|
+
.local_error_template('404',
|
|
298
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
299
|
+
ApiErrorException)
|
|
300
|
+
.local_error_template('400',
|
|
301
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
302
|
+
APIException)
|
|
303
|
+
.local_error_template('409',
|
|
304
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
305
|
+
APIException)
|
|
306
|
+
.local_error_template('429',
|
|
307
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
308
|
+
APIException)
|
|
309
|
+
.local_error_template('500',
|
|
310
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
311
|
+
APIException)
|
|
312
|
+
.local_error_template('503',
|
|
313
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
314
|
+
APIException)
|
|
315
|
+
.local_error_template('504',
|
|
316
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
317
|
+
APIException)
|
|
318
|
+
.local_error_template('default',
|
|
319
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
320
|
+
APIException))
|
|
321
|
+
.execute
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
# Returns a paginated list of webhook delivery events for the specified
|
|
325
|
+
# webhook. Each event captures the result of a single webhook delivery
|
|
326
|
+
# attempt.
|
|
327
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
328
|
+
# of the store.
|
|
329
|
+
# @param [UUID | String] id Required parameter: The unique identifier of the
|
|
330
|
+
# resource.
|
|
331
|
+
# @param [Integer] limit Optional parameter: Maximum number of resources to
|
|
332
|
+
# return in one page.
|
|
333
|
+
# @param [UUID | String] cursor Optional parameter: Cursor pointing to the
|
|
334
|
+
# resource after which pagination should continue.
|
|
335
|
+
# @param [CursorDirectionQuery] cursor_direction Optional parameter:
|
|
336
|
+
# Pagination direction relative to the supplied cursor.
|
|
337
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
338
|
+
def list_webhook_events(store_id,
|
|
339
|
+
id,
|
|
340
|
+
limit: 10,
|
|
341
|
+
cursor: nil,
|
|
342
|
+
cursor_direction: CursorDirectionQuery::DESC)
|
|
343
|
+
@api_call
|
|
344
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
345
|
+
'/stores/{storeId}/webhooks/{id}/events',
|
|
346
|
+
Server::DEFAULT)
|
|
347
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
348
|
+
.is_required(true)
|
|
349
|
+
.should_encode(true))
|
|
350
|
+
.template_param(new_parameter(id, key: 'id')
|
|
351
|
+
.is_required(true)
|
|
352
|
+
.should_encode(true))
|
|
353
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
354
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
355
|
+
.query_param(new_parameter(cursor_direction, key: 'cursor_direction'))
|
|
356
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
357
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
358
|
+
.response(new_response_handler
|
|
359
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
360
|
+
.deserialize_into(WebhookEventList.method(:from_hash))
|
|
361
|
+
.is_api_response(true)
|
|
362
|
+
.local_error_template('401',
|
|
363
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
364
|
+
ApiErrorException)
|
|
365
|
+
.local_error_template('403',
|
|
366
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
367
|
+
ApiErrorException)
|
|
368
|
+
.local_error_template('404',
|
|
369
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
370
|
+
ApiErrorException)
|
|
371
|
+
.local_error_template('400',
|
|
372
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
373
|
+
APIException)
|
|
374
|
+
.local_error_template('409',
|
|
375
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
376
|
+
APIException)
|
|
377
|
+
.local_error_template('429',
|
|
378
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
379
|
+
APIException)
|
|
380
|
+
.local_error_template('500',
|
|
381
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
382
|
+
APIException)
|
|
383
|
+
.local_error_template('503',
|
|
384
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
385
|
+
APIException)
|
|
386
|
+
.local_error_template('504',
|
|
387
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
388
|
+
APIException)
|
|
389
|
+
.local_error_template('default',
|
|
390
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
391
|
+
APIException))
|
|
392
|
+
.execute
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
# Re-sends the webhook payload for a previously delivered (or failed) event.
|
|
396
|
+
# Returns 202 Accepted immediately; delivery is asynchronous.
|
|
397
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
398
|
+
# of the store.
|
|
399
|
+
# @param [UUID | String] id Required parameter: The unique identifier of the
|
|
400
|
+
# resource.
|
|
401
|
+
# @param [UUID | String] event_id Required parameter: The unique identifier
|
|
402
|
+
# of the webhook event.
|
|
403
|
+
# @param [String] idempotency_key Optional parameter: An optional
|
|
404
|
+
# idempotency key to prevent double charges and duplicate operations. We
|
|
405
|
+
# recommend a randomly generated UUID (v4).
|
|
406
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
407
|
+
def redeliver_webhook_event(store_id,
|
|
408
|
+
id,
|
|
409
|
+
event_id,
|
|
410
|
+
idempotency_key: nil)
|
|
411
|
+
@api_call
|
|
412
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
413
|
+
'/stores/{storeId}/webhooks/{id}/events/{eventId}/redeliver',
|
|
414
|
+
Server::DEFAULT)
|
|
415
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
416
|
+
.is_required(true)
|
|
417
|
+
.should_encode(true))
|
|
418
|
+
.template_param(new_parameter(id, key: 'id')
|
|
419
|
+
.is_required(true)
|
|
420
|
+
.should_encode(true))
|
|
421
|
+
.template_param(new_parameter(event_id, key: 'eventId')
|
|
422
|
+
.is_required(true)
|
|
423
|
+
.should_encode(true))
|
|
424
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
425
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
426
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
427
|
+
.response(new_response_handler
|
|
428
|
+
.deserializer(APIHelper.method(:json_deserialize))
|
|
429
|
+
.is_api_response(true)
|
|
430
|
+
.local_error_template('401',
|
|
431
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
432
|
+
ApiErrorException)
|
|
433
|
+
.local_error_template('403',
|
|
434
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
435
|
+
ApiErrorException)
|
|
436
|
+
.local_error_template('404',
|
|
437
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
438
|
+
ApiErrorException)
|
|
439
|
+
.local_error_template('400',
|
|
440
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
441
|
+
APIException)
|
|
442
|
+
.local_error_template('409',
|
|
443
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
444
|
+
APIException)
|
|
445
|
+
.local_error_template('429',
|
|
446
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
447
|
+
APIException)
|
|
448
|
+
.local_error_template('500',
|
|
449
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
450
|
+
APIException)
|
|
451
|
+
.local_error_template('503',
|
|
452
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
453
|
+
APIException)
|
|
454
|
+
.local_error_template('504',
|
|
455
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
456
|
+
APIException)
|
|
457
|
+
.local_error_template('default',
|
|
458
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
459
|
+
APIException))
|
|
460
|
+
.execute
|
|
461
|
+
end
|
|
462
|
+
end
|
|
463
|
+
end
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# univapay_client_sdk
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for Univapay
|
|
4
|
+
# by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module UnivapayClientSdk
|
|
7
|
+
# univapay_client_sdk client class.
|
|
8
|
+
class Client
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
attr_reader :config, :auth_managers
|
|
11
|
+
|
|
12
|
+
def user_agent_detail
|
|
13
|
+
config.user_agent_detail
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Access to charges controller.
|
|
17
|
+
# @return [ChargesApi] Returns the controller instance.
|
|
18
|
+
def charges
|
|
19
|
+
@charges ||= ChargesApi.new @global_configuration
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Access to transaction_tokens controller.
|
|
23
|
+
# @return [TransactionTokensApi] Returns the controller instance.
|
|
24
|
+
def transaction_tokens
|
|
25
|
+
@transaction_tokens ||= TransactionTokensApi.new @global_configuration
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Access to refunds controller.
|
|
29
|
+
# @return [RefundsApi] Returns the controller instance.
|
|
30
|
+
def refunds
|
|
31
|
+
@refunds ||= RefundsApi.new @global_configuration
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Access to subscriptions controller.
|
|
35
|
+
# @return [SubscriptionsApi] Returns the controller instance.
|
|
36
|
+
def subscriptions
|
|
37
|
+
@subscriptions ||= SubscriptionsApi.new @global_configuration
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Access to cancels controller.
|
|
41
|
+
# @return [CancelsApi] Returns the controller instance.
|
|
42
|
+
def cancels
|
|
43
|
+
@cancels ||= CancelsApi.new @global_configuration
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Access to merchants controller.
|
|
47
|
+
# @return [MerchantsApi] Returns the controller instance.
|
|
48
|
+
def merchants
|
|
49
|
+
@merchants ||= MerchantsApi.new @global_configuration
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Access to stores controller.
|
|
53
|
+
# @return [StoresApi] Returns the controller instance.
|
|
54
|
+
def stores
|
|
55
|
+
@stores ||= StoresApi.new @global_configuration
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Access to webhooks controller.
|
|
59
|
+
# @return [WebhooksApi] Returns the controller instance.
|
|
60
|
+
def webhooks
|
|
61
|
+
@webhooks ||= WebhooksApi.new @global_configuration
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def initialize(
|
|
65
|
+
connection: nil, adapter: :net_http_persistent, timeout: 30,
|
|
66
|
+
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
67
|
+
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
68
|
+
retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
|
|
69
|
+
logging_configuration: nil, environment: Environment::PRODUCTION,
|
|
70
|
+
base_url: 'https://api.univapay.com', bearer_auth_credentials: nil,
|
|
71
|
+
config: nil
|
|
72
|
+
)
|
|
73
|
+
@config = if config.nil?
|
|
74
|
+
Configuration.new(
|
|
75
|
+
connection: connection, adapter: adapter, timeout: timeout,
|
|
76
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
|
77
|
+
backoff_factor: backoff_factor,
|
|
78
|
+
retry_statuses: retry_statuses,
|
|
79
|
+
retry_methods: retry_methods, http_callback: http_callback,
|
|
80
|
+
proxy_settings: proxy_settings,
|
|
81
|
+
logging_configuration: logging_configuration,
|
|
82
|
+
environment: environment, base_url: base_url,
|
|
83
|
+
bearer_auth_credentials: bearer_auth_credentials
|
|
84
|
+
)
|
|
85
|
+
else
|
|
86
|
+
config
|
|
87
|
+
end
|
|
88
|
+
user_agent_params = BaseApi.user_agent_parameters
|
|
89
|
+
|
|
90
|
+
@global_configuration = GlobalConfiguration.new(client_configuration: @config)
|
|
91
|
+
.base_uri_executor(@config.method(:get_base_uri))
|
|
92
|
+
.global_errors(BaseApi::GLOBAL_ERRORS)
|
|
93
|
+
.user_agent(BaseApi.user_agent,
|
|
94
|
+
agent_parameters: user_agent_params)
|
|
95
|
+
|
|
96
|
+
initialize_auth_managers(@global_configuration)
|
|
97
|
+
@global_configuration = @global_configuration.auth_managers(@auth_managers)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Initializes the auth managers hash used for authenticating API calls.
|
|
101
|
+
# @param [GlobalConfiguration] global_config The global configuration of the SDK)
|
|
102
|
+
def initialize_auth_managers(global_config)
|
|
103
|
+
@auth_managers = {}
|
|
104
|
+
http_client_config = global_config.client_configuration
|
|
105
|
+
%w[JWT_TOKEN].each { |auth| @auth_managers[auth] = nil }
|
|
106
|
+
@auth_managers['JWT_TOKEN'] = Oauth2.new(http_client_config.bearer_auth_credentials)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Creates a client directly from environment variables.
|
|
110
|
+
def self.from_env(**overrides)
|
|
111
|
+
default_config = Configuration.build_default_config_from_env
|
|
112
|
+
new_config = default_config.clone_with(**overrides)
|
|
113
|
+
new(config: new_config)
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|