app/Plugin/AmazonPayV2_42/Resource/template/default/Mypage/amazon_login_js.twig line 1

Open in your IDE?
  1. {#
  2. Amazon Pay V2 for EC-CUBE4.2
  3. Copyright(c) 2023 EC-CUBE CO.,LTD. all rights reserved.
  4. https://www.ec-cube.co.jp/
  5. This program is not free software.
  6. It applies to terms of service.
  7. #}
  8. <script src="{{ AmazonPayV2Api.checkout_script_url }}"></script>
  9. <script type="text/javascript" charset="utf-8">
  10.     $(function () {
  11.         // エラー文を設置
  12.         $(".ec-pageHeader").after($(".login_with_amazon_error"));
  13.         {% if AmazonPayV2Config.mypage_login_button_place == constant('Plugin\\AmazonPayV2_42\\Form\\Type\\Master\\ConfigTypeMaster::CART_BUTTON_PLACE')['AUTO'] %}
  14.         $("div.ec-login > .div_AmazonLogin").each(function() {
  15.             AmazonRenderButton();
  16.         });
  17.         {% else %}
  18.         AmazonRenderButton();
  19.         {% endif %}
  20.     });
  21.     function AmazonRenderButton() {
  22.         amazon.Pay.renderButton('#AmazonLoginButton', {
  23.             // set checkout environment
  24.             merchantId: '{{ AmazonPayV2Config.seller_id }}',
  25.             ledgerCurrency: 'JPY',
  26.             {% if AmazonPayV2Config.env == eccube_config.amazon_pay_v2.env.sandbox %}
  27.             sandbox: true,
  28.             {% endif %}
  29.             // customize the buyer experience
  30.             checkoutLanguage: 'ja_JP',
  31.             productType: 'SignIn',
  32.             placement: 'Other',
  33.             buttonColor: '{{ buttonColor }}',
  34.             // configure sign in
  35.             signInConfig: {
  36.                 payloadJSON: '{{ payload | raw }}', // string generated in step 2
  37.                 signature: '{{ signature }}', // signature generatd in step 3
  38.                 publicKeyId: '{{ AmazonPayV2Config.public_key_id }}'
  39.             }
  40.         });
  41.     }
  42. </script>
  43. <div class="hidden">
  44.     <div class="ec-role login_with_amazon_error">
  45.         <div class="ec-grid3 ec-grid--center">
  46.             <div class="ec-off3Grid__cell">
  47.                 {% for error in app.session.flashbag.get('eccube.amazon_pay_v2.error') %}
  48.                     <div class="ec-alert-warning">
  49.                         <div class="ec-alert-warning__icon">
  50.                             <img src="{{ asset('assets/icon/exclamation-white.svg') }}">
  51.                         </div>
  52.                         <div class="ec-alert-warning__text">
  53.                             {{ error|trans|nl2br }}
  54.                         </div>
  55.                     </div>
  56.                 {% endfor %}
  57.             </div>
  58.         </div>
  59.     </div>
  60. </div>