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,178 @@
|
|
|
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
|
+
# An enum for SDK environments.
|
|
8
|
+
class Environment
|
|
9
|
+
# PRODUCTION: Production Server
|
|
10
|
+
ENVIRONMENT = [
|
|
11
|
+
PRODUCTION = 'production'.freeze
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
# Converts a string or symbol into a valid Environment constant.
|
|
15
|
+
def self.from_value(value, default_value = PRODUCTION)
|
|
16
|
+
return default_value if value.nil?
|
|
17
|
+
|
|
18
|
+
default_value
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# An enum for API servers.
|
|
23
|
+
class Server
|
|
24
|
+
SERVER = [
|
|
25
|
+
DEFAULT = 'default'.freeze
|
|
26
|
+
].freeze
|
|
27
|
+
|
|
28
|
+
# Converts a string or symbol into a valid Server constant.
|
|
29
|
+
def self.from_value(value, default_value = DEFAULT)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# All configuration including auth info and base URI for the API access
|
|
37
|
+
# are configured in this class.
|
|
38
|
+
class Configuration < CoreLibrary::HttpClientConfiguration
|
|
39
|
+
# The attribute readers for properties.
|
|
40
|
+
attr_reader :environment, :base_url, :bearer_auth_credentials
|
|
41
|
+
|
|
42
|
+
class << self
|
|
43
|
+
attr_reader :environments
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def initialize(
|
|
47
|
+
connection: nil, adapter: :net_http_persistent, timeout: 30,
|
|
48
|
+
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
|
49
|
+
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
|
50
|
+
retry_methods: %i[get put], http_callback: nil, proxy_settings: nil,
|
|
51
|
+
logging_configuration: nil, environment: Environment::PRODUCTION,
|
|
52
|
+
base_url: 'https://api.univapay.com', bearer_auth_credentials: nil
|
|
53
|
+
)
|
|
54
|
+
super connection: connection, adapter: adapter, timeout: timeout,
|
|
55
|
+
max_retries: max_retries, retry_interval: retry_interval,
|
|
56
|
+
backoff_factor: backoff_factor, retry_statuses: retry_statuses,
|
|
57
|
+
retry_methods: retry_methods, http_callback: http_callback,
|
|
58
|
+
proxy_settings: proxy_settings,
|
|
59
|
+
logging_configuration: logging_configuration
|
|
60
|
+
|
|
61
|
+
# Current API environment
|
|
62
|
+
@environment = String(environment)
|
|
63
|
+
|
|
64
|
+
# Base URL for the API
|
|
65
|
+
@base_url = base_url
|
|
66
|
+
|
|
67
|
+
# The object holding OAuth 2 Bearer token credentials
|
|
68
|
+
@bearer_auth_credentials = bearer_auth_credentials
|
|
69
|
+
|
|
70
|
+
# Initializing OAuth 2 Bearer token credentials with the provided auth parameters
|
|
71
|
+
@bearer_auth_credentials = bearer_auth_credentials
|
|
72
|
+
|
|
73
|
+
# The Http Client to use for making requests.
|
|
74
|
+
set_http_client CoreLibrary::FaradayClient.new(self)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def clone_with(connection: nil, adapter: nil, timeout: nil,
|
|
78
|
+
max_retries: nil, retry_interval: nil, backoff_factor: nil,
|
|
79
|
+
retry_statuses: nil, retry_methods: nil, http_callback: nil,
|
|
80
|
+
proxy_settings: nil, logging_configuration: nil,
|
|
81
|
+
environment: nil, base_url: nil,
|
|
82
|
+
bearer_auth_credentials: nil)
|
|
83
|
+
connection ||= self.connection
|
|
84
|
+
adapter ||= self.adapter
|
|
85
|
+
timeout ||= self.timeout
|
|
86
|
+
max_retries ||= self.max_retries
|
|
87
|
+
retry_interval ||= self.retry_interval
|
|
88
|
+
backoff_factor ||= self.backoff_factor
|
|
89
|
+
retry_statuses ||= self.retry_statuses
|
|
90
|
+
retry_methods ||= self.retry_methods
|
|
91
|
+
http_callback ||= self.http_callback
|
|
92
|
+
proxy_settings ||= self.proxy_settings
|
|
93
|
+
logging_configuration ||= self.logging_configuration
|
|
94
|
+
environment ||= self.environment
|
|
95
|
+
base_url ||= self.base_url
|
|
96
|
+
bearer_auth_credentials ||= self.bearer_auth_credentials
|
|
97
|
+
|
|
98
|
+
Configuration.new(connection: connection, adapter: adapter,
|
|
99
|
+
timeout: timeout, max_retries: max_retries,
|
|
100
|
+
retry_interval: retry_interval,
|
|
101
|
+
backoff_factor: backoff_factor,
|
|
102
|
+
retry_statuses: retry_statuses,
|
|
103
|
+
retry_methods: retry_methods,
|
|
104
|
+
http_callback: http_callback,
|
|
105
|
+
proxy_settings: proxy_settings,
|
|
106
|
+
logging_configuration: logging_configuration,
|
|
107
|
+
environment: environment, base_url: base_url,
|
|
108
|
+
bearer_auth_credentials: bearer_auth_credentials)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# All the environments the SDK can run in.
|
|
113
|
+
ENVIRONMENTS = {
|
|
114
|
+
Environment::PRODUCTION => {
|
|
115
|
+
Server::DEFAULT => '{baseUrl}'
|
|
116
|
+
}
|
|
117
|
+
}.freeze
|
|
118
|
+
|
|
119
|
+
# Generates the appropriate base URI for the environment and the server.
|
|
120
|
+
# @param [Configuration::Server] server The server enum for which the base URI is
|
|
121
|
+
# required.
|
|
122
|
+
# @return [String] The base URI.
|
|
123
|
+
def get_base_uri(server = Server::DEFAULT)
|
|
124
|
+
parameters = {
|
|
125
|
+
'baseUrl' => { 'value' => base_url, 'encode' => false }
|
|
126
|
+
}
|
|
127
|
+
APIHelper.append_url_with_template_parameters(
|
|
128
|
+
ENVIRONMENTS[environment][server], parameters
|
|
129
|
+
)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Builds a Configuration instance using environment variables.
|
|
133
|
+
def self.build_default_config_from_env
|
|
134
|
+
# === Core environment ===
|
|
135
|
+
environment = Environment.from_value(ENV.fetch('ENVIRONMENT', 'production'))
|
|
136
|
+
base_url = ENV.fetch('BASE_URL', 'https://api.univapay.com')
|
|
137
|
+
timeout = (ENV['TIMEOUT'] || 30).to_f
|
|
138
|
+
max_retries = (ENV['MAX_RETRIES'] || 0).to_i
|
|
139
|
+
retry_interval = (ENV['RETRY_INTERVAL'] || 1).to_f
|
|
140
|
+
backoff_factor = (ENV['BACKOFF_FACTOR'] || 2).to_f
|
|
141
|
+
retry_statuses = ENV.fetch('RETRY_STATUSES',
|
|
142
|
+
'[408, 413, 429, 500, 502, 503, 504, 521, 522, 524]').gsub(/[\[\]]/, '')
|
|
143
|
+
.split(',')
|
|
144
|
+
.map(&:strip)
|
|
145
|
+
.map do |item|
|
|
146
|
+
item.match?(/\A\d+\z/) ? item.to_i : item.downcase
|
|
147
|
+
end
|
|
148
|
+
retry_methods = ENV.fetch('RETRY_METHODS', '%i[get put]').gsub(/[\[\]]/, '')
|
|
149
|
+
.split(',')
|
|
150
|
+
.map(&:strip)
|
|
151
|
+
.map do |item|
|
|
152
|
+
item.match?(/\A\d+\z/) ? item.to_i : item.downcase
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# === Authentication credentials ===
|
|
156
|
+
bearer_auth_credentials = BearerAuthCredentials.from_env
|
|
157
|
+
|
|
158
|
+
# === Proxy settings ===
|
|
159
|
+
proxy_settings = ProxySettings.from_env
|
|
160
|
+
# === Logging Configuration ===
|
|
161
|
+
logging_configuration = LoggingConfiguration.from_env if LoggingConfiguration.any_logging_configured?
|
|
162
|
+
|
|
163
|
+
Configuration.new(
|
|
164
|
+
environment: environment,
|
|
165
|
+
base_url: base_url,
|
|
166
|
+
timeout: timeout,
|
|
167
|
+
max_retries: max_retries,
|
|
168
|
+
retry_interval: retry_interval,
|
|
169
|
+
backoff_factor: backoff_factor,
|
|
170
|
+
retry_statuses: retry_statuses,
|
|
171
|
+
retry_methods: retry_methods,
|
|
172
|
+
bearer_auth_credentials: bearer_auth_credentials,
|
|
173
|
+
proxy_settings: proxy_settings,
|
|
174
|
+
logging_configuration: logging_configuration
|
|
175
|
+
)
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
# Represents an unrecognized or unsupported event during processing.
|
|
8
|
+
class UnknownEvent
|
|
9
|
+
# @return [Array<String>]
|
|
10
|
+
attr_reader :errors
|
|
11
|
+
|
|
12
|
+
# Initialize with the errors that caused the failure.
|
|
13
|
+
# @param errors [Array<String>] A list of error messages describing the reasons for verification failure.
|
|
14
|
+
def initialize(errors)
|
|
15
|
+
@errors = errors
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Provides a user-friendly string representation of the failure.
|
|
19
|
+
# @return [String]
|
|
20
|
+
def to_s
|
|
21
|
+
class_name = self.class.name.split('::').last
|
|
22
|
+
"<#{class_name} errors: #{@errors}>"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
26
|
+
# @return [String]
|
|
27
|
+
def inspect
|
|
28
|
+
class_name = self.class.name.split('::').last
|
|
29
|
+
"<#{class_name} errors: #{@errors.inspect}>"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# BankTransferHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming bank-transfer events into strongly typed objects.
|
|
9
|
+
class BankTransferHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the BankTransferHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[BankTransferStatusWebhookCallback, UnknownEvent]
|
|
18
|
+
# BankTransferStatusWebhookCallback for successful parsing;
|
|
19
|
+
#
|
|
20
|
+
# UnknownEvent for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:BankTransfer)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# CancelHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming cancel events into strongly typed objects.
|
|
9
|
+
class CancelHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the CancelHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[CancelWebhookCallback, UnknownEvent]
|
|
18
|
+
# CancelWebhookCallback for successful parsing;
|
|
19
|
+
# UnknownEvent for
|
|
20
|
+
# unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:Cancel)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# ChargeFinishedHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming chargeFinished events into strongly typed objects.
|
|
9
|
+
class ChargeFinishedHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the ChargeFinishedHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[ChargeFinishedWebhookCallback, UnknownEvent]
|
|
18
|
+
# ChargeFinishedWebhookCallback for successful parsing;
|
|
19
|
+
# UnknownEvent
|
|
20
|
+
# for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:ChargeFinished)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# ChargeUpdatedHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming chargeUpdated events into strongly typed objects.
|
|
9
|
+
class ChargeUpdatedHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the ChargeUpdatedHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[ChargeUpdatedWebhookCallback, UnknownEvent]
|
|
18
|
+
# ChargeUpdatedWebhookCallback for successful parsing;
|
|
19
|
+
# UnknownEvent
|
|
20
|
+
# for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:ChargeUpdated)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# CustomsHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming customs events into strongly typed objects.
|
|
9
|
+
class CustomsHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the CustomsHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[CustomsDeclarationWebhookCallback, UnknownEvent]
|
|
18
|
+
# CustomsDeclarationWebhookCallback for successful parsing;
|
|
19
|
+
#
|
|
20
|
+
# UnknownEvent for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:Customs)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# RecurringTokenDeletedHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming recurringTokenDeleted events into strongly typed objects.
|
|
9
|
+
class RecurringTokenDeletedHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the RecurringTokenDeletedHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[RecurringTokenDeletedWebhookCallback, UnknownEvent]
|
|
18
|
+
# RecurringTokenDeletedWebhookCallback for successful parsing;
|
|
19
|
+
#
|
|
20
|
+
# UnknownEvent for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:RecurringTokenDeleted)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# RefundHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming refund events into strongly typed objects.
|
|
9
|
+
class RefundHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the RefundHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[RefundWebhookCallback, UnknownEvent]
|
|
18
|
+
# RefundWebhookCallback for successful parsing;
|
|
19
|
+
# UnknownEvent for
|
|
20
|
+
# unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:Refund)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# SubscriptionCanceledHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming subscriptionCanceled events into strongly typed objects.
|
|
9
|
+
class SubscriptionCanceledHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the SubscriptionCanceledHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[SubscriptionCanceledWebhookCallback, UnknownEvent]
|
|
18
|
+
# SubscriptionCanceledWebhookCallback for successful parsing;
|
|
19
|
+
#
|
|
20
|
+
# UnknownEvent for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:SubscriptionCanceled)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# SubscriptionCompletedHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming subscriptionCompleted events into strongly typed objects.
|
|
9
|
+
class SubscriptionCompletedHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the SubscriptionCompletedHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[SubscriptionCompletedWebhookCallback, UnknownEvent]
|
|
18
|
+
# SubscriptionCompletedWebhookCallback for successful parsing;
|
|
19
|
+
#
|
|
20
|
+
# UnknownEvent for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:SubscriptionCompleted)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# SubscriptionCreatedHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming subscriptionCreated events into strongly typed objects.
|
|
9
|
+
class SubscriptionCreatedHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the SubscriptionCreatedHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[SubscriptionCreatedWebhookCallback, UnknownEvent]
|
|
18
|
+
# SubscriptionCreatedWebhookCallback for successful parsing;
|
|
19
|
+
#
|
|
20
|
+
# UnknownEvent for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:SubscriptionCreated)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# SubscriptionFailureHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming subscriptionFailure events into strongly typed objects.
|
|
9
|
+
class SubscriptionFailureHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the SubscriptionFailureHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[SubscriptionFailureWebhookCallback, UnknownEvent]
|
|
18
|
+
# SubscriptionFailureWebhookCallback for successful parsing;
|
|
19
|
+
#
|
|
20
|
+
# UnknownEvent for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:SubscriptionFailure)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
# SubscriptionPaymentHandler is responsible for verifying request signatures
|
|
8
|
+
# and parsing incoming subscriptionPayment events into strongly typed objects.
|
|
9
|
+
class SubscriptionPaymentHandler
|
|
10
|
+
include CoreLibrary
|
|
11
|
+
# Creates a new instance of the SubscriptionPaymentHandler.
|
|
12
|
+
def initialize; end
|
|
13
|
+
|
|
14
|
+
# Parse the event.
|
|
15
|
+
#
|
|
16
|
+
# @param [Rack::Request] request The incoming HTTP request containing the event payload.
|
|
17
|
+
# @return[SubscriptionPaymentWebhookCallback, UnknownEvent]
|
|
18
|
+
# SubscriptionPaymentWebhookCallback for successful parsing;
|
|
19
|
+
#
|
|
20
|
+
# UnknownEvent for unknown events.
|
|
21
|
+
def parse_event(request)
|
|
22
|
+
return UnknownEvent.new(['Invalid request env.']) unless request.respond_to?(:env) && request.env.is_a?(Hash)
|
|
23
|
+
|
|
24
|
+
raw_body = RackRequestHelper.read_raw_body(request)
|
|
25
|
+
return UnknownEvent.new(['Invalid request body.']) if raw_body.nil? || raw_body.empty?
|
|
26
|
+
|
|
27
|
+
# Deserialize payload
|
|
28
|
+
begin
|
|
29
|
+
union = UnionTypeLookUp.get(:SubscriptionPayment)
|
|
30
|
+
raw = RackRequestHelper.read_raw_body(request)
|
|
31
|
+
APIHelper.deserialize_union_type(union, raw, false, true)
|
|
32
|
+
rescue StandardError => e
|
|
33
|
+
UnknownEvent.new(['Deserialization failed.', e.message])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|