Sha256: 013d0eae86351193987be0123e89d4ec8649b96fb05f3f39eca9d12ed1b9b084

Contents?: true

Size: 682 Bytes

Versions: 5

Compression:

Stored size: 682 Bytes

Contents

<script>
  function showAffirmError(method_id) {
    if (method_id === AffirmPaymentMethodID) {
      $('.payment-method-settings').prepend("<strong id=\"affirm-warning\">You cannot charge Affirm accounts through the admin backend at this time.</strong>");
    } else {
      $('#affirm-warning').remove();
    }
  }
  AffirmPaymentMethodID = "<%= payment_method.id %>"

  $(function() {
    var checked_method_id = $('[data-hook="payment_method_field"] input[type="radio"]:checked').val();
    showAffirmError(checked_method_id);

    $('[data-hook="payment_method_field"] input[type="radio"]').click(function (e) {
      showAffirmError($(e.target).val());
    });
  })
</script>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_affirm-0.2.30 app/views/spree/admin/payments/source_forms/_affirm.html.erb
spree_affirm-0.2.3 app/views/spree/admin/payments/source_forms/_affirm.html.erb
spree_affirm-0.2.22 app/views/spree/admin/payments/source_forms/_affirm.html.erb
spree_affirm-0.2.21 app/views/spree/admin/payments/source_forms/_affirm.html.erb
spree_affirm-0.2.20 app/views/spree/admin/payments/source_forms/_affirm.html.erb