houdini/gems/bess/lib/houdini/payment_provider.rb

22 lines
575 B
Ruby
Raw Normal View History

2020-06-12 15:03:43 -05:00
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
2020-06-10 17:31:47 -05:00
module Houdini::PaymentProvider
extend ActiveSupport::Autoload
autoload :Registry
autoload :StripeProvider
PROVIDER = 'Provider'
private_constant :PROVIDER
# based on ActiveJob's configuration
class << self
def build(name, **options)
lookup(name).new(**options)
end
def lookup(name)
const_get(name.to_s.camelize << PROVIDER)
end
end
end