univapay-client-sdk 1.0.0
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 +212 -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 +909 -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 +128 -0
- data/lib/univapay_client_sdk/configuration.rb +179 -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_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/customs_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/refund_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/subscription_handler.rb +37 -0
- data/lib/univapay_client_sdk/events/webhooks/token_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/extensions.rb +127 -0
- data/lib/univapay_client_sdk/http/api_response.rb +19 -0
- data/lib/univapay_client_sdk/http/auth/oauth_2.rb +58 -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_event.rb +36 -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_webhook_event.rb +138 -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/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_create_request.rb +216 -0
- data/lib/univapay_client_sdk/models/subscription_event.rb +54 -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_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_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/subscription_webhook_event.rb +143 -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 +230 -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 +146 -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_event.rb +59 -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_webhook_event.rb +144 -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 +182 -0
- data/lib/univapay_client_sdk.rb +285 -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 +565 -0
- data/test/apis/test_error_messages.rb +38 -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_handler.rb +138 -0
- data/test/events/webhooks/test_customs_handler.rb +100 -0
- data/test/events/webhooks/test_refund_handler.rb +95 -0
- data/test/events/webhooks/test_subscription_handler.rb +346 -0
- data/test/events/webhooks/test_token_handler.rb +332 -0
- data/test/framework_integrations/rails_app_test_helper.rb +14 -0
- data/test/framework_integrations/webhooks/apps/hanami_charge_app.rb +61 -0
- data/test/framework_integrations/webhooks/apps/rails_charge_app.rb +24 -0
- data/test/framework_integrations/webhooks/apps/sinatra_charge_app.rb +27 -0
- data/test/framework_integrations/webhooks/test/test_hanami_charge_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_rails_charge_app.rb +57 -0
- data/test/framework_integrations/webhooks/test/test_sinatra_charge_app.rb +58 -0
- data/test/http_response_catcher.rb +32 -0
- metadata +366 -0
|
@@ -0,0 +1,199 @@
|
|
|
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
|
+
# Single bank transfer ledger entry associated with a charge.
|
|
9
|
+
class BankTransferLedger < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Bank Transfer Ledger Bank Ledger Type schema.
|
|
14
|
+
# @return [BankTransferLedgerBankLedgerType]
|
|
15
|
+
attr_accessor :bank_ledger_type
|
|
16
|
+
|
|
17
|
+
# Amount in the smallest currency unit.
|
|
18
|
+
# @return [Integer]
|
|
19
|
+
attr_accessor :amount
|
|
20
|
+
|
|
21
|
+
# Current balance in the smallest currency unit.
|
|
22
|
+
# @return [Integer]
|
|
23
|
+
attr_accessor :balance
|
|
24
|
+
|
|
25
|
+
# Virtual bank account holder name.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :virtual_bank_account_holder_name
|
|
28
|
+
|
|
29
|
+
# Virtual bank account number.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :virtual_bank_account_number
|
|
32
|
+
|
|
33
|
+
# Virtual account id value.
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :virtual_account_id
|
|
36
|
+
|
|
37
|
+
# Transaction date.
|
|
38
|
+
# @return [Date]
|
|
39
|
+
attr_accessor :transaction_date
|
|
40
|
+
|
|
41
|
+
# Transaction timestamp.
|
|
42
|
+
# @return [DateTime]
|
|
43
|
+
attr_accessor :transaction_timestamp
|
|
44
|
+
|
|
45
|
+
# Bank Transfer Ledger Mode schema.
|
|
46
|
+
# @return [BankTransferLedgerMode]
|
|
47
|
+
attr_accessor :mode
|
|
48
|
+
|
|
49
|
+
# Timestamp when the resource was created.
|
|
50
|
+
# @return [DateTime]
|
|
51
|
+
attr_accessor :created_on
|
|
52
|
+
|
|
53
|
+
# A mapping from model property names to API property names.
|
|
54
|
+
def self.names
|
|
55
|
+
@_hash = {} if @_hash.nil?
|
|
56
|
+
@_hash['bank_ledger_type'] = 'bank_ledger_type'
|
|
57
|
+
@_hash['amount'] = 'amount'
|
|
58
|
+
@_hash['balance'] = 'balance'
|
|
59
|
+
@_hash['virtual_bank_account_holder_name'] =
|
|
60
|
+
'virtual_bank_account_holder_name'
|
|
61
|
+
@_hash['virtual_bank_account_number'] = 'virtual_bank_account_number'
|
|
62
|
+
@_hash['virtual_account_id'] = 'virtual_account_id'
|
|
63
|
+
@_hash['transaction_date'] = 'transaction_date'
|
|
64
|
+
@_hash['transaction_timestamp'] = 'transaction_timestamp'
|
|
65
|
+
@_hash['mode'] = 'mode'
|
|
66
|
+
@_hash['created_on'] = 'created_on'
|
|
67
|
+
@_hash
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# An array for optional fields
|
|
71
|
+
def self.optionals
|
|
72
|
+
%w[
|
|
73
|
+
bank_ledger_type
|
|
74
|
+
amount
|
|
75
|
+
balance
|
|
76
|
+
virtual_bank_account_holder_name
|
|
77
|
+
virtual_bank_account_number
|
|
78
|
+
virtual_account_id
|
|
79
|
+
transaction_date
|
|
80
|
+
transaction_timestamp
|
|
81
|
+
mode
|
|
82
|
+
created_on
|
|
83
|
+
]
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# An array for nullable fields
|
|
87
|
+
def self.nullables
|
|
88
|
+
[]
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def initialize(bank_ledger_type: SKIP, amount: SKIP, balance: SKIP,
|
|
92
|
+
virtual_bank_account_holder_name: SKIP,
|
|
93
|
+
virtual_bank_account_number: SKIP, virtual_account_id: SKIP,
|
|
94
|
+
transaction_date: SKIP, transaction_timestamp: SKIP,
|
|
95
|
+
mode: SKIP, created_on: SKIP, additional_properties: nil)
|
|
96
|
+
# Add additional model properties to the instance
|
|
97
|
+
additional_properties = {} if additional_properties.nil?
|
|
98
|
+
|
|
99
|
+
@bank_ledger_type = bank_ledger_type unless bank_ledger_type == SKIP
|
|
100
|
+
@amount = amount unless amount == SKIP
|
|
101
|
+
@balance = balance unless balance == SKIP
|
|
102
|
+
unless virtual_bank_account_holder_name == SKIP
|
|
103
|
+
@virtual_bank_account_holder_name =
|
|
104
|
+
virtual_bank_account_holder_name
|
|
105
|
+
end
|
|
106
|
+
unless virtual_bank_account_number == SKIP
|
|
107
|
+
@virtual_bank_account_number =
|
|
108
|
+
virtual_bank_account_number
|
|
109
|
+
end
|
|
110
|
+
@virtual_account_id = virtual_account_id unless virtual_account_id == SKIP
|
|
111
|
+
@transaction_date = transaction_date unless transaction_date == SKIP
|
|
112
|
+
@transaction_timestamp = transaction_timestamp unless transaction_timestamp == SKIP
|
|
113
|
+
@mode = mode unless mode == SKIP
|
|
114
|
+
@created_on = created_on unless created_on == SKIP
|
|
115
|
+
@additional_properties = additional_properties
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Creates an instance of the object from a hash.
|
|
119
|
+
def self.from_hash(hash)
|
|
120
|
+
return nil unless hash
|
|
121
|
+
|
|
122
|
+
# Extract variables from the hash.
|
|
123
|
+
bank_ledger_type =
|
|
124
|
+
hash.key?('bank_ledger_type') ? hash['bank_ledger_type'] : SKIP
|
|
125
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
126
|
+
balance = hash.key?('balance') ? hash['balance'] : SKIP
|
|
127
|
+
virtual_bank_account_holder_name =
|
|
128
|
+
hash.key?('virtual_bank_account_holder_name') ? hash['virtual_bank_account_holder_name'] : SKIP
|
|
129
|
+
virtual_bank_account_number =
|
|
130
|
+
hash.key?('virtual_bank_account_number') ? hash['virtual_bank_account_number'] : SKIP
|
|
131
|
+
virtual_account_id =
|
|
132
|
+
hash.key?('virtual_account_id') ? hash['virtual_account_id'] : SKIP
|
|
133
|
+
transaction_date =
|
|
134
|
+
hash.key?('transaction_date') ? hash['transaction_date'] : SKIP
|
|
135
|
+
transaction_timestamp = if hash.key?('transaction_timestamp')
|
|
136
|
+
(DateTimeHelper.from_rfc3339(hash['transaction_timestamp']) if hash['transaction_timestamp'])
|
|
137
|
+
else
|
|
138
|
+
SKIP
|
|
139
|
+
end
|
|
140
|
+
mode = hash.key?('mode') ? hash['mode'] : SKIP
|
|
141
|
+
created_on = if hash.key?('created_on')
|
|
142
|
+
(DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
|
|
143
|
+
else
|
|
144
|
+
SKIP
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Create a new hash for additional properties, removing known properties.
|
|
148
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
149
|
+
|
|
150
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
151
|
+
new_hash, proc { |value| value }
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
# Create object from extracted values.
|
|
155
|
+
BankTransferLedger.new(bank_ledger_type: bank_ledger_type,
|
|
156
|
+
amount: amount,
|
|
157
|
+
balance: balance,
|
|
158
|
+
virtual_bank_account_holder_name: virtual_bank_account_holder_name,
|
|
159
|
+
virtual_bank_account_number: virtual_bank_account_number,
|
|
160
|
+
virtual_account_id: virtual_account_id,
|
|
161
|
+
transaction_date: transaction_date,
|
|
162
|
+
transaction_timestamp: transaction_timestamp,
|
|
163
|
+
mode: mode,
|
|
164
|
+
created_on: created_on,
|
|
165
|
+
additional_properties: additional_properties)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def to_custom_transaction_timestamp
|
|
169
|
+
DateTimeHelper.to_rfc3339(transaction_timestamp)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def to_custom_created_on
|
|
173
|
+
DateTimeHelper.to_rfc3339(created_on)
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Provides a human-readable string representation of the object.
|
|
177
|
+
def to_s
|
|
178
|
+
class_name = self.class.name.split('::').last
|
|
179
|
+
"<#{class_name} bank_ledger_type: #{@bank_ledger_type}, amount: #{@amount}, balance:"\
|
|
180
|
+
" #{@balance}, virtual_bank_account_holder_name: #{@virtual_bank_account_holder_name},"\
|
|
181
|
+
" virtual_bank_account_number: #{@virtual_bank_account_number}, virtual_account_id:"\
|
|
182
|
+
" #{@virtual_account_id}, transaction_date: #{@transaction_date}, transaction_timestamp:"\
|
|
183
|
+
" #{@transaction_timestamp}, mode: #{@mode}, created_on: #{@created_on},"\
|
|
184
|
+
" additional_properties: #{@additional_properties}>"
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
188
|
+
def inspect
|
|
189
|
+
class_name = self.class.name.split('::').last
|
|
190
|
+
"<#{class_name} bank_ledger_type: #{@bank_ledger_type.inspect}, amount: #{@amount.inspect},"\
|
|
191
|
+
" balance: #{@balance.inspect}, virtual_bank_account_holder_name:"\
|
|
192
|
+
" #{@virtual_bank_account_holder_name.inspect}, virtual_bank_account_number:"\
|
|
193
|
+
" #{@virtual_bank_account_number.inspect}, virtual_account_id:"\
|
|
194
|
+
" #{@virtual_account_id.inspect}, transaction_date: #{@transaction_date.inspect},"\
|
|
195
|
+
" transaction_timestamp: #{@transaction_timestamp.inspect}, mode: #{@mode.inspect},"\
|
|
196
|
+
" created_on: #{@created_on.inspect}, additional_properties: #{@additional_properties}>"
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
# Bank Transfer Ledger Bank Ledger Type schema.
|
|
8
|
+
class BankTransferLedgerBankLedgerType
|
|
9
|
+
BANK_TRANSFER_LEDGER_BANK_LEDGER_TYPE = [
|
|
10
|
+
# TODO: Write general description for DEPOSIT
|
|
11
|
+
DEPOSIT = 'deposit'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for PAYMENT
|
|
14
|
+
PAYMENT = 'payment'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
BANK_TRANSFER_LEDGER_BANK_LEDGER_TYPE.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = DEPOSIT)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'deposit' then DEPOSIT
|
|
30
|
+
when 'payment' then PAYMENT
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
# Paginated list of bank transfer ledger entries.
|
|
8
|
+
class BankTransferLedgerList < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# List of resources.
|
|
13
|
+
# @return [Array[BankTransferLedger]]
|
|
14
|
+
attr_accessor :items
|
|
15
|
+
|
|
16
|
+
# Whether more results are available.
|
|
17
|
+
# @return [TrueClass | FalseClass]
|
|
18
|
+
attr_accessor :has_more
|
|
19
|
+
|
|
20
|
+
# Total number of matching resources.
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
attr_accessor :total_hits
|
|
23
|
+
|
|
24
|
+
# A mapping from model property names to API property names.
|
|
25
|
+
def self.names
|
|
26
|
+
@_hash = {} if @_hash.nil?
|
|
27
|
+
@_hash['items'] = 'items'
|
|
28
|
+
@_hash['has_more'] = 'has_more'
|
|
29
|
+
@_hash['total_hits'] = 'total_hits'
|
|
30
|
+
@_hash
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# An array for optional fields
|
|
34
|
+
def self.optionals
|
|
35
|
+
%w[
|
|
36
|
+
items
|
|
37
|
+
has_more
|
|
38
|
+
total_hits
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(items: SKIP, has_more: SKIP, total_hits: SKIP,
|
|
48
|
+
additional_properties: nil)
|
|
49
|
+
# Add additional model properties to the instance
|
|
50
|
+
additional_properties = {} if additional_properties.nil?
|
|
51
|
+
|
|
52
|
+
@items = items unless items == SKIP
|
|
53
|
+
@has_more = has_more unless has_more == SKIP
|
|
54
|
+
@total_hits = total_hits unless total_hits == SKIP
|
|
55
|
+
@additional_properties = additional_properties
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Creates an instance of the object from a hash.
|
|
59
|
+
def self.from_hash(hash)
|
|
60
|
+
return nil unless hash
|
|
61
|
+
|
|
62
|
+
# Extract variables from the hash.
|
|
63
|
+
# Parameter is an array, so we need to iterate through it
|
|
64
|
+
items = nil
|
|
65
|
+
unless hash['items'].nil?
|
|
66
|
+
items = []
|
|
67
|
+
hash['items'].each do |structure|
|
|
68
|
+
items << (BankTransferLedger.from_hash(structure) if structure)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
items = SKIP unless hash.key?('items')
|
|
73
|
+
has_more = hash.key?('has_more') ? hash['has_more'] : SKIP
|
|
74
|
+
total_hits = hash.key?('total_hits') ? hash['total_hits'] : SKIP
|
|
75
|
+
|
|
76
|
+
# Create a new hash for additional properties, removing known properties.
|
|
77
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
78
|
+
|
|
79
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
80
|
+
new_hash, proc { |value| value }
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Create object from extracted values.
|
|
84
|
+
BankTransferLedgerList.new(items: items,
|
|
85
|
+
has_more: has_more,
|
|
86
|
+
total_hits: total_hits,
|
|
87
|
+
additional_properties: additional_properties)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Provides a human-readable string representation of the object.
|
|
91
|
+
def to_s
|
|
92
|
+
class_name = self.class.name.split('::').last
|
|
93
|
+
"<#{class_name} items: #{@items}, has_more: #{@has_more}, total_hits: #{@total_hits},"\
|
|
94
|
+
" additional_properties: #{@additional_properties}>"
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
98
|
+
def inspect
|
|
99
|
+
class_name = self.class.name.split('::').last
|
|
100
|
+
"<#{class_name} items: #{@items.inspect}, has_more: #{@has_more.inspect}, total_hits:"\
|
|
101
|
+
" #{@total_hits.inspect}, additional_properties: #{@additional_properties}>"
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
# Bank Transfer Ledger Mode schema.
|
|
8
|
+
class BankTransferLedgerMode
|
|
9
|
+
BANK_TRANSFER_LEDGER_MODE = [
|
|
10
|
+
# TODO: Write general description for LIVE
|
|
11
|
+
LIVE = 'live'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for TEST
|
|
14
|
+
TEST = 'test'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
BANK_TRANSFER_LEDGER_MODE.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = LIVE)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'live' then LIVE
|
|
30
|
+
when 'test' then TEST
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
# Payment status of a bank transfer charge.
|
|
8
|
+
class BankTransferPaymentStatus
|
|
9
|
+
BANK_TRANSFER_PAYMENT_STATUS = [
|
|
10
|
+
# TODO: Write general description for UNPAID
|
|
11
|
+
UNPAID = 'unpaid'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for INSUFFICIENT
|
|
14
|
+
INSUFFICIENT = 'insufficient'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for EXACT
|
|
17
|
+
EXACT = 'exact'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for EXCEEDED
|
|
20
|
+
EXCEEDED = 'exceeded'.freeze
|
|
21
|
+
].freeze
|
|
22
|
+
|
|
23
|
+
def self.validate(value)
|
|
24
|
+
return false if value.nil?
|
|
25
|
+
|
|
26
|
+
BANK_TRANSFER_PAYMENT_STATUS.include?(value)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.from_value(value, default_value = UNPAID)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
str = value.to_s.strip
|
|
33
|
+
|
|
34
|
+
case str.downcase
|
|
35
|
+
when 'unpaid' then UNPAID
|
|
36
|
+
when 'insufficient' then INSUFFICIENT
|
|
37
|
+
when 'exact' then EXACT
|
|
38
|
+
when 'exceeded' then EXCEEDED
|
|
39
|
+
else
|
|
40
|
+
default_value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,229 @@
|
|
|
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
|
+
# Data payload for `bank_transfer_status_updated` webhook events. Contains the
|
|
9
|
+
# bank transfer extension fields inlined alongside amount and metadata.
|
|
10
|
+
class BankTransferStatusData < BaseModel
|
|
11
|
+
SKIP = Object.new
|
|
12
|
+
private_constant :SKIP
|
|
13
|
+
|
|
14
|
+
# Bank transfer charge extension ID.
|
|
15
|
+
# @return [UUID | String]
|
|
16
|
+
attr_accessor :id
|
|
17
|
+
|
|
18
|
+
# ID of the associated charge.
|
|
19
|
+
# @return [UUID | String]
|
|
20
|
+
attr_accessor :charge_id
|
|
21
|
+
|
|
22
|
+
# Payment status of a bank transfer charge.
|
|
23
|
+
# @return [BankTransferPaymentStatus]
|
|
24
|
+
attr_accessor :payment_status
|
|
25
|
+
|
|
26
|
+
# Date of the most recent deposit.
|
|
27
|
+
# @return [DateTime]
|
|
28
|
+
attr_accessor :latest_deposit_date
|
|
29
|
+
|
|
30
|
+
# When the bank transfer extension record was created.
|
|
31
|
+
# @return [DateTime]
|
|
32
|
+
attr_accessor :created_on
|
|
33
|
+
|
|
34
|
+
# Amount of the most recent deposit in minor currency units.
|
|
35
|
+
# @return [Integer]
|
|
36
|
+
attr_accessor :latest_deposit_amount
|
|
37
|
+
|
|
38
|
+
# Current outstanding balance in minor currency units.
|
|
39
|
+
# @return [Integer]
|
|
40
|
+
attr_accessor :balance
|
|
41
|
+
|
|
42
|
+
# ISO 4217 currency code.
|
|
43
|
+
# @return [String]
|
|
44
|
+
attr_accessor :currency
|
|
45
|
+
|
|
46
|
+
# Total charge amount in minor currency units.
|
|
47
|
+
# @return [Integer]
|
|
48
|
+
attr_accessor :amount
|
|
49
|
+
|
|
50
|
+
# Difference between paid and expected amount (positive = over, negative =
|
|
51
|
+
# under).
|
|
52
|
+
# @return [Integer]
|
|
53
|
+
attr_accessor :amount_difference
|
|
54
|
+
|
|
55
|
+
# A free-form dictionary for custom metadata.
|
|
56
|
+
# @return [GenericMetadata]
|
|
57
|
+
attr_accessor :token_metadata
|
|
58
|
+
|
|
59
|
+
# A free-form dictionary for custom metadata.
|
|
60
|
+
# @return [GenericMetadata]
|
|
61
|
+
attr_accessor :charge_metadata
|
|
62
|
+
|
|
63
|
+
# A mapping from model property names to API property names.
|
|
64
|
+
def self.names
|
|
65
|
+
@_hash = {} if @_hash.nil?
|
|
66
|
+
@_hash['id'] = 'id'
|
|
67
|
+
@_hash['charge_id'] = 'charge_id'
|
|
68
|
+
@_hash['payment_status'] = 'payment_status'
|
|
69
|
+
@_hash['latest_deposit_date'] = 'latest_deposit_date'
|
|
70
|
+
@_hash['created_on'] = 'created_on'
|
|
71
|
+
@_hash['latest_deposit_amount'] = 'latest_deposit_amount'
|
|
72
|
+
@_hash['balance'] = 'balance'
|
|
73
|
+
@_hash['currency'] = 'currency'
|
|
74
|
+
@_hash['amount'] = 'amount'
|
|
75
|
+
@_hash['amount_difference'] = 'amount_difference'
|
|
76
|
+
@_hash['token_metadata'] = 'token_metadata'
|
|
77
|
+
@_hash['charge_metadata'] = 'charge_metadata'
|
|
78
|
+
@_hash
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# An array for optional fields
|
|
82
|
+
def self.optionals
|
|
83
|
+
%w[
|
|
84
|
+
id
|
|
85
|
+
charge_id
|
|
86
|
+
payment_status
|
|
87
|
+
latest_deposit_date
|
|
88
|
+
created_on
|
|
89
|
+
latest_deposit_amount
|
|
90
|
+
balance
|
|
91
|
+
currency
|
|
92
|
+
amount
|
|
93
|
+
amount_difference
|
|
94
|
+
token_metadata
|
|
95
|
+
charge_metadata
|
|
96
|
+
]
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# An array for nullable fields
|
|
100
|
+
def self.nullables
|
|
101
|
+
%w[
|
|
102
|
+
id
|
|
103
|
+
latest_deposit_date
|
|
104
|
+
created_on
|
|
105
|
+
latest_deposit_amount
|
|
106
|
+
balance
|
|
107
|
+
amount_difference
|
|
108
|
+
]
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def initialize(id: SKIP, charge_id: SKIP, payment_status: SKIP,
|
|
112
|
+
latest_deposit_date: SKIP, created_on: SKIP,
|
|
113
|
+
latest_deposit_amount: SKIP, balance: SKIP, currency: SKIP,
|
|
114
|
+
amount: SKIP, amount_difference: SKIP, token_metadata: SKIP,
|
|
115
|
+
charge_metadata: SKIP, additional_properties: nil)
|
|
116
|
+
# Add additional model properties to the instance
|
|
117
|
+
additional_properties = {} if additional_properties.nil?
|
|
118
|
+
|
|
119
|
+
@id = id unless id == SKIP
|
|
120
|
+
@charge_id = charge_id unless charge_id == SKIP
|
|
121
|
+
@payment_status = payment_status unless payment_status == SKIP
|
|
122
|
+
@latest_deposit_date = latest_deposit_date unless latest_deposit_date == SKIP
|
|
123
|
+
@created_on = created_on unless created_on == SKIP
|
|
124
|
+
@latest_deposit_amount = latest_deposit_amount unless latest_deposit_amount == SKIP
|
|
125
|
+
@balance = balance unless balance == SKIP
|
|
126
|
+
@currency = currency unless currency == SKIP
|
|
127
|
+
@amount = amount unless amount == SKIP
|
|
128
|
+
@amount_difference = amount_difference unless amount_difference == SKIP
|
|
129
|
+
@token_metadata = token_metadata unless token_metadata == SKIP
|
|
130
|
+
@charge_metadata = charge_metadata unless charge_metadata == SKIP
|
|
131
|
+
@additional_properties = additional_properties
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Creates an instance of the object from a hash.
|
|
135
|
+
def self.from_hash(hash)
|
|
136
|
+
return nil unless hash
|
|
137
|
+
|
|
138
|
+
# Extract variables from the hash.
|
|
139
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
|
140
|
+
charge_id = hash.key?('charge_id') ? hash['charge_id'] : SKIP
|
|
141
|
+
payment_status =
|
|
142
|
+
hash.key?('payment_status') ? hash['payment_status'] : SKIP
|
|
143
|
+
latest_deposit_date = if hash.key?('latest_deposit_date')
|
|
144
|
+
(DateTimeHelper.from_rfc3339(hash['latest_deposit_date']) if hash['latest_deposit_date'])
|
|
145
|
+
else
|
|
146
|
+
SKIP
|
|
147
|
+
end
|
|
148
|
+
created_on = if hash.key?('created_on')
|
|
149
|
+
(DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
|
|
150
|
+
else
|
|
151
|
+
SKIP
|
|
152
|
+
end
|
|
153
|
+
latest_deposit_amount =
|
|
154
|
+
hash.key?('latest_deposit_amount') ? hash['latest_deposit_amount'] : SKIP
|
|
155
|
+
balance = hash.key?('balance') ? hash['balance'] : SKIP
|
|
156
|
+
currency = hash.key?('currency') ? hash['currency'] : SKIP
|
|
157
|
+
amount = hash.key?('amount') ? hash['amount'] : SKIP
|
|
158
|
+
amount_difference =
|
|
159
|
+
hash.key?('amount_difference') ? hash['amount_difference'] : SKIP
|
|
160
|
+
token_metadata = GenericMetadata.from_hash(hash['token_metadata']) if hash['token_metadata']
|
|
161
|
+
charge_metadata = GenericMetadata.from_hash(hash['charge_metadata']) if
|
|
162
|
+
hash['charge_metadata']
|
|
163
|
+
|
|
164
|
+
# Create a new hash for additional properties, removing known properties.
|
|
165
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
166
|
+
|
|
167
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
168
|
+
new_hash, proc { |value| value }
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
# Create object from extracted values.
|
|
172
|
+
BankTransferStatusData.new(id: id,
|
|
173
|
+
charge_id: charge_id,
|
|
174
|
+
payment_status: payment_status,
|
|
175
|
+
latest_deposit_date: latest_deposit_date,
|
|
176
|
+
created_on: created_on,
|
|
177
|
+
latest_deposit_amount: latest_deposit_amount,
|
|
178
|
+
balance: balance,
|
|
179
|
+
currency: currency,
|
|
180
|
+
amount: amount,
|
|
181
|
+
amount_difference: amount_difference,
|
|
182
|
+
token_metadata: token_metadata,
|
|
183
|
+
charge_metadata: charge_metadata,
|
|
184
|
+
additional_properties: additional_properties)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
def to_custom_latest_deposit_date
|
|
188
|
+
DateTimeHelper.to_rfc3339(latest_deposit_date)
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def to_custom_created_on
|
|
192
|
+
DateTimeHelper.to_rfc3339(created_on)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Validates an instance of the object from a given value.
|
|
196
|
+
# @param [BankTransferStatusData | Hash] The value against the validation is performed.
|
|
197
|
+
def self.validate(value)
|
|
198
|
+
return true if value.instance_of? self
|
|
199
|
+
|
|
200
|
+
return false unless value.instance_of? Hash
|
|
201
|
+
|
|
202
|
+
true
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Provides a human-readable string representation of the object.
|
|
206
|
+
def to_s
|
|
207
|
+
class_name = self.class.name.split('::').last
|
|
208
|
+
"<#{class_name} id: #{@id}, charge_id: #{@charge_id}, payment_status: #{@payment_status},"\
|
|
209
|
+
" latest_deposit_date: #{@latest_deposit_date}, created_on: #{@created_on},"\
|
|
210
|
+
" latest_deposit_amount: #{@latest_deposit_amount}, balance: #{@balance}, currency:"\
|
|
211
|
+
" #{@currency}, amount: #{@amount}, amount_difference: #{@amount_difference},"\
|
|
212
|
+
" token_metadata: #{@token_metadata}, charge_metadata: #{@charge_metadata},"\
|
|
213
|
+
" additional_properties: #{@additional_properties}>"
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
217
|
+
def inspect
|
|
218
|
+
class_name = self.class.name.split('::').last
|
|
219
|
+
"<#{class_name} id: #{@id.inspect}, charge_id: #{@charge_id.inspect}, payment_status:"\
|
|
220
|
+
" #{@payment_status.inspect}, latest_deposit_date: #{@latest_deposit_date.inspect},"\
|
|
221
|
+
" created_on: #{@created_on.inspect}, latest_deposit_amount:"\
|
|
222
|
+
" #{@latest_deposit_amount.inspect}, balance: #{@balance.inspect}, currency:"\
|
|
223
|
+
" #{@currency.inspect}, amount: #{@amount.inspect}, amount_difference:"\
|
|
224
|
+
" #{@amount_difference.inspect}, token_metadata: #{@token_metadata.inspect},"\
|
|
225
|
+
" charge_metadata: #{@charge_metadata.inspect}, additional_properties:"\
|
|
226
|
+
" #{@additional_properties}>"
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|