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
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 1bcfafb19181c51d0afce930617b19b414f2174cd975a3f677893b64c2107dd0
|
|
4
|
+
data.tar.gz: 84a9765dc7bc44877cd1eb08b1cf21f3ee9201e3b32b88c7cea3c6643c0a81ef
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: bc20723299cead99bfcb8bc57ad0167224fb35a5299066e0fa1e7a27bbc67d3fffac1ad8a18a7b502e5d49037500dfc1f99177fe96ac0723e57671b2b0eb473f
|
|
7
|
+
data.tar.gz: a0005cba2c26ef46d699518bdc5c99c5252fc2a1ae3107b7840a910be0315f0f046ecab803fe26fc26bf3b2f34dccbb5079f5b8a311f5d2fc72387d75e9b7588
|
data/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
License:
|
|
2
|
+
========
|
|
3
|
+
The MIT License (MIT)
|
|
4
|
+
http://opensource.org/licenses/MIT
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2014 - 2026 APIMATIC Limited
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
|
16
|
+
all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
+
THE SOFTWARE.
|
|
25
|
+
|
|
26
|
+
Trade Mark:
|
|
27
|
+
==========
|
|
28
|
+
APIMATIC is a trade mark for APIMATIC Limited
|
data/README.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
|
|
2
|
+
# Getting Started with Univapay Public API
|
|
3
|
+
|
|
4
|
+
## Introduction
|
|
5
|
+
|
|
6
|
+
OpenAPI specification for the Univapay Online Payment API.
|
|
7
|
+
|
|
8
|
+
### Authentication (JWT)
|
|
9
|
+
|
|
10
|
+
This API uses JWT (JSON Web Tokens) for authentication via the HTTP `Authorization` header. To authenticate, you must generate an **Application Token** in the Univapay dashboard. This generates two components: 1. **Token (`{jwt}`)** 2. **Secret (`{secret}`)**
|
|
11
|
+
|
|
12
|
+
#### ⚠️ Security Warning
|
|
13
|
+
|
|
14
|
+
The **Secret** grants extensive privileges (e.g., creating charges, capturing authorized card charges, refunding).
|
|
15
|
+
**NEVER expose the `{secret}` in frontend application code** (e.g., consumer browsers) or public repositories. It is strictly for backend server-to-server communication.
|
|
16
|
+
*Univapay is not responsible for accidents caused by leaked secrets.*
|
|
17
|
+
|
|
18
|
+
#### Bearer Auth Formats
|
|
19
|
+
|
|
20
|
+
Depending on where you are calling the API from, the Bearer format changes:
|
|
21
|
+
|
|
22
|
+
* **Frontend / Browser (No Secret)**: `Bearer {jwt}`
|
|
23
|
+
*(Used for Widgets or Inline Forms. You must register your allowed domains in the dashboard when creating the token).*
|
|
24
|
+
* **Backend / Server (With Secret)**: `Bearer {secret}.{jwt}`
|
|
25
|
+
*(Required for all backend processing).*
|
|
26
|
+
|
|
27
|
+
We will assume that all requests are going to originate from a backend server thus, all requests will require the secret
|
|
28
|
+
|
|
29
|
+
#### Token Types
|
|
30
|
+
|
|
31
|
+
* **Store Token**: Grants full access to requests for that specific store.
|
|
32
|
+
* **Merchant Token**: Can't create transaction tokens but can access data from multiple stores.
|
|
33
|
+
|
|
34
|
+
## Install the Package
|
|
35
|
+
|
|
36
|
+
Install the gem from the command line:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
gem install univapay-apimatic-sdk -v 0.0.1
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or add the gem to your Gemfile and run `bundle`:
|
|
43
|
+
|
|
44
|
+
```ruby
|
|
45
|
+
gem 'univapay-apimatic-sdk', '0.0.1'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For additional gem details, see the [RubyGems page for the univapay-apimatic-sdk gem](https://rubygems.org/gems/univapay-apimatic-sdk/versions/0.0.1).
|
|
49
|
+
|
|
50
|
+
## IRB Console Usage
|
|
51
|
+
|
|
52
|
+
You can explore the SDK interactively using IRB in two ways
|
|
53
|
+
|
|
54
|
+
### 1. Use IRB with Installed Gem
|
|
55
|
+
|
|
56
|
+
Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and type the following command to start the irb console.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
irb
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Now you can load the SDK in the IRB
|
|
63
|
+
|
|
64
|
+
```ruby
|
|
65
|
+
require 'univapay_client_sdk'
|
|
66
|
+
include UnivapayClientSdk
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 2. Use IRB within SDK
|
|
70
|
+
|
|
71
|
+
Open your system terminal (Command Prompt, Git Bash or macOS Terminal) and navigate to the root folder of SDK.
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
cd path/to/univapay_client_sdk
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Now you can start the preconfigured irb console by running the following command
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
ruby bin/console
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**_Note:_** This automatically loads the SDK from lib/
|
|
84
|
+
|
|
85
|
+
## Test the SDK
|
|
86
|
+
|
|
87
|
+
To run the tests, navigate to the root directory of the SDK in your terminal and execute the following command:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
rake
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Initialize the API Client
|
|
94
|
+
|
|
95
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/client.md)
|
|
96
|
+
|
|
97
|
+
The following parameters are configurable for the API Client:
|
|
98
|
+
|
|
99
|
+
| Parameter | Type | Description |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| base_url | `String` | Base URL for the API<br>*Default*: `'https://api.univapay.com'` |
|
|
102
|
+
| environment | [`Environment`](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
|
|
103
|
+
| connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
|
|
104
|
+
| adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
|
|
105
|
+
| timeout | `Float` | The value to use for connection timeout. <br> **Default: 30** |
|
|
106
|
+
| max_retries | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
|
107
|
+
| retry_interval | `Float` | Pause in seconds between retries. <br> **Default: 1** |
|
|
108
|
+
| backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
|
|
109
|
+
| retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
110
|
+
| retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
|
|
111
|
+
| http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
|
|
112
|
+
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
113
|
+
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/logging-configuration.md) | The SDK logging configuration for API calls |
|
|
114
|
+
| bearer_auth_credentials | [`BearerAuthCredentials`](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-bearer-token.md) | The credential object for OAuth 2 Bearer token |
|
|
115
|
+
|
|
116
|
+
The API client can be initialized as follows:
|
|
117
|
+
|
|
118
|
+
### Code-Based Client Initialization
|
|
119
|
+
|
|
120
|
+
```ruby
|
|
121
|
+
require 'univapay_client_sdk'
|
|
122
|
+
include UnivapayClientSdk
|
|
123
|
+
|
|
124
|
+
client = Client.new(
|
|
125
|
+
bearer_auth_credentials: BearerAuthCredentials.new(
|
|
126
|
+
access_token: 'AccessToken'
|
|
127
|
+
),
|
|
128
|
+
environment: Environment::PRODUCTION,
|
|
129
|
+
base_url: 'https://api.univapay.com',
|
|
130
|
+
logging_configuration: LoggingConfiguration.new(
|
|
131
|
+
log_level: Logger::INFO,
|
|
132
|
+
request_logging_config: RequestLoggingConfiguration.new(
|
|
133
|
+
log_body: true
|
|
134
|
+
),
|
|
135
|
+
response_logging_config: ResponseLoggingConfiguration.new(
|
|
136
|
+
log_headers: true
|
|
137
|
+
)
|
|
138
|
+
)
|
|
139
|
+
)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Environment-Based Client Initialization
|
|
143
|
+
|
|
144
|
+
```ruby
|
|
145
|
+
require 'univapay_client_sdk'
|
|
146
|
+
include UnivapayClientSdk
|
|
147
|
+
|
|
148
|
+
# Create client from environment
|
|
149
|
+
client = Client.from_env
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md) section for details.
|
|
153
|
+
|
|
154
|
+
## Environments
|
|
155
|
+
|
|
156
|
+
The SDK can be configured to use a different environment for making API calls. Available environments are:
|
|
157
|
+
|
|
158
|
+
### Fields
|
|
159
|
+
|
|
160
|
+
| Name | Description |
|
|
161
|
+
| --- | --- |
|
|
162
|
+
| PRODUCTION | **Default** Production Server |
|
|
163
|
+
|
|
164
|
+
## Authorization
|
|
165
|
+
|
|
166
|
+
This API uses the following authentication schemes.
|
|
167
|
+
|
|
168
|
+
* [`JWT_TOKEN (OAuth 2 Bearer token)`](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/auth/oauth-2-bearer-token.md)
|
|
169
|
+
|
|
170
|
+
## List of APIs
|
|
171
|
+
|
|
172
|
+
* [Transaction Tokens](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/controllers/transaction-tokens.md)
|
|
173
|
+
* [Charges](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/controllers/charges.md)
|
|
174
|
+
* [Refunds](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/controllers/refunds.md)
|
|
175
|
+
* [Subscriptions](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/controllers/subscriptions.md)
|
|
176
|
+
* [Cancels](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/controllers/cancels.md)
|
|
177
|
+
* [Merchants](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/controllers/merchants.md)
|
|
178
|
+
* [Stores](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/controllers/stores.md)
|
|
179
|
+
* [Webhooks](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/controllers/webhooks.md)
|
|
180
|
+
|
|
181
|
+
## Webhooks
|
|
182
|
+
|
|
183
|
+
* [Charge Updated](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/charge-updated-handler.md)
|
|
184
|
+
* [Charge Finished](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/charge-finished-handler.md)
|
|
185
|
+
* [Token Created](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/token-created-handler.md)
|
|
186
|
+
* [Token Updated](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/token-updated-handler.md)
|
|
187
|
+
* [Token Three Ds Updated](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/token-three-ds-updated-handler.md)
|
|
188
|
+
* [Token Cvv Auth Updated](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/token-cvv-auth-updated-handler.md)
|
|
189
|
+
* [Token Cvv Auth Check Updated](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/token-cvv-auth-check-updated-handler.md)
|
|
190
|
+
* [Token Replaced](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/token-replaced-handler.md)
|
|
191
|
+
* [Recurring Token Deleted](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/recurring-token-deleted-handler.md)
|
|
192
|
+
* [Refund](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/refund-handler.md)
|
|
193
|
+
* [Cancel](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/cancel-handler.md)
|
|
194
|
+
* [Subscription Created](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/subscription-created-handler.md)
|
|
195
|
+
* [Subscription Payment](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/subscription-payment-handler.md)
|
|
196
|
+
* [Subscription Completed](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/subscription-completed-handler.md)
|
|
197
|
+
* [Subscription Failure](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/subscription-failure-handler.md)
|
|
198
|
+
* [Subscription Canceled](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/subscription-canceled-handler.md)
|
|
199
|
+
* [Subscription Suspended](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/subscription-suspended-handler.md)
|
|
200
|
+
* [Bank-Transfer](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/bank-transfer-handler.md)
|
|
201
|
+
* [Customs](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/events/webhooks/customs-handler.md)
|
|
202
|
+
|
|
203
|
+
## SDK Infrastructure
|
|
204
|
+
|
|
205
|
+
### Configuration
|
|
206
|
+
|
|
207
|
+
* [ProxySettings](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/proxy-settings.md)
|
|
208
|
+
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/environment-based-client-initialization.md)
|
|
209
|
+
* [AbstractLogger](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/abstract-logger.md)
|
|
210
|
+
* [LoggingConfiguration](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/logging-configuration.md)
|
|
211
|
+
* [RequestLoggingConfiguration](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/request-logging-configuration.md)
|
|
212
|
+
* [ResponseLoggingConfiguration](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/response-logging-configuration.md)
|
|
213
|
+
|
|
214
|
+
### HTTP
|
|
215
|
+
|
|
216
|
+
* [HttpResponse](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/http-response.md)
|
|
217
|
+
* [HttpRequest](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/http-request.md)
|
|
218
|
+
|
|
219
|
+
### Utilities
|
|
220
|
+
|
|
221
|
+
* [ApiResponse](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/api-response.md)
|
|
222
|
+
* [ApiHelper](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/api-helper.md)
|
|
223
|
+
* [DateTimeHelper](https://www.github.com/sdks-io/univapay-apimatic-ruby-sdk/tree/0.0.1/doc/date-time-helper.md)
|
|
224
|
+
|
data/bin/console
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Load the lib folder into Ruby's load path
|
|
4
|
+
$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
|
|
5
|
+
|
|
6
|
+
# Require the gem
|
|
7
|
+
require 'univapay_client_sdk'
|
|
8
|
+
|
|
9
|
+
puts 'UnivapayClientSdk SDK loaded!'
|
|
10
|
+
puts 'You can now create a client with: client = UnivapayClientSdk::Client.new'
|
|
11
|
+
puts 'Or use from_env: client = UnivapayClientSdk::Client.from_env'
|
|
12
|
+
|
|
13
|
+
# Start an interactive IRB session
|
|
14
|
+
require 'irb'
|
|
15
|
+
IRB.start
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
# BaseApi.
|
|
8
|
+
class BaseApi
|
|
9
|
+
include CoreLibrary
|
|
10
|
+
attr_accessor :config, :http_call_back
|
|
11
|
+
|
|
12
|
+
def self.user_agent
|
|
13
|
+
'Ruby-SDK/0.0.1 (OS: {os-info}, Engine: {engine}/{engine-version})'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.user_agent_parameters
|
|
17
|
+
{
|
|
18
|
+
'{engine}' => { 'value' => RUBY_ENGINE, 'encode' => false },
|
|
19
|
+
'{engine-version}' => { 'value' => RUBY_ENGINE_VERSION, 'encode' => false },
|
|
20
|
+
'{os-info}' => { 'value' => RUBY_PLATFORM, 'encode' => false }
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
GLOBAL_ERRORS = {
|
|
25
|
+
'default' => ErrorCase.new
|
|
26
|
+
.error_message('HTTP response not OK.')
|
|
27
|
+
.exception_type(APIException)
|
|
28
|
+
}.freeze
|
|
29
|
+
|
|
30
|
+
# Initialization constructor.
|
|
31
|
+
# @param [GlobalConfiguration] global_configuration The instance of GlobalConfiguration.
|
|
32
|
+
def initialize(global_configuration)
|
|
33
|
+
@global_configuration = global_configuration
|
|
34
|
+
@config = @global_configuration.client_configuration
|
|
35
|
+
@http_call_back = @config.http_callback
|
|
36
|
+
@api_call = ApiCall.new(@global_configuration)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Creates a new instance of the request builder.
|
|
40
|
+
# @param [String] http_method The HTTP method to use in the request.
|
|
41
|
+
# @param [String] path The endpoint path to use in the request.
|
|
42
|
+
# @param [String] server The server to extract the base uri for the request.
|
|
43
|
+
# @return [RequestBuilder] The instance of RequestBuilder.
|
|
44
|
+
def new_request_builder(http_method, path, server)
|
|
45
|
+
RequestBuilder.new
|
|
46
|
+
.http_method(http_method)
|
|
47
|
+
.path(path)
|
|
48
|
+
.server(server)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Creates a new instance of the response handler.
|
|
52
|
+
# @return [ResponseHandler] The instance of ResponseHandler.
|
|
53
|
+
def new_response_handler
|
|
54
|
+
ResponseHandler.new
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Creates a new instance of the parameter.
|
|
58
|
+
# @param [String|optional] key The key of the parameter.
|
|
59
|
+
# @param [Object] value The value of the parameter.
|
|
60
|
+
# @return [Parameter] The instance of Parameter.
|
|
61
|
+
def new_parameter(value, key: nil)
|
|
62
|
+
Parameter.new
|
|
63
|
+
.key(key)
|
|
64
|
+
.value(value)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,293 @@
|
|
|
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
|
+
# CancelsApi
|
|
8
|
+
class CancelsApi < BaseApi
|
|
9
|
+
# Returns a paginated list of cancels for the specified charge.
|
|
10
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
11
|
+
# of the store.
|
|
12
|
+
# @param [UUID | String] charge_id Required parameter: The unique identifier
|
|
13
|
+
# of the charge.
|
|
14
|
+
# @param [Integer] limit Optional parameter: Maximum number of resources to
|
|
15
|
+
# return in one page.
|
|
16
|
+
# @param [UUID | String] cursor Optional parameter: Cursor pointing to the
|
|
17
|
+
# resource after which pagination should continue.
|
|
18
|
+
# @param [CursorDirectionQuery] cursor_direction Optional parameter:
|
|
19
|
+
# Pagination direction relative to the supplied cursor.
|
|
20
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
21
|
+
def list_cancels(store_id,
|
|
22
|
+
charge_id,
|
|
23
|
+
limit: 10,
|
|
24
|
+
cursor: nil,
|
|
25
|
+
cursor_direction: CursorDirectionQuery::DESC)
|
|
26
|
+
@api_call
|
|
27
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
28
|
+
'/stores/{storeId}/charges/{chargeId}/cancels',
|
|
29
|
+
Server::DEFAULT)
|
|
30
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
31
|
+
.is_required(true)
|
|
32
|
+
.should_encode(true))
|
|
33
|
+
.template_param(new_parameter(charge_id, key: 'chargeId')
|
|
34
|
+
.is_required(true)
|
|
35
|
+
.should_encode(true))
|
|
36
|
+
.query_param(new_parameter(limit, key: 'limit'))
|
|
37
|
+
.query_param(new_parameter(cursor, key: 'cursor'))
|
|
38
|
+
.query_param(new_parameter(cursor_direction, key: 'cursor_direction'))
|
|
39
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
40
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
41
|
+
.response(new_response_handler
|
|
42
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
43
|
+
.deserialize_into(CancelList.method(:from_hash))
|
|
44
|
+
.is_api_response(true)
|
|
45
|
+
.local_error_template('401',
|
|
46
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
47
|
+
ApiErrorException)
|
|
48
|
+
.local_error_template('404',
|
|
49
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
50
|
+
ApiErrorException)
|
|
51
|
+
.local_error_template('400',
|
|
52
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
53
|
+
APIException)
|
|
54
|
+
.local_error_template('403',
|
|
55
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
56
|
+
APIException)
|
|
57
|
+
.local_error_template('409',
|
|
58
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
59
|
+
APIException)
|
|
60
|
+
.local_error_template('429',
|
|
61
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
62
|
+
APIException)
|
|
63
|
+
.local_error_template('500',
|
|
64
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
65
|
+
APIException)
|
|
66
|
+
.local_error_template('503',
|
|
67
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
68
|
+
APIException)
|
|
69
|
+
.local_error_template('504',
|
|
70
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
71
|
+
APIException)
|
|
72
|
+
.local_error_template('default',
|
|
73
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
74
|
+
APIException))
|
|
75
|
+
.execute
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Creates a new cancellation request for a charge. The charge must be in a
|
|
79
|
+
# cancellable state. Bank transfer and konbini charges that have already
|
|
80
|
+
# been paid cannot be cancelled
|
|
81
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
82
|
+
# of the store.
|
|
83
|
+
# @param [UUID | String] charge_id Required parameter: The unique identifier
|
|
84
|
+
# of the charge.
|
|
85
|
+
# @param [String] idempotency_key Optional parameter: An optional
|
|
86
|
+
# idempotency key to prevent double charges and duplicate operations. We
|
|
87
|
+
# recommend a randomly generated UUID (v4).
|
|
88
|
+
# @param [CancelCreateRequest] body Optional parameter: Optional metadata
|
|
89
|
+
# payload for creating a cancel.
|
|
90
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
91
|
+
def create_cancel(store_id,
|
|
92
|
+
charge_id,
|
|
93
|
+
idempotency_key: nil,
|
|
94
|
+
body: nil)
|
|
95
|
+
@api_call
|
|
96
|
+
.request(new_request_builder(HttpMethodEnum::POST,
|
|
97
|
+
'/stores/{storeId}/charges/{chargeId}/cancels',
|
|
98
|
+
Server::DEFAULT)
|
|
99
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
100
|
+
.is_required(true)
|
|
101
|
+
.should_encode(true))
|
|
102
|
+
.template_param(new_parameter(charge_id, key: 'chargeId')
|
|
103
|
+
.is_required(true)
|
|
104
|
+
.should_encode(true))
|
|
105
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
106
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
107
|
+
.body_param(new_parameter(body))
|
|
108
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
109
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
110
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
111
|
+
.response(new_response_handler
|
|
112
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
113
|
+
.deserialize_into(Cancel.method(:from_hash))
|
|
114
|
+
.is_api_response(true)
|
|
115
|
+
.local_error_template('400',
|
|
116
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
117
|
+
ApiErrorException)
|
|
118
|
+
.local_error_template('401',
|
|
119
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
120
|
+
ApiErrorException)
|
|
121
|
+
.local_error_template('404',
|
|
122
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
123
|
+
ApiErrorException)
|
|
124
|
+
.local_error_template('403',
|
|
125
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
126
|
+
APIException)
|
|
127
|
+
.local_error_template('409',
|
|
128
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
129
|
+
APIException)
|
|
130
|
+
.local_error_template('429',
|
|
131
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
132
|
+
APIException)
|
|
133
|
+
.local_error_template('500',
|
|
134
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
135
|
+
APIException)
|
|
136
|
+
.local_error_template('503',
|
|
137
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
138
|
+
APIException)
|
|
139
|
+
.local_error_template('504',
|
|
140
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
141
|
+
APIException)
|
|
142
|
+
.local_error_template('default',
|
|
143
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
144
|
+
APIException))
|
|
145
|
+
.execute
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Retrieves a specific cancel by ID. Supports long-polling by appending
|
|
149
|
+
# `?polling=true` to wait for a status change (up to the server timeout).
|
|
150
|
+
# Requires a secret-bearing token.
|
|
151
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
152
|
+
# of the store.
|
|
153
|
+
# @param [UUID | String] charge_id Required parameter: The unique identifier
|
|
154
|
+
# of the charge.
|
|
155
|
+
# @param [UUID | String] id Required parameter: The unique identifier of the
|
|
156
|
+
# resource.
|
|
157
|
+
# @param [TrueClass | FalseClass] polling Optional parameter: If `true`, the
|
|
158
|
+
# server holds the connection open until the cancel status changes or the
|
|
159
|
+
# polling timeout is reached.
|
|
160
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
161
|
+
def get_cancel(store_id,
|
|
162
|
+
charge_id,
|
|
163
|
+
id,
|
|
164
|
+
polling: false)
|
|
165
|
+
@api_call
|
|
166
|
+
.request(new_request_builder(HttpMethodEnum::GET,
|
|
167
|
+
'/stores/{storeId}/charges/{chargeId}/cancels/{id}',
|
|
168
|
+
Server::DEFAULT)
|
|
169
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
170
|
+
.is_required(true)
|
|
171
|
+
.should_encode(true))
|
|
172
|
+
.template_param(new_parameter(charge_id, key: 'chargeId')
|
|
173
|
+
.is_required(true)
|
|
174
|
+
.should_encode(true))
|
|
175
|
+
.template_param(new_parameter(id, key: 'id')
|
|
176
|
+
.is_required(true)
|
|
177
|
+
.should_encode(true))
|
|
178
|
+
.query_param(new_parameter(polling, key: 'polling'))
|
|
179
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
180
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
181
|
+
.response(new_response_handler
|
|
182
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
183
|
+
.deserialize_into(Cancel.method(:from_hash))
|
|
184
|
+
.is_api_response(true)
|
|
185
|
+
.local_error_template('401',
|
|
186
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
187
|
+
ApiErrorException)
|
|
188
|
+
.local_error_template('404',
|
|
189
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
190
|
+
ApiErrorException)
|
|
191
|
+
.local_error_template('400',
|
|
192
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
193
|
+
APIException)
|
|
194
|
+
.local_error_template('403',
|
|
195
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
196
|
+
APIException)
|
|
197
|
+
.local_error_template('409',
|
|
198
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
199
|
+
APIException)
|
|
200
|
+
.local_error_template('429',
|
|
201
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
202
|
+
APIException)
|
|
203
|
+
.local_error_template('500',
|
|
204
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
205
|
+
APIException)
|
|
206
|
+
.local_error_template('503',
|
|
207
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
208
|
+
APIException)
|
|
209
|
+
.local_error_template('504',
|
|
210
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
211
|
+
APIException)
|
|
212
|
+
.local_error_template('default',
|
|
213
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
214
|
+
APIException))
|
|
215
|
+
.execute
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Updates metadata on an existing cancel. Requires a secret-bearing token.
|
|
219
|
+
# @param [UUID | String] store_id Required parameter: The unique identifier
|
|
220
|
+
# of the store.
|
|
221
|
+
# @param [UUID | String] charge_id Required parameter: The unique identifier
|
|
222
|
+
# of the charge.
|
|
223
|
+
# @param [UUID | String] id Required parameter: The unique identifier of the
|
|
224
|
+
# resource.
|
|
225
|
+
# @param [CancelUpdateRequest] body Required parameter: Request payload for
|
|
226
|
+
# updating cancel metadata.
|
|
227
|
+
# @param [String] idempotency_key Optional parameter: An optional
|
|
228
|
+
# idempotency key to prevent double charges and duplicate operations. We
|
|
229
|
+
# recommend a randomly generated UUID (v4).
|
|
230
|
+
# @return [ApiResponse] Complete http response with raw body and status code.
|
|
231
|
+
def update_cancel(store_id,
|
|
232
|
+
charge_id,
|
|
233
|
+
id,
|
|
234
|
+
body,
|
|
235
|
+
idempotency_key: nil)
|
|
236
|
+
@api_call
|
|
237
|
+
.request(new_request_builder(HttpMethodEnum::PATCH,
|
|
238
|
+
'/stores/{storeId}/charges/{chargeId}/cancels/{id}',
|
|
239
|
+
Server::DEFAULT)
|
|
240
|
+
.template_param(new_parameter(store_id, key: 'storeId')
|
|
241
|
+
.is_required(true)
|
|
242
|
+
.should_encode(true))
|
|
243
|
+
.template_param(new_parameter(charge_id, key: 'chargeId')
|
|
244
|
+
.is_required(true)
|
|
245
|
+
.should_encode(true))
|
|
246
|
+
.template_param(new_parameter(id, key: 'id')
|
|
247
|
+
.is_required(true)
|
|
248
|
+
.should_encode(true))
|
|
249
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
250
|
+
.body_param(new_parameter(body)
|
|
251
|
+
.is_required(true))
|
|
252
|
+
.header_param(new_parameter(idempotency_key, key: 'Idempotency-Key'))
|
|
253
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
|
254
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
|
255
|
+
.auth(Single.new('JWT_TOKEN')))
|
|
256
|
+
.response(new_response_handler
|
|
257
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
|
258
|
+
.deserialize_into(Cancel.method(:from_hash))
|
|
259
|
+
.is_api_response(true)
|
|
260
|
+
.local_error_template('400',
|
|
261
|
+
'HTTP 400 Bad Request: {$response.body#/code}',
|
|
262
|
+
ApiErrorException)
|
|
263
|
+
.local_error_template('401',
|
|
264
|
+
'HTTP 401 Unauthorized: {$response.body#/code}',
|
|
265
|
+
ApiErrorException)
|
|
266
|
+
.local_error_template('403',
|
|
267
|
+
'HTTP 403 Forbidden: {$response.body#/code}',
|
|
268
|
+
ApiErrorException)
|
|
269
|
+
.local_error_template('404',
|
|
270
|
+
'HTTP 404 Not Found: {$response.body#/code}',
|
|
271
|
+
ApiErrorException)
|
|
272
|
+
.local_error_template('409',
|
|
273
|
+
'HTTP 409 Conflict: {$response.body#/code}',
|
|
274
|
+
APIException)
|
|
275
|
+
.local_error_template('429',
|
|
276
|
+
'HTTP 429 Rate Limited: {$response.body#/code}',
|
|
277
|
+
APIException)
|
|
278
|
+
.local_error_template('500',
|
|
279
|
+
'HTTP 500 Server Error: {$response.body#/code}',
|
|
280
|
+
APIException)
|
|
281
|
+
.local_error_template('503',
|
|
282
|
+
'HTTP 503 Unavailable: {$response.body#/code}',
|
|
283
|
+
APIException)
|
|
284
|
+
.local_error_template('504',
|
|
285
|
+
'HTTP 504 Timeout: {$response.body#/code}',
|
|
286
|
+
APIException)
|
|
287
|
+
.local_error_template('default',
|
|
288
|
+
'HTTP {$statusCode}: {$response.body#/code}',
|
|
289
|
+
APIException))
|
|
290
|
+
.execute
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
end
|