[REM] website_sale: remove dead controllers and templates used by old payment form
Those do not seem necessary anymore since commit 1fdb10f0ac introduced
new routes along with the new payment form.
This commit is contained in:
@@ -760,27 +760,6 @@ class WebsiteSale(http.Controller):
|
||||
|
||||
return request.render("website_sale.payment", render_values)
|
||||
|
||||
@http.route(['/shop/payment/transaction_token/confirm'], type='json', auth="public", website=True)
|
||||
def payment_transaction_token_confirm(self, tx, **kwargs):
|
||||
tx = request.env['payment.transaction'].sudo().browse(int(tx))
|
||||
if not tx or not request.website.sale_get_transaction() or tx != request.website.sale_get_transaction():
|
||||
return dict(success=False, error='Tx missmatch')
|
||||
res = tx.confirm_sale_token()
|
||||
if res is not True:
|
||||
return dict(success=False, error=res)
|
||||
return dict(success=True, url='/shop/payment/validate')
|
||||
|
||||
@http.route(['/shop/payment/transaction_token'], type='http', methods=['POST'], auth="public", website=True)
|
||||
def payment_transaction_token(self, tx_id, **kwargs):
|
||||
tx = request.env['payment.transaction'].sudo().browse(int(tx_id))
|
||||
if (tx and request.website.sale_get_transaction() and
|
||||
tx.id == request.website.sale_get_transaction().id and
|
||||
tx.payment_token_id and
|
||||
tx.partner_id == tx.sale_order_id.partner_id):
|
||||
return request.render("website_sale.payment_token_form_confirm", dict(tx=tx))
|
||||
else:
|
||||
return request.redirect("/shop/payment?error=no_token_or_missmatch_tx")
|
||||
|
||||
@http.route(['/shop/payment/transaction/',
|
||||
'/shop/payment/transaction/<int:so_id>',
|
||||
'/shop/payment/transaction/<int:so_id>/<string:access_token>'], type='json', auth="public", website=True)
|
||||
|
||||
@@ -1557,73 +1557,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="payment_token_form">
|
||||
<form method='POST' action="/shop/payment/transaction_token">
|
||||
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
|
||||
<input type="hidden" name="tx_id" t-att-value="tx.id"/>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<template id="payment_token_form_confirm">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="additional_title">Shop - Confirm payment</t>
|
||||
<div id="wrap">
|
||||
<div class="container oe_website_sale">
|
||||
<div class="row">
|
||||
<t t-call="website_sale.wizard_checkout">
|
||||
<t t-set="step" t-value="40" />
|
||||
</t>
|
||||
<h2 class="mb32 ml16">Confirm <em t-field="tx.sale_order_id.name" /> Payment</h2>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-md-9 col-sm-12">
|
||||
<div class='row'>
|
||||
<div class='col-sm-4 well'>
|
||||
<div class="h4 text-center">Summary</div>
|
||||
<t t-call="website_sale.total">
|
||||
<t t-set='website_sale_order' t-value='tx.sale_order_id'/>
|
||||
</t>
|
||||
<i class='text-danger' t-if="tx.acquirer_id.fees_active">! Some processing fees will be applied</i>
|
||||
</div>
|
||||
<div class="oe_pay_token col-sm-8">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-body">
|
||||
<div class='js_token_load' style='display:none;'>Transaction processing ...</div>
|
||||
<div class='js_token_load'>
|
||||
<p class="text-center">
|
||||
<i class="fa fa-3x fa-credit-card text-muted" aria-hidden="true"></i><br/>
|
||||
Are you sure you want to pay with this card: <br/>
|
||||
<b><t t-esc='tx.payment_token_id.short_name'/></b>
|
||||
</p>
|
||||
|
||||
<div class='mt16 text-center'>
|
||||
<form action="/shop/payment/transaction_token/confirm" method='POST'>
|
||||
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
|
||||
<input type='hidden' name='tx' t-att-value='tx.id'/>
|
||||
<a class="btn btn-success btn-md js_btn_valid_tx">Yes, pay with this card</a>
|
||||
<a href='/shop/payment' class="btn btn-danger btn-md">No, choose another method</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-lg-offset-1 col-md-3 hidden-xs hidden-sm text-muted">
|
||||
<t t-call='website_sale.bill_to'>
|
||||
<t t-set="order" t-value= "tx.sale_order_id"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure" />
|
||||
</div>
|
||||
</t>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template id='website_sale.bill_to' name="Bill to">
|
||||
<div class="panel panel-info break-word">
|
||||
<div class="panel-heading">Bill To:</div>
|
||||
|
||||
Reference in New Issue
Block a user