Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add stripe template improve default form

Michał Ociepka30c7f8aa1267
diff --git a/saleor/payment/templates/payment/default.html b/saleor/payment/templates/payment/default.html
index 3570337a41..14b159fbae 100644
--- a/saleor/payment/templates/payment/default.html
+++ b/saleor/payment/templates/payment/default.html
@@ -5,6 +5,7 @@
{% block forms %}
<form method="{{ form.method }}" class="form-horizontal"{% if form.action %} action="{{ form.action }}"{% endif %}>
{% csrf_token %}
+ {{ form.media }}
{{ form|as_horizontal_form }}
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
diff --git a/saleor/payment/templates/payment/details.html b/saleor/payment/templates/payment/details.html
index b833b81269..d11ab94d41 100644
--- a/saleor/payment/templates/payment/details.html
+++ b/saleor/payment/templates/payment/details.html
@@ -2,26 +2,12 @@
{% load as_horizontal_form from bootstrap %}
{% load i18n %}
-{% block title %}{% trans "Checkout" %} — {{ block.super }}{% endblock %}
+{% block title %}{% trans "Payment" %} — {{ block.super }}{% endblock %}
{% block outerbreadcrumb %}{% endblock %}
{% block content %}
<h2>Payment</h2>
-{% block forms %}
-{% if form %}
-<form method="post" action="{{ form.action }}" class="form-horizontal">
- {% csrf_token %}
- {{ form|as_horizontal_form }}
- <div class="form-group">
- <div class="col-sm-offset-2 col-sm-10">
- <button type="submit" class="btn btn-primary">
- {% trans "Save changes" %}
- </button>
- </div>
- </div>
-</form>
-{% endif %}
-{% endblock forms %}
+{% block forms %}{% endblock %}
{% endblock content %}
diff --git a/saleor/payment/templates/payment/stripe.html b/saleor/payment/templates/payment/stripe.html
new file mode 100644
index 0000000000..cd6aa09f25
--- /dev/null
+++ b/saleor/payment/templates/payment/stripe.html
@@ -0,0 +1,14 @@
+{% extends "payment/details.html" %}
+{% load as_horizontal_form from bootstrap %}
+{% load i18n %}
+
+{% block forms %}
+<form method="{{ form.method }}" class="form-horizontal"{% if form.action %} action="{{ form.action }}"{% endif %}>
+ {% csrf_token %}
+ {{ form.media }}
+ {{ form|as_horizontal_form }}
+ {% if form.errors %}
+ <a class="btn" href="{% url "order:payment:index" token=payment.order.token %}">{% trans "Change payment method" %}</a>
+ {% endif %}
+</form>
+{% endblock forms %}