{% load static %}


{# NOTE: Using compress tags here results in the JS not being loaded. #}
{# We have no idea why after multiple hours of investigation. #}
<script>
    window.CyberSourceConfig = {
        postUrl: "{{ client_side_payment_processor.client_side_payment_url }}",
        signingUrl: "{% url 'cybersource:submit' %}",
        applePay: {
            enabled: {{ client_side_payment_processor.apple_pay_enabled|yesno:'true,false' }},
            merchantName: "{{ platform_name }}",
            merchantIdentifier: "{{ client_side_payment_processor.apple_pay_merchant_identifier }}",
            countryCode: "{{ client_side_payment_processor.apple_pay_country_code }}",
            basketCurrency: "{{ basket.currency }}",
            basketTotal: "{{ order_total.incl_tax|floatformat:2 }}",
            startSessionUrl: "{% url 'cybersource:apple_pay:start_session' %}",
            authorizeUrl: "{% url 'cybersource:apple_pay:authorize' %}",
            receiptUrl: "{% url 'checkout:receipt' %}"
        }
    }
</script>
<script src="{% static 'js/views/cybersource_client_side_checkout.js' %}"></script>
