app/Plugin/StripePaymentGateway42/Resource/template/default/Cart/index.js.twig line 1

Open in your IDE?
  1. <script>
  2. {% for CartIndex, Cart in Carts %}
  3.     {% set cartKey = Cart.cart_key %}
  4.     $("<div id='button-{{ cartKey }}' style='margin-bottom: 10px'></div>").insertBefore($(".ec-blockBtn--action[href*='{{ cartKey }}']"))
  5.     
  6.     registerPayButton({
  7.         // shipping_fetch_url : 'https://279a4a530961.ngrok.io/plugin/stripe_payment_gateway/pr_shipping',
  8.         // pay_url            : "https://279a4a530961.ngrok.io/plugin/stripe_payment_gateway/pr_pay",
  9.         button_id          :  'button-{{ cartKey }}',
  10.         getData            :    function() {
  11.             return { "cart_key" : "{{ cartKey }}" }
  12.         },
  13.         onSuccess          :    function(){
  14.             location.href = "{{ url('shopping_complete') }}"
  15.         },
  16.         request_data: {
  17.             country     :   "JP",
  18.             currency    :   "jpy",
  19.             total       :   {
  20.                 label  :    "{{ 'stripe_payment_gateway.payrequest.pay_now_label'|trans }}",
  21.                 amount :    parseInt("{{ Cart.totalPrice }}".replace(",", ""))
  22.             },
  23.             requestPayerName    : true,
  24.             requestPayerEmail   : true,
  25.             requestPayerPhone   : true,
  26.             requestShipping     : true
  27.         }
  28.     })
  29. {% endfor %}
  30. </script>