Add flag testmode_supported to sales channels (#1455)

* Add testmode-support-flag to SalesChannels

* Make saleschannels/testmode-warnings even more dangerous!

* Add warning for payment-methods that do support testmode but are being used in a non-testmode order caused by a saleschannel in a testmode-shop.

* Remove redundant testmode_supported-flag for WebshopSalesChannel

* Raise error on API when sales_channel does not support testmode

* Tests

* Fix style issue after merge
This commit is contained in:
Martin Gross
2019-10-21 10:07:02 +02:00
committed by Raphael Michel
parent e8a2f7e349
commit 2b18621c76
14 changed files with 171 additions and 24 deletions

View File

@@ -66,11 +66,19 @@
<div class="clearfix"></div>
</div>
{% if request.event.testmode %}
<div class="alert alert-warning">
<strong>
{% trans "This ticket shop is currently in test mode. Please do not perform any real purchases as your order might be deleted without notice." %}
</strong>
</div>
{% if request.sales_channel.testmode_supported %}
<div class="alert alert-warning">
<strong>
{% trans "This ticket shop is currently in test mode. Please do not perform any real purchases as your order might be deleted without notice." %}
</strong>
</div>
{% else %}
<div class="alert alert-danger">
<strong>
{% trans "Orders made through this sales channel cannot be deleted - even if the ticket shop is in test mode!" %}
</strong>
</div>
{% endif %}
{% endif %}
{% if messages %}
{% for message in messages %}
@@ -82,11 +90,19 @@
{% block content %}
{% endblock %}
{% if request.event.testmode %}
<div class="alert alert-testmode alert-warning">
<strong>
{% trans "This ticket shop is currently in test mode. Please do not perform any real purchases as your order might be deleted without notice." %}
</strong>
</div>
{% if request.sales_channel.testmode_supported %}
<div class="alert alert-testmode alert-warning">
<strong>
{% trans "This ticket shop is currently in test mode. Please do not perform any real purchases as your order might be deleted without notice." %}
</strong>
</div>
{% else %}
<div class="alert alert-testmode alert-danger">
<strong>
{% trans "Orders made through this sales channel cannot be deleted - even if the ticket shop is in test mode!" %}
</strong>
</div>
{% endif %}
{% endif %}
{% endblock %}
{% block footer %}

View File

@@ -36,6 +36,14 @@
<div class="alert alert-info">
{{ p.provider.test_mode_message }}
</div>
{% if not request.event.sales_channel.testmode_supported %}
<div class="alert alert-danger">
{% trans "This sales channel does not provide support for testmode." %}
<strong>
{% trans "If you continue, you might pay an actual order with non-existing money!" %}
</strong>
</div>
{% endif %}
{% else %}
<div class="alert alert-warning">
{% trans "This payment provider does not provide support for testmode." %}