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,27 @@
|
|
|
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
|
+
# Event type discriminator — always `customs_declaration_finished` for this
|
|
8
|
+
# callback.
|
|
9
|
+
class CustomsDeclarationEvent
|
|
10
|
+
CUSTOMS_DECLARATION_EVENT = [
|
|
11
|
+
# TODO: Write general description for CUSTOMS_DECLARATION_FINISHED
|
|
12
|
+
CUSTOMS_DECLARATION_FINISHED = 'customs_declaration_finished'.freeze
|
|
13
|
+
].freeze
|
|
14
|
+
|
|
15
|
+
def self.validate(value)
|
|
16
|
+
return false if value.nil?
|
|
17
|
+
|
|
18
|
+
CUSTOMS_DECLARATION_EVENT.include?(value)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.from_value(value, default_value = CUSTOMS_DECLARATION_FINISHED)
|
|
22
|
+
return default_value if value.nil?
|
|
23
|
+
|
|
24
|
+
default_value
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
# Request body for updating a customs declaration. Backend patch handling
|
|
8
|
+
# keeps the original `customs`, `certificate_id`, and `certificate_name`
|
|
9
|
+
# values and only accepts a new `merchant_customs_no`.
|
|
10
|
+
class CustomsDeclarationPatchRequest < BaseModel
|
|
11
|
+
SKIP = Object.new
|
|
12
|
+
private_constant :SKIP
|
|
13
|
+
|
|
14
|
+
# Updated merchant customs registration number.
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :merchant_customs_no
|
|
17
|
+
|
|
18
|
+
# A mapping from model property names to API property names.
|
|
19
|
+
def self.names
|
|
20
|
+
@_hash = {} if @_hash.nil?
|
|
21
|
+
@_hash['merchant_customs_no'] = 'merchant_customs_no'
|
|
22
|
+
@_hash
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# An array for optional fields
|
|
26
|
+
def self.optionals
|
|
27
|
+
[]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for nullable fields
|
|
31
|
+
def self.nullables
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def initialize(merchant_customs_no:, additional_properties: nil)
|
|
36
|
+
# Add additional model properties to the instance
|
|
37
|
+
additional_properties = {} if additional_properties.nil?
|
|
38
|
+
|
|
39
|
+
@merchant_customs_no = merchant_customs_no
|
|
40
|
+
@additional_properties = additional_properties
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an instance of the object from a hash.
|
|
44
|
+
def self.from_hash(hash)
|
|
45
|
+
return nil unless hash
|
|
46
|
+
|
|
47
|
+
# Extract variables from the hash.
|
|
48
|
+
merchant_customs_no =
|
|
49
|
+
hash.key?('merchant_customs_no') ? hash['merchant_customs_no'] : nil
|
|
50
|
+
|
|
51
|
+
# Create a new hash for additional properties, removing known properties.
|
|
52
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
53
|
+
|
|
54
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
55
|
+
new_hash, proc { |value| value }
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# Create object from extracted values.
|
|
59
|
+
CustomsDeclarationPatchRequest.new(merchant_customs_no: merchant_customs_no,
|
|
60
|
+
additional_properties: additional_properties)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Provides a human-readable string representation of the object.
|
|
64
|
+
def to_s
|
|
65
|
+
class_name = self.class.name.split('::').last
|
|
66
|
+
"<#{class_name} merchant_customs_no: #{@merchant_customs_no}, additional_properties:"\
|
|
67
|
+
" #{@additional_properties}>"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
71
|
+
def inspect
|
|
72
|
+
class_name = self.class.name.split('::').last
|
|
73
|
+
"<#{class_name} merchant_customs_no: #{@merchant_customs_no.inspect},"\
|
|
74
|
+
" additional_properties: #{@additional_properties}>"
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# univapay_client_sdk
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for Univapay
|
|
4
|
+
# by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module UnivapayClientSdk
|
|
8
|
+
# Webhook envelope whose `data` payload is a CustomsDeclaration resource.
|
|
9
|
+
class CustomsDeclarationWebhookCallback < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Event type discriminator — always `customs_declaration_finished` for this
|
|
14
|
+
# callback.
|
|
15
|
+
# @return [CustomsDeclarationEvent]
|
|
16
|
+
attr_accessor :event
|
|
17
|
+
|
|
18
|
+
# Unique ID of this webhook delivery.
|
|
19
|
+
# @return [UUID | String]
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Timestamp when the event was fired.
|
|
23
|
+
# @return [DateTime]
|
|
24
|
+
attr_accessor :created_on
|
|
25
|
+
|
|
26
|
+
# Customs declaration payload delivered in `customs_declaration_finished`
|
|
27
|
+
# webhooks. Platform-level deliveries may include `platform_id` and
|
|
28
|
+
# `updated_on`.
|
|
29
|
+
# @return [CustomsDeclarationWebhookData]
|
|
30
|
+
attr_accessor :data
|
|
31
|
+
|
|
32
|
+
# A mapping from model property names to API property names.
|
|
33
|
+
def self.names
|
|
34
|
+
@_hash = {} if @_hash.nil?
|
|
35
|
+
@_hash['event'] = 'event'
|
|
36
|
+
@_hash['id'] = 'id'
|
|
37
|
+
@_hash['created_on'] = 'created_on'
|
|
38
|
+
@_hash['data'] = 'data'
|
|
39
|
+
@_hash
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for optional fields
|
|
43
|
+
def self.optionals
|
|
44
|
+
%w[
|
|
45
|
+
event
|
|
46
|
+
data
|
|
47
|
+
]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# An array for nullable fields
|
|
51
|
+
def self.nullables
|
|
52
|
+
[]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def initialize(id:, created_on:, event: SKIP, data: SKIP,
|
|
56
|
+
additional_properties: nil)
|
|
57
|
+
# Add additional model properties to the instance
|
|
58
|
+
additional_properties = {} if additional_properties.nil?
|
|
59
|
+
|
|
60
|
+
@event = event unless event == SKIP
|
|
61
|
+
@id = id
|
|
62
|
+
@created_on = created_on
|
|
63
|
+
@data = data unless data == SKIP
|
|
64
|
+
@additional_properties = additional_properties
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Creates an instance of the object from a hash.
|
|
68
|
+
def self.from_hash(hash)
|
|
69
|
+
return nil unless hash
|
|
70
|
+
|
|
71
|
+
# Extract variables from the hash.
|
|
72
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
73
|
+
created_on = if hash.key?('created_on')
|
|
74
|
+
(DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
|
|
75
|
+
end
|
|
76
|
+
event = hash.key?('event') ? hash['event'] : SKIP
|
|
77
|
+
data = CustomsDeclarationWebhookData.from_hash(hash['data']) if hash['data']
|
|
78
|
+
|
|
79
|
+
# Create a new hash for additional properties, removing known properties.
|
|
80
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
81
|
+
|
|
82
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
83
|
+
new_hash, proc { |value| value }
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# Create object from extracted values.
|
|
87
|
+
CustomsDeclarationWebhookCallback.new(id: id,
|
|
88
|
+
created_on: created_on,
|
|
89
|
+
event: event,
|
|
90
|
+
data: data,
|
|
91
|
+
additional_properties: additional_properties)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def to_custom_created_on
|
|
95
|
+
DateTimeHelper.to_rfc3339(created_on)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Validates an instance of the object from a given value.
|
|
99
|
+
# @param [CustomsDeclarationWebhookCallback | Hash] The value against the validation is performed.
|
|
100
|
+
def self.validate(value)
|
|
101
|
+
if value.instance_of? self
|
|
102
|
+
return (
|
|
103
|
+
APIHelper.valid_type?(value.id,
|
|
104
|
+
->(val) { val.instance_of? String }) and
|
|
105
|
+
APIHelper.valid_type?(value.created_on,
|
|
106
|
+
->(val) { val.instance_of? DateTime })
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
return false unless value.instance_of? Hash
|
|
111
|
+
|
|
112
|
+
(
|
|
113
|
+
APIHelper.valid_type?(value['id'],
|
|
114
|
+
->(val) { val.instance_of? String }) and
|
|
115
|
+
APIHelper.valid_type?(value['created_on'],
|
|
116
|
+
->(val) { val.instance_of? String })
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Provides a human-readable string representation of the object.
|
|
121
|
+
def to_s
|
|
122
|
+
class_name = self.class.name.split('::').last
|
|
123
|
+
"<#{class_name} event: #{@event}, id: #{@id}, created_on: #{@created_on}, data: #{@data},"\
|
|
124
|
+
" additional_properties: #{@additional_properties}>"
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
128
|
+
def inspect
|
|
129
|
+
class_name = self.class.name.split('::').last
|
|
130
|
+
"<#{class_name} event: #{@event.inspect}, id: #{@id.inspect}, created_on:"\
|
|
131
|
+
" #{@created_on.inspect}, data: #{@data.inspect}, additional_properties:"\
|
|
132
|
+
" #{@additional_properties}>"
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
# Customs-declaration-specific webhook payload extension.
|
|
8
|
+
class CustomsDeclarationWebhookCallbackExtension < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Customs declaration payload delivered in `customs_declaration_finished`
|
|
13
|
+
# webhooks. Platform-level deliveries may include `platform_id` and
|
|
14
|
+
# `updated_on`.
|
|
15
|
+
# @return [CustomsDeclarationWebhookData]
|
|
16
|
+
attr_accessor :data
|
|
17
|
+
|
|
18
|
+
# A mapping from model property names to API property names.
|
|
19
|
+
def self.names
|
|
20
|
+
@_hash = {} if @_hash.nil?
|
|
21
|
+
@_hash['data'] = 'data'
|
|
22
|
+
@_hash
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# An array for optional fields
|
|
26
|
+
def self.optionals
|
|
27
|
+
%w[
|
|
28
|
+
data
|
|
29
|
+
]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# An array for nullable fields
|
|
33
|
+
def self.nullables
|
|
34
|
+
[]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def initialize(data: SKIP, additional_properties: nil)
|
|
38
|
+
# Add additional model properties to the instance
|
|
39
|
+
additional_properties = {} if additional_properties.nil?
|
|
40
|
+
|
|
41
|
+
@data = data unless data == SKIP
|
|
42
|
+
@additional_properties = additional_properties
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Creates an instance of the object from a hash.
|
|
46
|
+
def self.from_hash(hash)
|
|
47
|
+
return nil unless hash
|
|
48
|
+
|
|
49
|
+
# Extract variables from the hash.
|
|
50
|
+
data = CustomsDeclarationWebhookData.from_hash(hash['data']) if hash['data']
|
|
51
|
+
|
|
52
|
+
# Create a new hash for additional properties, removing known properties.
|
|
53
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
54
|
+
|
|
55
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
56
|
+
new_hash, proc { |value| value }
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
# Create object from extracted values.
|
|
60
|
+
CustomsDeclarationWebhookCallbackExtension.new(data: data,
|
|
61
|
+
additional_properties: additional_properties)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Provides a human-readable string representation of the object.
|
|
65
|
+
def to_s
|
|
66
|
+
class_name = self.class.name.split('::').last
|
|
67
|
+
"<#{class_name} data: #{@data}, additional_properties: #{@additional_properties}>"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
71
|
+
def inspect
|
|
72
|
+
class_name = self.class.name.split('::').last
|
|
73
|
+
"<#{class_name} data: #{@data.inspect}, additional_properties: #{@additional_properties}>"
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# univapay_client_sdk
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated for Univapay
|
|
4
|
+
# by APIMATIC v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module UnivapayClientSdk
|
|
8
|
+
# Customs declaration payload delivered in `customs_declaration_finished`
|
|
9
|
+
# webhooks. Platform-level deliveries may include `platform_id` and
|
|
10
|
+
# `updated_on`.
|
|
11
|
+
class CustomsDeclarationWebhookData < BaseModel
|
|
12
|
+
SKIP = Object.new
|
|
13
|
+
private_constant :SKIP
|
|
14
|
+
|
|
15
|
+
# Customs declaration identifier.
|
|
16
|
+
# @return [UUID | String]
|
|
17
|
+
attr_accessor :id
|
|
18
|
+
|
|
19
|
+
# Charge identifier associated with the declaration.
|
|
20
|
+
# @return [UUID | String]
|
|
21
|
+
attr_accessor :charge_id
|
|
22
|
+
|
|
23
|
+
# Merchant identifier.
|
|
24
|
+
# @return [UUID | String]
|
|
25
|
+
attr_accessor :merchant_id
|
|
26
|
+
|
|
27
|
+
# Store identifier.
|
|
28
|
+
# @return [UUID | String]
|
|
29
|
+
attr_accessor :store_id
|
|
30
|
+
|
|
31
|
+
# Platform identifier, included on platform-level deliveries.
|
|
32
|
+
# @return [UUID | String]
|
|
33
|
+
attr_accessor :platform_id
|
|
34
|
+
|
|
35
|
+
# Processing mode.
|
|
36
|
+
# @return [String]
|
|
37
|
+
attr_accessor :mode
|
|
38
|
+
|
|
39
|
+
# Gateway that processed the declaration.
|
|
40
|
+
# @return [String]
|
|
41
|
+
attr_accessor :gateway
|
|
42
|
+
|
|
43
|
+
# WeChat customs declaration payload returned by the backend formatter.
|
|
44
|
+
# @return [CustomsDeclarationWebhookDeclaration]
|
|
45
|
+
attr_accessor :declaration
|
|
46
|
+
|
|
47
|
+
# Result payload returned by the customs declaration formatter.
|
|
48
|
+
# @return [CustomsDeclarationWebhookResult]
|
|
49
|
+
attr_accessor :declaration_result
|
|
50
|
+
|
|
51
|
+
# Customs declaration status returned by the backend.
|
|
52
|
+
# @return [CustomsDeclarationWebhookStatus]
|
|
53
|
+
attr_accessor :status
|
|
54
|
+
|
|
55
|
+
# Error payload returned when customs declaration processing fails.
|
|
56
|
+
# @return [CustomsDeclarationWebhookError]
|
|
57
|
+
attr_accessor :error
|
|
58
|
+
|
|
59
|
+
# Timestamp when the declaration was created.
|
|
60
|
+
# @return [DateTime]
|
|
61
|
+
attr_accessor :created_on
|
|
62
|
+
|
|
63
|
+
# Timestamp when the declaration was last updated, included on
|
|
64
|
+
# platform-level deliveries.
|
|
65
|
+
# @return [DateTime]
|
|
66
|
+
attr_accessor :updated_on
|
|
67
|
+
|
|
68
|
+
# A mapping from model property names to API property names.
|
|
69
|
+
def self.names
|
|
70
|
+
@_hash = {} if @_hash.nil?
|
|
71
|
+
@_hash['id'] = 'id'
|
|
72
|
+
@_hash['charge_id'] = 'charge_id'
|
|
73
|
+
@_hash['merchant_id'] = 'merchant_id'
|
|
74
|
+
@_hash['store_id'] = 'store_id'
|
|
75
|
+
@_hash['platform_id'] = 'platform_id'
|
|
76
|
+
@_hash['mode'] = 'mode'
|
|
77
|
+
@_hash['gateway'] = 'gateway'
|
|
78
|
+
@_hash['declaration'] = 'declaration'
|
|
79
|
+
@_hash['declaration_result'] = 'declaration_result'
|
|
80
|
+
@_hash['status'] = 'status'
|
|
81
|
+
@_hash['error'] = 'error'
|
|
82
|
+
@_hash['created_on'] = 'created_on'
|
|
83
|
+
@_hash['updated_on'] = 'updated_on'
|
|
84
|
+
@_hash
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# An array for optional fields
|
|
88
|
+
def self.optionals
|
|
89
|
+
%w[
|
|
90
|
+
id
|
|
91
|
+
charge_id
|
|
92
|
+
merchant_id
|
|
93
|
+
store_id
|
|
94
|
+
platform_id
|
|
95
|
+
mode
|
|
96
|
+
gateway
|
|
97
|
+
declaration
|
|
98
|
+
declaration_result
|
|
99
|
+
status
|
|
100
|
+
error
|
|
101
|
+
created_on
|
|
102
|
+
updated_on
|
|
103
|
+
]
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# An array for nullable fields
|
|
107
|
+
def self.nullables
|
|
108
|
+
%w[
|
|
109
|
+
platform_id
|
|
110
|
+
declaration_result
|
|
111
|
+
error
|
|
112
|
+
updated_on
|
|
113
|
+
]
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def initialize(id: SKIP, charge_id: SKIP, merchant_id: SKIP, store_id: SKIP,
|
|
117
|
+
platform_id: SKIP, mode: SKIP, gateway: SKIP,
|
|
118
|
+
declaration: SKIP, declaration_result: SKIP, status: SKIP,
|
|
119
|
+
error: SKIP, created_on: SKIP, updated_on: SKIP,
|
|
120
|
+
additional_properties: nil)
|
|
121
|
+
# Add additional model properties to the instance
|
|
122
|
+
additional_properties = {} if additional_properties.nil?
|
|
123
|
+
|
|
124
|
+
@id = id unless id == SKIP
|
|
125
|
+
@charge_id = charge_id unless charge_id == SKIP
|
|
126
|
+
@merchant_id = merchant_id unless merchant_id == SKIP
|
|
127
|
+
@store_id = store_id unless store_id == SKIP
|
|
128
|
+
@platform_id = platform_id unless platform_id == SKIP
|
|
129
|
+
@mode = mode unless mode == SKIP
|
|
130
|
+
@gateway = gateway unless gateway == SKIP
|
|
131
|
+
@declaration = declaration unless declaration == SKIP
|
|
132
|
+
@declaration_result = declaration_result unless declaration_result == SKIP
|
|
133
|
+
@status = status unless status == SKIP
|
|
134
|
+
@error = error unless error == SKIP
|
|
135
|
+
@created_on = created_on unless created_on == SKIP
|
|
136
|
+
@updated_on = updated_on unless updated_on == SKIP
|
|
137
|
+
@additional_properties = additional_properties
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Creates an instance of the object from a hash.
|
|
141
|
+
def self.from_hash(hash)
|
|
142
|
+
return nil unless hash
|
|
143
|
+
|
|
144
|
+
# Extract variables from the hash.
|
|
145
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
146
|
+
charge_id = hash.key?('charge_id') ? hash['charge_id'] : SKIP
|
|
147
|
+
merchant_id = hash.key?('merchant_id') ? hash['merchant_id'] : SKIP
|
|
148
|
+
store_id = hash.key?('store_id') ? hash['store_id'] : SKIP
|
|
149
|
+
platform_id = hash.key?('platform_id') ? hash['platform_id'] : SKIP
|
|
150
|
+
mode = hash.key?('mode') ? hash['mode'] : SKIP
|
|
151
|
+
gateway = hash.key?('gateway') ? hash['gateway'] : SKIP
|
|
152
|
+
declaration = CustomsDeclarationWebhookDeclaration.from_hash(hash['declaration']) if
|
|
153
|
+
hash['declaration']
|
|
154
|
+
declaration_result = CustomsDeclarationWebhookResult.from_hash(hash['declaration_result']) if
|
|
155
|
+
hash['declaration_result']
|
|
156
|
+
status = hash.key?('status') ? hash['status'] : SKIP
|
|
157
|
+
error = CustomsDeclarationWebhookError.from_hash(hash['error']) if hash['error']
|
|
158
|
+
created_on = if hash.key?('created_on')
|
|
159
|
+
(DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
|
|
160
|
+
else
|
|
161
|
+
SKIP
|
|
162
|
+
end
|
|
163
|
+
updated_on = if hash.key?('updated_on')
|
|
164
|
+
(DateTimeHelper.from_rfc3339(hash['updated_on']) if hash['updated_on'])
|
|
165
|
+
else
|
|
166
|
+
SKIP
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Create a new hash for additional properties, removing known properties.
|
|
170
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
171
|
+
|
|
172
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
173
|
+
new_hash, proc { |value| value }
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
# Create object from extracted values.
|
|
177
|
+
CustomsDeclarationWebhookData.new(id: id,
|
|
178
|
+
charge_id: charge_id,
|
|
179
|
+
merchant_id: merchant_id,
|
|
180
|
+
store_id: store_id,
|
|
181
|
+
platform_id: platform_id,
|
|
182
|
+
mode: mode,
|
|
183
|
+
gateway: gateway,
|
|
184
|
+
declaration: declaration,
|
|
185
|
+
declaration_result: declaration_result,
|
|
186
|
+
status: status,
|
|
187
|
+
error: error,
|
|
188
|
+
created_on: created_on,
|
|
189
|
+
updated_on: updated_on,
|
|
190
|
+
additional_properties: additional_properties)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def to_custom_created_on
|
|
194
|
+
DateTimeHelper.to_rfc3339(created_on)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
def to_custom_updated_on
|
|
198
|
+
DateTimeHelper.to_rfc3339(updated_on)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Validates an instance of the object from a given value.
|
|
202
|
+
# @param [CustomsDeclarationWebhookData | Hash] The value against the validation is performed.
|
|
203
|
+
def self.validate(value)
|
|
204
|
+
return true if value.instance_of? self
|
|
205
|
+
|
|
206
|
+
return false unless value.instance_of? Hash
|
|
207
|
+
|
|
208
|
+
true
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Provides a human-readable string representation of the object.
|
|
212
|
+
def to_s
|
|
213
|
+
class_name = self.class.name.split('::').last
|
|
214
|
+
"<#{class_name} id: #{@id}, charge_id: #{@charge_id}, merchant_id: #{@merchant_id},"\
|
|
215
|
+
" store_id: #{@store_id}, platform_id: #{@platform_id}, mode: #{@mode}, gateway:"\
|
|
216
|
+
" #{@gateway}, declaration: #{@declaration}, declaration_result: #{@declaration_result},"\
|
|
217
|
+
" status: #{@status}, error: #{@error}, created_on: #{@created_on}, updated_on:"\
|
|
218
|
+
" #{@updated_on}, additional_properties: #{@additional_properties}>"
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
222
|
+
def inspect
|
|
223
|
+
class_name = self.class.name.split('::').last
|
|
224
|
+
"<#{class_name} id: #{@id.inspect}, charge_id: #{@charge_id.inspect}, merchant_id:"\
|
|
225
|
+
" #{@merchant_id.inspect}, store_id: #{@store_id.inspect}, platform_id:"\
|
|
226
|
+
" #{@platform_id.inspect}, mode: #{@mode.inspect}, gateway: #{@gateway.inspect},"\
|
|
227
|
+
" declaration: #{@declaration.inspect}, declaration_result: #{@declaration_result.inspect},"\
|
|
228
|
+
" status: #{@status.inspect}, error: #{@error.inspect}, created_on: #{@created_on.inspect},"\
|
|
229
|
+
" updated_on: #{@updated_on.inspect}, additional_properties: #{@additional_properties}>"
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
# WeChat customs declaration payload returned by the backend formatter.
|
|
8
|
+
class CustomsDeclarationWebhookDeclaration < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# WeChat customs authority code.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :customs
|
|
15
|
+
|
|
16
|
+
# Merchant customs registration number.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :merchant_customs_no
|
|
19
|
+
|
|
20
|
+
# Customer certificate or passport identifier.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :certificate_id
|
|
23
|
+
|
|
24
|
+
# Customer name as provided to customs.
|
|
25
|
+
# @return [String]
|
|
26
|
+
attr_accessor :certificate_name
|
|
27
|
+
|
|
28
|
+
# A mapping from model property names to API property names.
|
|
29
|
+
def self.names
|
|
30
|
+
@_hash = {} if @_hash.nil?
|
|
31
|
+
@_hash['customs'] = 'customs'
|
|
32
|
+
@_hash['merchant_customs_no'] = 'merchant_customs_no'
|
|
33
|
+
@_hash['certificate_id'] = 'certificate_id'
|
|
34
|
+
@_hash['certificate_name'] = 'certificate_name'
|
|
35
|
+
@_hash
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# An array for optional fields
|
|
39
|
+
def self.optionals
|
|
40
|
+
%w[
|
|
41
|
+
customs
|
|
42
|
+
merchant_customs_no
|
|
43
|
+
certificate_id
|
|
44
|
+
certificate_name
|
|
45
|
+
]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# An array for nullable fields
|
|
49
|
+
def self.nullables
|
|
50
|
+
[]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def initialize(customs: SKIP, merchant_customs_no: SKIP,
|
|
54
|
+
certificate_id: SKIP, certificate_name: SKIP,
|
|
55
|
+
additional_properties: nil)
|
|
56
|
+
# Add additional model properties to the instance
|
|
57
|
+
additional_properties = {} if additional_properties.nil?
|
|
58
|
+
|
|
59
|
+
@customs = customs unless customs == SKIP
|
|
60
|
+
@merchant_customs_no = merchant_customs_no unless merchant_customs_no == SKIP
|
|
61
|
+
@certificate_id = certificate_id unless certificate_id == SKIP
|
|
62
|
+
@certificate_name = certificate_name unless certificate_name == SKIP
|
|
63
|
+
@additional_properties = additional_properties
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Creates an instance of the object from a hash.
|
|
67
|
+
def self.from_hash(hash)
|
|
68
|
+
return nil unless hash
|
|
69
|
+
|
|
70
|
+
# Extract variables from the hash.
|
|
71
|
+
customs = hash.key?('customs') ? hash['customs'] : SKIP
|
|
72
|
+
merchant_customs_no =
|
|
73
|
+
hash.key?('merchant_customs_no') ? hash['merchant_customs_no'] : SKIP
|
|
74
|
+
certificate_id =
|
|
75
|
+
hash.key?('certificate_id') ? hash['certificate_id'] : SKIP
|
|
76
|
+
certificate_name =
|
|
77
|
+
hash.key?('certificate_name') ? hash['certificate_name'] : SKIP
|
|
78
|
+
|
|
79
|
+
# Create a new hash for additional properties, removing known properties.
|
|
80
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
81
|
+
|
|
82
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
83
|
+
new_hash, proc { |value| value }
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# Create object from extracted values.
|
|
87
|
+
CustomsDeclarationWebhookDeclaration.new(customs: customs,
|
|
88
|
+
merchant_customs_no: merchant_customs_no,
|
|
89
|
+
certificate_id: certificate_id,
|
|
90
|
+
certificate_name: certificate_name,
|
|
91
|
+
additional_properties: additional_properties)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Validates an instance of the object from a given value.
|
|
95
|
+
# @param [CustomsDeclarationWebhookDeclaration | Hash] The value against the validation is performed.
|
|
96
|
+
def self.validate(value)
|
|
97
|
+
return true if value.instance_of? self
|
|
98
|
+
|
|
99
|
+
return false unless value.instance_of? Hash
|
|
100
|
+
|
|
101
|
+
true
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Provides a human-readable string representation of the object.
|
|
105
|
+
def to_s
|
|
106
|
+
class_name = self.class.name.split('::').last
|
|
107
|
+
"<#{class_name} customs: #{@customs}, merchant_customs_no: #{@merchant_customs_no},"\
|
|
108
|
+
" certificate_id: #{@certificate_id}, certificate_name: #{@certificate_name},"\
|
|
109
|
+
" additional_properties: #{@additional_properties}>"
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
113
|
+
def inspect
|
|
114
|
+
class_name = self.class.name.split('::').last
|
|
115
|
+
"<#{class_name} customs: #{@customs.inspect}, merchant_customs_no:"\
|
|
116
|
+
" #{@merchant_customs_no.inspect}, certificate_id: #{@certificate_id.inspect},"\
|
|
117
|
+
" certificate_name: #{@certificate_name.inspect}, additional_properties:"\
|
|
118
|
+
" #{@additional_properties}>"
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|