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.
Files changed (272) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +224 -0
  4. data/bin/console +15 -0
  5. data/lib/univapay_client_sdk/api_helper.rb +10 -0
  6. data/lib/univapay_client_sdk/apis/base_api.rb +67 -0
  7. data/lib/univapay_client_sdk/apis/cancels_api.rb +293 -0
  8. data/lib/univapay_client_sdk/apis/charges_api.rb +903 -0
  9. data/lib/univapay_client_sdk/apis/merchants_api.rb +57 -0
  10. data/lib/univapay_client_sdk/apis/refunds_api.rb +298 -0
  11. data/lib/univapay_client_sdk/apis/stores_api.rb +126 -0
  12. data/lib/univapay_client_sdk/apis/subscriptions_api.rb +1014 -0
  13. data/lib/univapay_client_sdk/apis/transaction_tokens_api.rb +455 -0
  14. data/lib/univapay_client_sdk/apis/webhooks_api.rb +463 -0
  15. data/lib/univapay_client_sdk/client.rb +116 -0
  16. data/lib/univapay_client_sdk/configuration.rb +178 -0
  17. data/lib/univapay_client_sdk/events/unknown_event.rb +32 -0
  18. data/lib/univapay_client_sdk/events/webhooks/bank_transfer_handler.rb +37 -0
  19. data/lib/univapay_client_sdk/events/webhooks/cancel_handler.rb +37 -0
  20. data/lib/univapay_client_sdk/events/webhooks/charge_finished_handler.rb +37 -0
  21. data/lib/univapay_client_sdk/events/webhooks/charge_updated_handler.rb +37 -0
  22. data/lib/univapay_client_sdk/events/webhooks/customs_handler.rb +37 -0
  23. data/lib/univapay_client_sdk/events/webhooks/recurring_token_deleted_handler.rb +37 -0
  24. data/lib/univapay_client_sdk/events/webhooks/refund_handler.rb +37 -0
  25. data/lib/univapay_client_sdk/events/webhooks/subscription_canceled_handler.rb +37 -0
  26. data/lib/univapay_client_sdk/events/webhooks/subscription_completed_handler.rb +37 -0
  27. data/lib/univapay_client_sdk/events/webhooks/subscription_created_handler.rb +37 -0
  28. data/lib/univapay_client_sdk/events/webhooks/subscription_failure_handler.rb +37 -0
  29. data/lib/univapay_client_sdk/events/webhooks/subscription_payment_handler.rb +37 -0
  30. data/lib/univapay_client_sdk/events/webhooks/subscription_suspended_handler.rb +37 -0
  31. data/lib/univapay_client_sdk/events/webhooks/token_created_handler.rb +37 -0
  32. data/lib/univapay_client_sdk/events/webhooks/token_cvv_auth_check_updated_handler.rb +37 -0
  33. data/lib/univapay_client_sdk/events/webhooks/token_cvv_auth_updated_handler.rb +37 -0
  34. data/lib/univapay_client_sdk/events/webhooks/token_replaced_handler.rb +37 -0
  35. data/lib/univapay_client_sdk/events/webhooks/token_three_ds_updated_handler.rb +37 -0
  36. data/lib/univapay_client_sdk/events/webhooks/token_updated_handler.rb +37 -0
  37. data/lib/univapay_client_sdk/exceptions/api_error_exception.rb +199 -0
  38. data/lib/univapay_client_sdk/exceptions/api_exception.rb +21 -0
  39. data/lib/univapay_client_sdk/http/api_response.rb +19 -0
  40. data/lib/univapay_client_sdk/http/auth/oauth_2.rb +53 -0
  41. data/lib/univapay_client_sdk/http/http_call_back.rb +10 -0
  42. data/lib/univapay_client_sdk/http/http_method_enum.rb +10 -0
  43. data/lib/univapay_client_sdk/http/http_request.rb +10 -0
  44. data/lib/univapay_client_sdk/http/http_response.rb +10 -0
  45. data/lib/univapay_client_sdk/http/proxy_settings.rb +22 -0
  46. data/lib/univapay_client_sdk/logging/configuration/api_logging_configuration.rb +186 -0
  47. data/lib/univapay_client_sdk/logging/sdk_logger.rb +17 -0
  48. data/lib/univapay_client_sdk/models/api_error_detail.rb +87 -0
  49. data/lib/univapay_client_sdk/models/api_error_status.rb +26 -0
  50. data/lib/univapay_client_sdk/models/bank_transfer_event.rb +27 -0
  51. data/lib/univapay_client_sdk/models/bank_transfer_ledger.rb +199 -0
  52. data/lib/univapay_client_sdk/models/bank_transfer_ledger_bank_ledger_type.rb +36 -0
  53. data/lib/univapay_client_sdk/models/bank_transfer_ledger_list.rb +104 -0
  54. data/lib/univapay_client_sdk/models/bank_transfer_ledger_mode.rb +36 -0
  55. data/lib/univapay_client_sdk/models/bank_transfer_payment_status.rb +44 -0
  56. data/lib/univapay_client_sdk/models/bank_transfer_status_data.rb +229 -0
  57. data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback.rb +134 -0
  58. data/lib/univapay_client_sdk/models/bank_transfer_status_webhook_callback_extension.rb +75 -0
  59. data/lib/univapay_client_sdk/models/base_bank_transfer_data.rb +100 -0
  60. data/lib/univapay_client_sdk/models/base_konbini_data.rb +99 -0
  61. data/lib/univapay_client_sdk/models/base_konbini_data_convenience_store.rb +60 -0
  62. data/lib/univapay_client_sdk/models/base_model.rb +110 -0
  63. data/lib/univapay_client_sdk/models/base_online_data.rb +123 -0
  64. data/lib/univapay_client_sdk/models/base_online_data_brand.rb +48 -0
  65. data/lib/univapay_client_sdk/models/base_online_data_call_method.rb +52 -0
  66. data/lib/univapay_client_sdk/models/base_online_data_os_type.rb +36 -0
  67. data/lib/univapay_client_sdk/models/base_online_data_user_identifier_source.rb +36 -0
  68. data/lib/univapay_client_sdk/models/cancel.rb +183 -0
  69. data/lib/univapay_client_sdk/models/cancel_create_request.rb +77 -0
  70. data/lib/univapay_client_sdk/models/cancel_event.rb +26 -0
  71. data/lib/univapay_client_sdk/models/cancel_list.rb +94 -0
  72. data/lib/univapay_client_sdk/models/cancel_status.rb +44 -0
  73. data/lib/univapay_client_sdk/models/cancel_update_request.rb +76 -0
  74. data/lib/univapay_client_sdk/models/cancel_webhook_callback.rb +132 -0
  75. data/lib/univapay_client_sdk/models/cancel_webhook_callback_extension.rb +74 -0
  76. data/lib/univapay_client_sdk/models/card_processor_installment_config.rb +89 -0
  77. data/lib/univapay_client_sdk/models/charge.rb +411 -0
  78. data/lib/univapay_client_sdk/models/charge_capture_request.rb +84 -0
  79. data/lib/univapay_client_sdk/models/charge_create_request.rb +179 -0
  80. data/lib/univapay_client_sdk/models/charge_create_request_client_metadata.rb +76 -0
  81. data/lib/univapay_client_sdk/models/charge_create_request_redirect.rb +75 -0
  82. data/lib/univapay_client_sdk/models/charge_create_request_three_ds.rb +88 -0
  83. data/lib/univapay_client_sdk/models/charge_create_request_three_ds_mode.rb +44 -0
  84. data/lib/univapay_client_sdk/models/charge_finished_webhook_callback.rb +131 -0
  85. data/lib/univapay_client_sdk/models/charge_list.rb +104 -0
  86. data/lib/univapay_client_sdk/models/charge_mode.rb +36 -0
  87. data/lib/univapay_client_sdk/models/charge_redirect.rb +96 -0
  88. data/lib/univapay_client_sdk/models/charge_status.rb +56 -0
  89. data/lib/univapay_client_sdk/models/charge_three_ds.rb +97 -0
  90. data/lib/univapay_client_sdk/models/charge_transaction_token_type.rb +40 -0
  91. data/lib/univapay_client_sdk/models/charge_update_request.rb +75 -0
  92. data/lib/univapay_client_sdk/models/charge_updated_webhook_callback.rb +131 -0
  93. data/lib/univapay_client_sdk/models/cursor_direction_query.rb +36 -0
  94. data/lib/univapay_client_sdk/models/customs_declaration_create_request.rb +106 -0
  95. data/lib/univapay_client_sdk/models/customs_declaration_event.rb +27 -0
  96. data/lib/univapay_client_sdk/models/customs_declaration_patch_request.rb +77 -0
  97. data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback.rb +135 -0
  98. data/lib/univapay_client_sdk/models/customs_declaration_webhook_callback_extension.rb +76 -0
  99. data/lib/univapay_client_sdk/models/customs_declaration_webhook_data.rb +232 -0
  100. data/lib/univapay_client_sdk/models/customs_declaration_webhook_declaration.rb +121 -0
  101. data/lib/univapay_client_sdk/models/customs_declaration_webhook_error.rb +127 -0
  102. data/lib/univapay_client_sdk/models/customs_declaration_webhook_other_error.rb +120 -0
  103. data/lib/univapay_client_sdk/models/customs_declaration_webhook_result.rb +125 -0
  104. data/lib/univapay_client_sdk/models/customs_declaration_webhook_status.rb +44 -0
  105. data/lib/univapay_client_sdk/models/generic_metadata.rb +111 -0
  106. data/lib/univapay_client_sdk/models/installment_fixed_cycles.rb +70 -0
  107. data/lib/univapay_client_sdk/models/installment_plan_type.rb +36 -0
  108. data/lib/univapay_client_sdk/models/issuer_token.rb +177 -0
  109. data/lib/univapay_client_sdk/models/issuer_token_call_method.rb +51 -0
  110. data/lib/univapay_client_sdk/models/issuer_token_payload.rb +105 -0
  111. data/lib/univapay_client_sdk/models/issuer_token_payment_type.rb +36 -0
  112. data/lib/univapay_client_sdk/models/merchant.rb +179 -0
  113. data/lib/univapay_client_sdk/models/merchant_webhook_bank_transfer_configuration.rb +342 -0
  114. data/lib/univapay_client_sdk/models/merchant_webhook_card_brand_percent_fees.rb +167 -0
  115. data/lib/univapay_client_sdk/models/merchant_webhook_card_configuration.rb +301 -0
  116. data/lib/univapay_client_sdk/models/merchant_webhook_checkout_configuration.rb +87 -0
  117. data/lib/univapay_client_sdk/models/merchant_webhook_checkout_toggle.rb +77 -0
  118. data/lib/univapay_client_sdk/models/merchant_webhook_configuration.rb +505 -0
  119. data/lib/univapay_client_sdk/models/merchant_webhook_convenience_configuration.rb +88 -0
  120. data/lib/univapay_client_sdk/models/merchant_webhook_customer_management_configuration.rb +99 -0
  121. data/lib/univapay_client_sdk/models/merchant_webhook_installment_plan_configuration.rb +139 -0
  122. data/lib/univapay_client_sdk/models/merchant_webhook_limit_charge_by_card_configuration.rb +88 -0
  123. data/lib/univapay_client_sdk/models/merchant_webhook_limit_refund_by_sales_configuration.rb +100 -0
  124. data/lib/univapay_client_sdk/models/merchant_webhook_money_amount.rb +85 -0
  125. data/lib/univapay_client_sdk/models/merchant_webhook_online_configuration.rb +77 -0
  126. data/lib/univapay_client_sdk/models/merchant_webhook_paidy_configuration.rb +77 -0
  127. data/lib/univapay_client_sdk/models/merchant_webhook_qr_merchant_configuration.rb +77 -0
  128. data/lib/univapay_client_sdk/models/merchant_webhook_qr_scan_configuration.rb +93 -0
  129. data/lib/univapay_client_sdk/models/merchant_webhook_recurring_cvv_confirmation_config.rb +97 -0
  130. data/lib/univapay_client_sdk/models/merchant_webhook_recurring_token_configuration.rb +109 -0
  131. data/lib/univapay_client_sdk/models/merchant_webhook_security_configuration.rb +234 -0
  132. data/lib/univapay_client_sdk/models/merchant_webhook_subscription_configuration.rb +138 -0
  133. data/lib/univapay_client_sdk/models/merchant_webhook_subscription_plan_configuration.rb +138 -0
  134. data/lib/univapay_client_sdk/models/merchant_webhook_transfer_schedule_configuration.rb +159 -0
  135. data/lib/univapay_client_sdk/models/merchant_webhook_user_transactions_configuration.rb +349 -0
  136. data/lib/univapay_client_sdk/models/mode_query.rb +36 -0
  137. data/lib/univapay_client_sdk/models/payment_error.rb +178 -0
  138. data/lib/univapay_client_sdk/models/plan_settings_type.rb +36 -0
  139. data/lib/univapay_client_sdk/models/recurring_token_deleted_webhook_callback.rb +132 -0
  140. data/lib/univapay_client_sdk/models/refund.rb +240 -0
  141. data/lib/univapay_client_sdk/models/refund_create_request.rb +118 -0
  142. data/lib/univapay_client_sdk/models/refund_event.rb +26 -0
  143. data/lib/univapay_client_sdk/models/refund_list.rb +104 -0
  144. data/lib/univapay_client_sdk/models/refund_reason_request.rb +42 -0
  145. data/lib/univapay_client_sdk/models/refund_reason_response.rb +62 -0
  146. data/lib/univapay_client_sdk/models/refund_status.rb +47 -0
  147. data/lib/univapay_client_sdk/models/refund_update_request.rb +99 -0
  148. data/lib/univapay_client_sdk/models/refund_webhook_callback.rb +132 -0
  149. data/lib/univapay_client_sdk/models/refund_webhook_callback_extension.rb +74 -0
  150. data/lib/univapay_client_sdk/models/restrict_ip_after_failed_charge_config.rb +99 -0
  151. data/lib/univapay_client_sdk/models/store.rb +119 -0
  152. data/lib/univapay_client_sdk/models/store_list.rb +104 -0
  153. data/lib/univapay_client_sdk/models/store_list_item.rb +114 -0
  154. data/lib/univapay_client_sdk/models/subscription.rb +310 -0
  155. data/lib/univapay_client_sdk/models/subscription_canceled_webhook_callback.rb +132 -0
  156. data/lib/univapay_client_sdk/models/subscription_completed_webhook_callback.rb +132 -0
  157. data/lib/univapay_client_sdk/models/subscription_create_request.rb +216 -0
  158. data/lib/univapay_client_sdk/models/subscription_created_webhook_callback.rb +132 -0
  159. data/lib/univapay_client_sdk/models/subscription_failure_webhook_callback.rb +132 -0
  160. data/lib/univapay_client_sdk/models/subscription_installment_plan.rb +86 -0
  161. data/lib/univapay_client_sdk/models/subscription_list.rb +104 -0
  162. data/lib/univapay_client_sdk/models/subscription_list_item.rb +352 -0
  163. data/lib/univapay_client_sdk/models/subscription_next_payment.rb +222 -0
  164. data/lib/univapay_client_sdk/models/subscription_patch_payment_request.rb +117 -0
  165. data/lib/univapay_client_sdk/models/subscription_patch_token_request.rb +79 -0
  166. data/lib/univapay_client_sdk/models/subscription_payment.rb +185 -0
  167. data/lib/univapay_client_sdk/models/subscription_payment_list.rb +94 -0
  168. data/lib/univapay_client_sdk/models/subscription_payment_webhook_callback.rb +132 -0
  169. data/lib/univapay_client_sdk/models/subscription_period.rb +56 -0
  170. data/lib/univapay_client_sdk/models/subscription_plan_settings.rb +98 -0
  171. data/lib/univapay_client_sdk/models/subscription_schedule_settings.rb +132 -0
  172. data/lib/univapay_client_sdk/models/subscription_status.rb +56 -0
  173. data/lib/univapay_client_sdk/models/subscription_suspend_request.rb +79 -0
  174. data/lib/univapay_client_sdk/models/subscription_suspended_webhook_callback.rb +132 -0
  175. data/lib/univapay_client_sdk/models/subscription_terminate_with_status.rb +36 -0
  176. data/lib/univapay_client_sdk/models/subscription_termination_mode.rb +36 -0
  177. data/lib/univapay_client_sdk/models/subscription_update_next_payment.rb +104 -0
  178. data/lib/univapay_client_sdk/models/subscription_update_request.rb +134 -0
  179. data/lib/univapay_client_sdk/models/subscription_update_schedule_settings.rb +110 -0
  180. data/lib/univapay_client_sdk/models/subscription_update_status.rb +37 -0
  181. data/lib/univapay_client_sdk/models/subscription_user_data.rb +134 -0
  182. data/lib/univapay_client_sdk/models/suspend_schedule_settings.rb +78 -0
  183. data/lib/univapay_client_sdk/models/three_ds_issuer_token.rb +116 -0
  184. data/lib/univapay_client_sdk/models/three_ds_issuer_token_call_method.rb +26 -0
  185. data/lib/univapay_client_sdk/models/three_ds_issuer_token_payment_type.rb +26 -0
  186. data/lib/univapay_client_sdk/models/token_create_bank_transfer_data.rb +122 -0
  187. data/lib/univapay_client_sdk/models/token_create_card_data.rb +231 -0
  188. data/lib/univapay_client_sdk/models/token_create_card_data_cvv_authorize.rb +95 -0
  189. data/lib/univapay_client_sdk/models/token_create_card_data_three_ds.rb +97 -0
  190. data/lib/univapay_client_sdk/models/token_create_konbini_data.rb +147 -0
  191. data/lib/univapay_client_sdk/models/token_create_online_data.rb +142 -0
  192. data/lib/univapay_client_sdk/models/token_create_phone_number.rb +104 -0
  193. data/lib/univapay_client_sdk/models/token_created_webhook_callback.rb +131 -0
  194. data/lib/univapay_client_sdk/models/token_cvv_auth_check_updated_webhook_callback.rb +132 -0
  195. data/lib/univapay_client_sdk/models/token_cvv_auth_updated_webhook_callback.rb +132 -0
  196. data/lib/univapay_client_sdk/models/token_replaced_webhook_callback.rb +131 -0
  197. data/lib/univapay_client_sdk/models/token_response_bank_transfer_data.rb +181 -0
  198. data/lib/univapay_client_sdk/models/token_response_card_data.rb +129 -0
  199. data/lib/univapay_client_sdk/models/token_response_card_data_billing.rb +153 -0
  200. data/lib/univapay_client_sdk/models/token_response_card_data_card.rb +187 -0
  201. data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize.rb +132 -0
  202. data/lib/univapay_client_sdk/models/token_response_card_data_cvv_authorize_check.rb +118 -0
  203. data/lib/univapay_client_sdk/models/token_response_card_data_three_ds.rb +142 -0
  204. data/lib/univapay_client_sdk/models/token_response_card_data_three_ds_status.rb +48 -0
  205. data/lib/univapay_client_sdk/models/token_response_konbini_data.rb +135 -0
  206. data/lib/univapay_client_sdk/models/token_response_online_data.rb +158 -0
  207. data/lib/univapay_client_sdk/models/token_response_phone_number.rb +96 -0
  208. data/lib/univapay_client_sdk/models/token_three_ds_updated_webhook_callback.rb +132 -0
  209. data/lib/univapay_client_sdk/models/token_updated_webhook_callback.rb +131 -0
  210. data/lib/univapay_client_sdk/models/transaction_token.rb +250 -0
  211. data/lib/univapay_client_sdk/models/transaction_token_create_request.rb +161 -0
  212. data/lib/univapay_client_sdk/models/transaction_token_create_request_metadata.rb +124 -0
  213. data/lib/univapay_client_sdk/models/transaction_token_create_request_payment_type.rb +44 -0
  214. data/lib/univapay_client_sdk/models/transaction_token_create_request_type.rb +40 -0
  215. data/lib/univapay_client_sdk/models/transaction_token_list.rb +104 -0
  216. data/lib/univapay_client_sdk/models/transaction_token_list_item.rb +204 -0
  217. data/lib/univapay_client_sdk/models/transaction_token_list_item_user_data.rb +96 -0
  218. data/lib/univapay_client_sdk/models/transaction_token_mode.rb +36 -0
  219. data/lib/univapay_client_sdk/models/transaction_token_payment_type.rb +48 -0
  220. data/lib/univapay_client_sdk/models/transaction_token_type.rb +40 -0
  221. data/lib/univapay_client_sdk/models/transaction_token_update_request.rb +95 -0
  222. data/lib/univapay_client_sdk/models/transaction_token_update_request_data.rb +184 -0
  223. data/lib/univapay_client_sdk/models/transaction_token_update_request_data_phone_number.rb +86 -0
  224. data/lib/univapay_client_sdk/models/webhook.rb +191 -0
  225. data/lib/univapay_client_sdk/models/webhook_callback_envelope.rb +98 -0
  226. data/lib/univapay_client_sdk/models/webhook_create_request.rb +97 -0
  227. data/lib/univapay_client_sdk/models/webhook_event.rb +166 -0
  228. data/lib/univapay_client_sdk/models/webhook_event_list.rb +94 -0
  229. data/lib/univapay_client_sdk/models/webhook_list.rb +94 -0
  230. data/lib/univapay_client_sdk/models/webhook_trigger.rb +104 -0
  231. data/lib/univapay_client_sdk/models/webhook_update_request.rb +108 -0
  232. data/lib/univapay_client_sdk/utilities/date_time_helper.rb +11 -0
  233. data/lib/univapay_client_sdk/utilities/file_wrapper.rb +28 -0
  234. data/lib/univapay_client_sdk/utilities/union_type_lookup.rb +242 -0
  235. data/lib/univapay_client_sdk.rb +322 -0
  236. data/test/apis/api_test_base.rb +23 -0
  237. data/test/apis/test_cancels_api.rb +162 -0
  238. data/test/apis/test_charges_api.rb +564 -0
  239. data/test/apis/test_merchants_api.rb +50 -0
  240. data/test/apis/test_refunds_api.rb +172 -0
  241. data/test/apis/test_stores_api.rb +86 -0
  242. data/test/apis/test_subscriptions_api.rb +579 -0
  243. data/test/apis/test_transaction_tokens_api.rb +305 -0
  244. data/test/apis/test_webhooks_api.rb +245 -0
  245. data/test/events/webhooks/test_bank_transfer_handler.rb +95 -0
  246. data/test/events/webhooks/test_cancel_handler.rb +90 -0
  247. data/test/events/webhooks/test_charge_finished_handler.rb +95 -0
  248. data/test/events/webhooks/test_charge_updated_handler.rb +95 -0
  249. data/test/events/webhooks/test_customs_handler.rb +100 -0
  250. data/test/events/webhooks/test_recurring_token_deleted_handler.rb +92 -0
  251. data/test/events/webhooks/test_refund_handler.rb +95 -0
  252. data/test/events/webhooks/test_subscription_canceled_handler.rb +101 -0
  253. data/test/events/webhooks/test_subscription_completed_handler.rb +101 -0
  254. data/test/events/webhooks/test_subscription_created_handler.rb +101 -0
  255. data/test/events/webhooks/test_subscription_failure_handler.rb +101 -0
  256. data/test/events/webhooks/test_subscription_payment_handler.rb +101 -0
  257. data/test/events/webhooks/test_subscription_suspended_handler.rb +101 -0
  258. data/test/events/webhooks/test_token_created_handler.rb +92 -0
  259. data/test/events/webhooks/test_token_cvv_auth_check_updated_handler.rb +92 -0
  260. data/test/events/webhooks/test_token_cvv_auth_updated_handler.rb +92 -0
  261. data/test/events/webhooks/test_token_replaced_handler.rb +92 -0
  262. data/test/events/webhooks/test_token_three_ds_updated_handler.rb +92 -0
  263. data/test/events/webhooks/test_token_updated_handler.rb +92 -0
  264. data/test/framework_integrations/rails_app_test_helper.rb +14 -0
  265. data/test/framework_integrations/webhooks/apps/hanami_charge_updated_app.rb +61 -0
  266. data/test/framework_integrations/webhooks/apps/rails_charge_updated_app.rb +24 -0
  267. data/test/framework_integrations/webhooks/apps/sinatra_charge_updated_app.rb +27 -0
  268. data/test/framework_integrations/webhooks/test/test_hanami_charge_updated_app.rb +57 -0
  269. data/test/framework_integrations/webhooks/test/test_rails_charge_updated_app.rb +57 -0
  270. data/test/framework_integrations/webhooks/test/test_sinatra_charge_updated_app.rb +58 -0
  271. data/test/http_response_catcher.rb +19 -0
  272. metadata +397 -0
@@ -0,0 +1,132 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module UnivapayClientSdk
8
+ # Webhook envelope for the recurring_token_deleted event.
9
+ class RecurringTokenDeletedWebhookCallback < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique ID of this webhook delivery.
14
+ # @return [UUID | String]
15
+ attr_accessor :id
16
+
17
+ # Event type discriminator — always `recurring_token_deleted` for this
18
+ # callback.
19
+ # @return [String]
20
+ attr_reader :event
21
+
22
+ # Stored transaction token resource.
23
+ # @return [TransactionToken]
24
+ attr_accessor :data
25
+
26
+ # Timestamp when the event was fired.
27
+ # @return [DateTime]
28
+ attr_accessor :created_on
29
+
30
+ # A mapping from model property names to API property names.
31
+ def self.names
32
+ @_hash = {} if @_hash.nil?
33
+ @_hash['id'] = 'id'
34
+ @_hash['event'] = 'event'
35
+ @_hash['data'] = 'data'
36
+ @_hash['created_on'] = 'created_on'
37
+ @_hash
38
+ end
39
+
40
+ # An array for optional fields
41
+ def self.optionals
42
+ %w[
43
+ data
44
+ ]
45
+ end
46
+
47
+ # An array for nullable fields
48
+ def self.nullables
49
+ []
50
+ end
51
+
52
+ def initialize(id:, created_on:, data: SKIP, additional_properties: nil)
53
+ # Add additional model properties to the instance
54
+ additional_properties = {} if additional_properties.nil?
55
+
56
+ @id = id
57
+ @event = 'recurring_token_deleted'
58
+ @data = data unless data == SKIP
59
+ @created_on = created_on
60
+ @additional_properties = additional_properties
61
+ end
62
+
63
+ # Creates an instance of the object from a hash.
64
+ def self.from_hash(hash)
65
+ return nil unless hash
66
+
67
+ # Extract variables from the hash.
68
+ id = hash.key?('id') ? hash['id'] : nil
69
+ created_on = if hash.key?('created_on')
70
+ (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
71
+ end
72
+ data = TransactionToken.from_hash(hash['data']) if hash['data']
73
+
74
+ # Create a new hash for additional properties, removing known properties.
75
+ new_hash = hash.reject { |k, _| names.value?(k) }
76
+
77
+ additional_properties = APIHelper.get_additional_properties(
78
+ new_hash, proc { |value| value }
79
+ )
80
+
81
+ # Create object from extracted values.
82
+ RecurringTokenDeletedWebhookCallback.new(id: id,
83
+ created_on: created_on,
84
+ data: data,
85
+ additional_properties: additional_properties)
86
+ end
87
+
88
+ def to_custom_created_on
89
+ DateTimeHelper.to_rfc3339(created_on)
90
+ end
91
+
92
+ # Validates an instance of the object from a given value.
93
+ # @param [RecurringTokenDeletedWebhookCallback | Hash] The value against the validation is performed.
94
+ def self.validate(value)
95
+ if value.instance_of? self
96
+ return (
97
+ APIHelper.valid_type?(value.id,
98
+ ->(val) { val.instance_of? String }) and
99
+ APIHelper.valid_type?(value.event,
100
+ ->(val) { val.instance_of? String }) and
101
+ APIHelper.valid_type?(value.created_on,
102
+ ->(val) { val.instance_of? DateTime })
103
+ )
104
+ end
105
+
106
+ return false unless value.instance_of? Hash
107
+
108
+ (
109
+ APIHelper.valid_type?(value['id'],
110
+ ->(val) { val.instance_of? String }) and
111
+ APIHelper.valid_type?(value['event'],
112
+ ->(val) { val.instance_of? String }) and
113
+ APIHelper.valid_type?(value['created_on'],
114
+ ->(val) { val.instance_of? String })
115
+ )
116
+ end
117
+
118
+ # Provides a human-readable string representation of the object.
119
+ def to_s
120
+ class_name = self.class.name.split('::').last
121
+ "<#{class_name} id: #{@id}, event: #{@event}, data: #{@data}, created_on: #{@created_on},"\
122
+ " additional_properties: #{@additional_properties}>"
123
+ end
124
+
125
+ # Provides a debugging-friendly string with detailed object information.
126
+ def inspect
127
+ class_name = self.class.name.split('::').last
128
+ "<#{class_name} id: #{@id.inspect}, event: #{@event.inspect}, data: #{@data.inspect},"\
129
+ " created_on: #{@created_on.inspect}, additional_properties: #{@additional_properties}>"
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,240 @@
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
+ # Represents a refund issued against a charge.
9
+ class Refund < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique identifier.
14
+ # @return [UUID | String]
15
+ attr_accessor :id
16
+
17
+ # Store identifier.
18
+ # @return [UUID | String]
19
+ attr_accessor :store_id
20
+
21
+ # Charge identifier.
22
+ # @return [UUID | String]
23
+ attr_accessor :charge_id
24
+
25
+ # Current status of the refund. `pending`: The refund has been created and
26
+ # is being processed. `successful`: The refund was processed successfully.
27
+ # `failed`: The refund was rejected by the gateway. `error`: An unexpected
28
+ # error occurred during processing.
29
+ # @return [RefundStatus]
30
+ attr_accessor :status
31
+
32
+ # Refund amount in the smallest currency unit (e.g., cents for USD, yen for
33
+ # JPY).
34
+ # @return [Integer]
35
+ attr_accessor :amount
36
+
37
+ # ISO-4217 currency code. Must match the charged currency.
38
+ # @return [String]
39
+ attr_accessor :currency
40
+
41
+ # Refund amount formatted for display.
42
+ # @return [Float]
43
+ attr_accessor :amount_formatted
44
+
45
+ # Refund reason returned by the API, or `null` when unset.
46
+ # @return [RefundReasonResponse]
47
+ attr_accessor :reason
48
+
49
+ # Optional free-text note about the refund.
50
+ # @return [String]
51
+ attr_accessor :message
52
+
53
+ # Payment error details, or null if successful.
54
+ # @return [PaymentError]
55
+ attr_accessor :error
56
+
57
+ # A free-form dictionary for custom metadata.
58
+ # @return [GenericMetadata]
59
+ attr_accessor :metadata
60
+
61
+ # Charge Mode schema.
62
+ # @return [ChargeMode]
63
+ attr_accessor :mode
64
+
65
+ # Timestamp when the resource was created.
66
+ # @return [DateTime]
67
+ attr_accessor :created_on
68
+
69
+ # Timestamp when the resource was last updated.
70
+ # @return [DateTime]
71
+ attr_accessor :updated_on
72
+
73
+ # A mapping from model property names to API property names.
74
+ def self.names
75
+ @_hash = {} if @_hash.nil?
76
+ @_hash['id'] = 'id'
77
+ @_hash['store_id'] = 'store_id'
78
+ @_hash['charge_id'] = 'charge_id'
79
+ @_hash['status'] = 'status'
80
+ @_hash['amount'] = 'amount'
81
+ @_hash['currency'] = 'currency'
82
+ @_hash['amount_formatted'] = 'amount_formatted'
83
+ @_hash['reason'] = 'reason'
84
+ @_hash['message'] = 'message'
85
+ @_hash['error'] = 'error'
86
+ @_hash['metadata'] = 'metadata'
87
+ @_hash['mode'] = 'mode'
88
+ @_hash['created_on'] = 'created_on'
89
+ @_hash['updated_on'] = 'updated_on'
90
+ @_hash
91
+ end
92
+
93
+ # An array for optional fields
94
+ def self.optionals
95
+ %w[
96
+ id
97
+ store_id
98
+ charge_id
99
+ status
100
+ amount
101
+ currency
102
+ amount_formatted
103
+ reason
104
+ message
105
+ error
106
+ metadata
107
+ mode
108
+ created_on
109
+ updated_on
110
+ ]
111
+ end
112
+
113
+ # An array for nullable fields
114
+ def self.nullables
115
+ %w[
116
+ reason
117
+ message
118
+ error
119
+ ]
120
+ end
121
+
122
+ def initialize(id: SKIP, store_id: SKIP, charge_id: SKIP, status: SKIP,
123
+ amount: SKIP, currency: SKIP, amount_formatted: SKIP,
124
+ reason: SKIP, message: SKIP, error: SKIP, metadata: SKIP,
125
+ mode: SKIP, created_on: SKIP, updated_on: SKIP,
126
+ additional_properties: nil)
127
+ # Add additional model properties to the instance
128
+ additional_properties = {} if additional_properties.nil?
129
+
130
+ @id = id unless id == SKIP
131
+ @store_id = store_id unless store_id == SKIP
132
+ @charge_id = charge_id unless charge_id == SKIP
133
+ @status = status unless status == SKIP
134
+ @amount = amount unless amount == SKIP
135
+ @currency = currency unless currency == SKIP
136
+ @amount_formatted = amount_formatted unless amount_formatted == SKIP
137
+ @reason = reason unless reason == SKIP
138
+ @message = message unless message == SKIP
139
+ @error = error unless error == SKIP
140
+ @metadata = metadata unless metadata == SKIP
141
+ @mode = mode unless mode == SKIP
142
+ @created_on = created_on unless created_on == SKIP
143
+ @updated_on = updated_on unless updated_on == SKIP
144
+ @additional_properties = additional_properties
145
+ end
146
+
147
+ # Creates an instance of the object from a hash.
148
+ def self.from_hash(hash)
149
+ return nil unless hash
150
+
151
+ # Extract variables from the hash.
152
+ id = hash.key?('id') ? hash['id'] : SKIP
153
+ store_id = hash.key?('store_id') ? hash['store_id'] : SKIP
154
+ charge_id = hash.key?('charge_id') ? hash['charge_id'] : SKIP
155
+ status = hash.key?('status') ? hash['status'] : SKIP
156
+ amount = hash.key?('amount') ? hash['amount'] : SKIP
157
+ currency = hash.key?('currency') ? hash['currency'] : SKIP
158
+ amount_formatted =
159
+ hash.key?('amount_formatted') ? hash['amount_formatted'] : SKIP
160
+ reason = hash.key?('reason') ? hash['reason'] : SKIP
161
+ message = hash.key?('message') ? hash['message'] : SKIP
162
+ error = PaymentError.from_hash(hash['error']) if hash['error']
163
+ metadata = GenericMetadata.from_hash(hash['metadata']) if hash['metadata']
164
+ mode = hash.key?('mode') ? hash['mode'] : SKIP
165
+ created_on = if hash.key?('created_on')
166
+ (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
167
+ else
168
+ SKIP
169
+ end
170
+ updated_on = if hash.key?('updated_on')
171
+ (DateTimeHelper.from_rfc3339(hash['updated_on']) if hash['updated_on'])
172
+ else
173
+ SKIP
174
+ end
175
+
176
+ # Create a new hash for additional properties, removing known properties.
177
+ new_hash = hash.reject { |k, _| names.value?(k) }
178
+
179
+ additional_properties = APIHelper.get_additional_properties(
180
+ new_hash, proc { |value| value }
181
+ )
182
+
183
+ # Create object from extracted values.
184
+ Refund.new(id: id,
185
+ store_id: store_id,
186
+ charge_id: charge_id,
187
+ status: status,
188
+ amount: amount,
189
+ currency: currency,
190
+ amount_formatted: amount_formatted,
191
+ reason: reason,
192
+ message: message,
193
+ error: error,
194
+ metadata: metadata,
195
+ mode: mode,
196
+ created_on: created_on,
197
+ updated_on: updated_on,
198
+ additional_properties: additional_properties)
199
+ end
200
+
201
+ def to_custom_created_on
202
+ DateTimeHelper.to_rfc3339(created_on)
203
+ end
204
+
205
+ def to_custom_updated_on
206
+ DateTimeHelper.to_rfc3339(updated_on)
207
+ end
208
+
209
+ # Validates an instance of the object from a given value.
210
+ # @param [Refund | Hash] The value against the validation is performed.
211
+ def self.validate(value)
212
+ return true if value.instance_of? self
213
+
214
+ return false unless value.instance_of? Hash
215
+
216
+ true
217
+ end
218
+
219
+ # Provides a human-readable string representation of the object.
220
+ def to_s
221
+ class_name = self.class.name.split('::').last
222
+ "<#{class_name} id: #{@id}, store_id: #{@store_id}, charge_id: #{@charge_id}, status:"\
223
+ " #{@status}, amount: #{@amount}, currency: #{@currency}, amount_formatted:"\
224
+ " #{@amount_formatted}, reason: #{@reason}, message: #{@message}, error: #{@error},"\
225
+ " metadata: #{@metadata}, mode: #{@mode}, created_on: #{@created_on}, updated_on:"\
226
+ " #{@updated_on}, additional_properties: #{@additional_properties}>"
227
+ end
228
+
229
+ # Provides a debugging-friendly string with detailed object information.
230
+ def inspect
231
+ class_name = self.class.name.split('::').last
232
+ "<#{class_name} id: #{@id.inspect}, store_id: #{@store_id.inspect}, charge_id:"\
233
+ " #{@charge_id.inspect}, status: #{@status.inspect}, amount: #{@amount.inspect}, currency:"\
234
+ " #{@currency.inspect}, amount_formatted: #{@amount_formatted.inspect}, reason:"\
235
+ " #{@reason.inspect}, message: #{@message.inspect}, error: #{@error.inspect}, metadata:"\
236
+ " #{@metadata.inspect}, mode: #{@mode.inspect}, created_on: #{@created_on.inspect},"\
237
+ " updated_on: #{@updated_on.inspect}, additional_properties: #{@additional_properties}>"
238
+ end
239
+ end
240
+ end
@@ -0,0 +1,118 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # Request body for creating a refund against a successful charge. Konbini and
8
+ # bank transfer charges cannot be refunded.
9
+ class RefundCreateRequest < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Amount to refund in the smallest currency unit. Must be greater than 0 and
14
+ # not exceed the charged amount. Partial refunds are supported for most
15
+ # payment methods.
16
+ # @return [Integer]
17
+ attr_accessor :amount
18
+
19
+ # ISO-4217 currency code. Must exactly match the currency of the original
20
+ # charge.
21
+ # @return [String]
22
+ attr_accessor :currency
23
+
24
+ # The reason for the refund (merchant-settable values). `duplicate`: A
25
+ # duplicate charge was made. `fraud`: The charge is fraudulent.
26
+ # `customer_request`: The customer requested the refund.
27
+ # @return [RefundReasonRequest]
28
+ attr_accessor :reason
29
+
30
+ # Optional free-text note about the reason for the refund.
31
+ # @return [String]
32
+ attr_accessor :message
33
+
34
+ # A free-form dictionary for custom metadata.
35
+ # @return [GenericMetadata]
36
+ attr_accessor :metadata
37
+
38
+ # A mapping from model property names to API property names.
39
+ def self.names
40
+ @_hash = {} if @_hash.nil?
41
+ @_hash['amount'] = 'amount'
42
+ @_hash['currency'] = 'currency'
43
+ @_hash['reason'] = 'reason'
44
+ @_hash['message'] = 'message'
45
+ @_hash['metadata'] = 'metadata'
46
+ @_hash
47
+ end
48
+
49
+ # An array for optional fields
50
+ def self.optionals
51
+ %w[
52
+ reason
53
+ message
54
+ metadata
55
+ ]
56
+ end
57
+
58
+ # An array for nullable fields
59
+ def self.nullables
60
+ []
61
+ end
62
+
63
+ def initialize(amount:, currency:, reason: SKIP, message: SKIP,
64
+ metadata: SKIP, additional_properties: nil)
65
+ # Add additional model properties to the instance
66
+ additional_properties = {} if additional_properties.nil?
67
+
68
+ @amount = amount
69
+ @currency = currency
70
+ @reason = reason unless reason == SKIP
71
+ @message = message unless message == SKIP
72
+ @metadata = metadata unless metadata == SKIP
73
+ @additional_properties = additional_properties
74
+ end
75
+
76
+ # Creates an instance of the object from a hash.
77
+ def self.from_hash(hash)
78
+ return nil unless hash
79
+
80
+ # Extract variables from the hash.
81
+ amount = hash.key?('amount') ? hash['amount'] : nil
82
+ currency = hash.key?('currency') ? hash['currency'] : nil
83
+ reason = hash.key?('reason') ? hash['reason'] : SKIP
84
+ message = hash.key?('message') ? hash['message'] : SKIP
85
+ metadata = GenericMetadata.from_hash(hash['metadata']) if hash['metadata']
86
+
87
+ # Create a new hash for additional properties, removing known properties.
88
+ new_hash = hash.reject { |k, _| names.value?(k) }
89
+
90
+ additional_properties = APIHelper.get_additional_properties(
91
+ new_hash, proc { |value| value }
92
+ )
93
+
94
+ # Create object from extracted values.
95
+ RefundCreateRequest.new(amount: amount,
96
+ currency: currency,
97
+ reason: reason,
98
+ message: message,
99
+ metadata: metadata,
100
+ additional_properties: additional_properties)
101
+ end
102
+
103
+ # Provides a human-readable string representation of the object.
104
+ def to_s
105
+ class_name = self.class.name.split('::').last
106
+ "<#{class_name} amount: #{@amount}, currency: #{@currency}, reason: #{@reason}, message:"\
107
+ " #{@message}, metadata: #{@metadata}, additional_properties: #{@additional_properties}>"
108
+ end
109
+
110
+ # Provides a debugging-friendly string with detailed object information.
111
+ def inspect
112
+ class_name = self.class.name.split('::').last
113
+ "<#{class_name} amount: #{@amount.inspect}, currency: #{@currency.inspect}, reason:"\
114
+ " #{@reason.inspect}, message: #{@message.inspect}, metadata: #{@metadata.inspect},"\
115
+ " additional_properties: #{@additional_properties}>"
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,26 @@
1
+ # univapay_client_sdk
2
+ #
3
+ # This file was automatically generated for Univapay
4
+ # by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module UnivapayClientSdk
7
+ # Event type discriminator — always `refund_finished` for this callback.
8
+ class RefundEvent
9
+ REFUND_EVENT = [
10
+ # TODO: Write general description for REFUND_FINISHED
11
+ REFUND_FINISHED = 'refund_finished'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ REFUND_EVENT.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = REFUND_FINISHED)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ 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 refunds.
8
+ class RefundList < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # List of resources.
13
+ # @return [Array[Refund]]
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 << (Refund.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
+ RefundList.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,42 @@
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
+ # The reason for the refund (merchant-settable values). `duplicate`: A
8
+ # duplicate charge was made. `fraud`: The charge is fraudulent.
9
+ # `customer_request`: The customer requested the refund.
10
+ class RefundReasonRequest
11
+ REFUND_REASON_REQUEST = [
12
+ # TODO: Write general description for DUPLICATE
13
+ DUPLICATE = 'duplicate'.freeze,
14
+
15
+ # TODO: Write general description for FRAUD
16
+ FRAUD = 'fraud'.freeze,
17
+
18
+ # TODO: Write general description for CUSTOMER_REQUEST
19
+ CUSTOMER_REQUEST = 'customer_request'.freeze
20
+ ].freeze
21
+
22
+ def self.validate(value)
23
+ return false if value.nil?
24
+
25
+ REFUND_REASON_REQUEST.include?(value)
26
+ end
27
+
28
+ def self.from_value(value, default_value = DUPLICATE)
29
+ return default_value if value.nil?
30
+
31
+ str = value.to_s.strip
32
+
33
+ case str.downcase
34
+ when 'duplicate' then DUPLICATE
35
+ when 'fraud' then FRAUD
36
+ when 'customer_request' then CUSTOMER_REQUEST
37
+ else
38
+ default_value
39
+ end
40
+ end
41
+ end
42
+ end