mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
effe5c7ba9
From now, we no longer retrieve the client_secret directly from the API/list but from a specialized component which ask API/get_item. This highly decrease the laod time needed to fetch API/list
38 lines
466 B
Ruby
38 lines
466 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Payments module
|
|
module Payment; end
|
|
|
|
# Generic payment object
|
|
class Payment::Item
|
|
attr_reader :klass
|
|
|
|
def initialize(klass, id = nil, *args)
|
|
@klass = klass
|
|
@id = id
|
|
@args = args
|
|
end
|
|
|
|
def class
|
|
klass
|
|
end
|
|
|
|
def payment_mean?
|
|
false
|
|
end
|
|
|
|
def subscription?
|
|
false
|
|
end
|
|
|
|
def order?
|
|
false
|
|
end
|
|
|
|
def gateway
|
|
klass[/^(PayZen|Stripe)::/, 1]
|
|
end
|
|
|
|
def retrieve(_id = nil, *_args); end
|
|
end
|