Class: GenesisRuby::Utils::Transactions::References::RefundableTypes
- Inherits:
-
Object
- Object
- GenesisRuby::Utils::Transactions::References::RefundableTypes
- Extended by:
- Api::Constants::Transactions
- Defined in:
- lib/genesis_ruby/utils/transactions/references/refundable_types.rb
Overview
Refundable Transaction Types Helper Methods
Constant Summary
Constants included from Api::Constants::Transactions
Api::Constants::Transactions::ACCOUNT_VERIFICATION, Api::Constants::Transactions::AFRICAN_MOBILE_PAYOUT, Api::Constants::Transactions::AFRICAN_MOBILE_SALE, Api::Constants::Transactions::ALIPAY, Api::Constants::Transactions::APPLE_PAY, Api::Constants::Transactions::ARGENCARD, Api::Constants::Transactions::AURA, Api::Constants::Transactions::AUTHORIZE, Api::Constants::Transactions::AUTHORIZE_3D, Api::Constants::Transactions::BALOTO, Api::Constants::Transactions::BANCOMER, Api::Constants::Transactions::BANCONTACT, Api::Constants::Transactions::BANCO_DE_OCCIDENTE, Api::Constants::Transactions::BANCO_DO_BRASIL, Api::Constants::Transactions::BITPAY_PAYOUT, Api::Constants::Transactions::BITPAY_REFUND, Api::Constants::Transactions::BITPAY_SALE, Api::Constants::Transactions::BOLETO, Api::Constants::Transactions::BRADESCO, Api::Constants::Transactions::CABAL, Api::Constants::Transactions::CAPTURE, Api::Constants::Transactions::CASH, Api::Constants::Transactions::CASHU, Api::Constants::Transactions::CENCOSUD, Api::Constants::Transactions::CREDIT, Api::Constants::Transactions::DAVIVIENDA, Api::Constants::Transactions::EFECTY, Api::Constants::Transactions::ELO, Api::Constants::Transactions::EPS, Api::Constants::Transactions::EZEECARD_PAYOUT, Api::Constants::Transactions::EZEEWALLET, Api::Constants::Transactions::FASHIONCHEQUE, Api::Constants::Transactions::GLOBAL_PAYOUT, Api::Constants::Transactions::GOOGLE_PAY, Api::Constants::Transactions::IDEAL, Api::Constants::Transactions::IDEBIT_PAYIN, Api::Constants::Transactions::IDEBIT_PAYOUT, Api::Constants::Transactions::INCREMENTAL_AUTHORIZE, Api::Constants::Transactions::INIT_RECURRING_SALE, Api::Constants::Transactions::INIT_RECURRING_SALE_3D, Api::Constants::Transactions::INSTA_DEBIT_PAYIN, Api::Constants::Transactions::INSTA_DEBIT_PAYOUT, Api::Constants::Transactions::INTERSOLVE, Api::Constants::Transactions::INVOICE, Api::Constants::Transactions::INVOICE_CAPTURE, Api::Constants::Transactions::INVOICE_REFUND, Api::Constants::Transactions::ITAU, Api::Constants::Transactions::MULTIBANCO, Api::Constants::Transactions::MY_BANK, Api::Constants::Transactions::NARANJA, Api::Constants::Transactions::NATIVA, Api::Constants::Transactions::NEOSURF, Api::Constants::Transactions::NETELLER, Api::Constants::Transactions::ONLINE_BANKING_PAYIN, Api::Constants::Transactions::ONLINE_BANKING_PAYOUT, Api::Constants::Transactions::OXXO, Api::Constants::Transactions::P24, Api::Constants::Transactions::PAGO_FACIL, Api::Constants::Transactions::PARTIAL_REVERSAL, Api::Constants::Transactions::PAYBYVOUCHER_YEEPAY, Api::Constants::Transactions::PAYOUT, Api::Constants::Transactions::PAYSAFECARD, Api::Constants::Transactions::PAYU, Api::Constants::Transactions::PAY_PAL, Api::Constants::Transactions::PIX, Api::Constants::Transactions::POLI, Api::Constants::Transactions::POST_FINANCE, Api::Constants::Transactions::PPRO, Api::Constants::Transactions::PSE, Api::Constants::Transactions::RAPI_PAGO, Api::Constants::Transactions::RECURRING_SALE, Api::Constants::Transactions::REDPAGOS, Api::Constants::Transactions::REFUND, Api::Constants::Transactions::RUSSIAN_MOBILE_PAYOUT, Api::Constants::Transactions::RUSSIAN_MOBILE_SALE, Api::Constants::Transactions::SAFETYPAY, Api::Constants::Transactions::SALE, Api::Constants::Transactions::SALE_3D, Api::Constants::Transactions::SANTANDER, Api::Constants::Transactions::SCT_PAYOUT, Api::Constants::Transactions::SDD_INIT_RECURRING_SALE, Api::Constants::Transactions::SDD_RECURRING_SALE, Api::Constants::Transactions::SDD_REFUND, Api::Constants::Transactions::SDD_SALE, Api::Constants::Transactions::SOFORT, Api::Constants::Transactions::TARJETA_SHOPPING, Api::Constants::Transactions::TCS, Api::Constants::Transactions::TRANSFER_TO_PAYOUT, Api::Constants::Transactions::TRUSTLY_SALE, Api::Constants::Transactions::UPI, Api::Constants::Transactions::VOID, Api::Constants::Transactions::WEBMONEY, Api::Constants::Transactions::WEBPAY, Api::Constants::Transactions::WECHAT
Class Method Summary collapse
-
.all ⇒ Object
Array containing all available Refundable Types.
-
.allowed_reference?(type) ⇒ Boolean
Checks if the given type is allowed for the execution of Reference Refund Transaction Type.
-
.fetch_reference(type) ⇒ Object
Fetches the correct Transaction type that must be used for the execution of the Refund ex.
-
.valid?(type) ⇒ Boolean
Checks if the given type is a Refund type.
Methods included from Api::Mixins::Constants::Common
Class Method Details
.all ⇒ Object
Array containing all available Refundable Types
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/genesis_ruby/utils/transactions/references/refundable_types.rb', line 15 def all # rubocop:disable Metrics/MethodLength [ AFRICAN_MOBILE_PAYOUT, AFRICAN_MOBILE_SALE, ALIPAY, APPLE_PAY, BALOTO, BANCOMER, BANCONTACT, BANCO_DE_OCCIDENTE, BANCO_DO_BRASIL, BITPAY_SALE, BOLETO, BRADESCO, CAPTURE, CASHU, DAVIVIENDA, EFECTY, EPS, FASHIONCHEQUE, GOOGLE_PAY, IDEAL, IDEBIT_PAYIN, INIT_RECURRING_SALE, INIT_RECURRING_SALE_3D, INVOICE_CAPTURE, ITAU, MY_BANK, NEOSURF, ONLINE_BANKING_PAYIN, OXXO, P24, PAGO_FACIL, PARTIAL_REVERSAL, PAYU, PAY_PAL, PIX, POST_FINANCE, PPRO, PSE, RAPI_PAGO, RECURRING_SALE, REDPAGOS, SAFETYPAY, SALE, SALE_3D, SANTANDER, SDD_INIT_RECURRING_SALE, SDD_RECURRING_SALE, SDD_SALE, SOFORT, TRUSTLY_SALE, UPI, WEBPAY, WECHAT ] end |
.allowed_reference?(type) ⇒ Boolean
Checks if the given type is allowed for the execution of Reference Refund Transaction Type
37 38 39 |
# File 'lib/genesis_ruby/utils/transactions/references/refundable_types.rb', line 37 def allowed_reference?(type) all.include?(type.to_s.downcase) end |
.fetch_reference(type) ⇒ Object
Fetches the correct Transaction type that must be used for the execution of the Refund ex. sdd_sale -> sdd_refund, sale -> refund
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/genesis_ruby/utils/transactions/references/refundable_types.rb', line 53 def fetch_reference(type) case type.to_s.downcase when BITPAY_SALE BITPAY_REFUND when SDD_SALE, SDD_RECURRING_SALE, SDD_INIT_RECURRING_SALE SDD_REFUND when INVOICE_CAPTURE INVOICE_REFUND else REFUND end end |
.valid?(type) ⇒ Boolean
Checks if the given type is a Refund type
42 43 44 45 46 47 48 49 |
# File 'lib/genesis_ruby/utils/transactions/references/refundable_types.rb', line 42 def valid?(type) [ BITPAY_REFUND, INVOICE_REFUND, REFUND, SDD_REFUND ].include?(type.to_s.downcase) end |