forked from madetech/solidus-adyen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_adyen.html.erb
33 lines (27 loc) · 916 Bytes
/
_adyen.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<% content_for :head do %>
<%= javascript_include_tag 'spree/checkout/payment/adyen.js' %>
<% end %>
<p>
You'll be redirected to Adyen Hosted Payment Pages. After completing the
payment form you'll be back to the store.
</p>
<%= content_tag :div, "", id: 'adyen-hpp-details', data: {
url: directory_adyen_hpp_path(
order_id: @order.id,
payment_method_id: payment_method.id) } %>
<script type="text/javascript">
$(function() {
var spreePaymentRadio = $("#checkout_form_payment input:radio")
var hideCheckoutButtonForAdyen = function() {
if ($("#checkout_form_payment input:radio:checked").val() == <%= payment_method.id %>) {
$("#checkout_form_payment .form-buttons").hide();
} else {
$("#checkout_form_payment .form-buttons").show();
}
}
spreePaymentRadio.change(function() {
hideCheckoutButtonForAdyen();
});
hideCheckoutButtonForAdyen();
});
</script>