mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
15 lines
563 B
Ruby
15 lines
563 B
Ruby
module PaymentOrders
|
|
PAYMENT_INTERMEDIARIES = ENV['payments_intermediaries'].to_s.strip.split(', ').freeze
|
|
PAYMENT_BANKLINK_BANKS = ENV['payments_banks'].to_s.strip.split(', ').freeze
|
|
PAYMENT_METHODS = [PAYMENT_INTERMEDIARIES, PAYMENT_BANKLINK_BANKS].flatten.freeze
|
|
|
|
def self.create_with_type(type, invoice, opts = {})
|
|
raise ArgumentError unless PAYMENT_METHODS.include?(type)
|
|
|
|
if PAYMENT_BANKLINK_BANKS.include?(type)
|
|
BankLink.new(type, invoice, opts)
|
|
elsif type == 'every_pay'
|
|
EveryPay.new(type, invoice, opts)
|
|
end
|
|
end
|
|
end
|