mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
include payzen frontend libs if enabled
This commit is contained in:
parent
635e8d3356
commit
4245747072
@ -20,6 +20,16 @@
|
||||
<script type="text/javascript" src="//cdn.crowdin.com/jipt/jipt.js"></script>
|
||||
<% end %>
|
||||
|
||||
<% require 'pay_zen/helper' %>
|
||||
<% if PayZen::Helper.enabled? %>
|
||||
<% endpoint = Setting.get('payzen_endpoint') %>
|
||||
<%=stylesheet_link_tag "#{endpoint}/static/js/krypton-client/V4.0/ext/classic-reset.css" %>
|
||||
<%=javascript_include_tag "#{endpoint}/static/js/krypton-client/V4.0/ext/classic.js" %>
|
||||
<% if Rails.env.development? %>
|
||||
<%=javascript_include_tag "#{endpoint}/static/js/krypton-client/V4.0/ext/classic.js.map" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
var Fablab = Fablab || {};
|
||||
|
||||
|
19
lib/pay_zen/helper.rb
Normal file
19
lib/pay_zen/helper.rb
Normal file
@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# PayZen payement gateway
|
||||
module PayZen; end
|
||||
|
||||
## Provides various methods around the PayZen payment gateway
|
||||
class PayZen::Helper
|
||||
class << self
|
||||
def enabled?
|
||||
return false unless Setting.get('payment_gateway') == 'payzen'
|
||||
|
||||
res = true
|
||||
%w[payzen_username payzen_password payzen_endpoint payzen_public_key payzen_hmac payzen_currency].each do |pz_setting|
|
||||
res = false unless Setting.get(pz_setting).present?
|
||||
end
|
||||
res
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user