Cleanup code and environment variables

This commit is contained in:
Maciej Szlosarczyk 2018-04-19 09:53:56 +03:00
parent d7dc1017b0
commit 1cca930744
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
12 changed files with 38 additions and 265 deletions

View file

@ -1,6 +1,7 @@
module Payments
PAYMENT_METHODS = ENV['payment_methods'].strip.split(', ').freeze
PAYMENT_BANKLINK_BANKS = ENV['payment_banklink_banks'].strip.split(', ').freeze
PAYMENT_INTERMEDIARIES = ENV['payments_intermediaries'].strip.split(', ').freeze
PAYMENT_BANKLINK_BANKS = ENV['payments_banks'].strip.split(', ').freeze
PAYMENT_METHODS = [PAYMENT_INTERMEDIARIES, PAYMENT_BANKLINK_BANKS].flatten.freeze
def self.create_with_type(type, invoice, opts = {})
fail ArgumentError unless PAYMENT_METHODS.include?(type)