inapp cleanup
This commit is contained in:
Родитель
2edbc9be6e
Коммит
bc5587120b
|
@ -22,6 +22,9 @@ var preauth_window;
|
|||
if (win_top.opener) {
|
||||
win_top = win_top.opener;
|
||||
}
|
||||
$('.purchase').click(function(e) {
|
||||
$(this).addClass('purchasing').html($(this).data('purchasing-label'));
|
||||
});
|
||||
$('#setup-preauth').click(function(e) {
|
||||
e.preventDefault();
|
||||
if (preauth_window) {
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
</header>
|
||||
<div>
|
||||
<div class="product-details">
|
||||
<h2>{{ item }}</h2>
|
||||
<p>{{ description }}</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button href="#" class="button disabled">{{ _('purchased') }}</button>
|
||||
<div class="icon">
|
||||
<img src="{{ img }}">
|
||||
</div>
|
||||
<h2>{{ item }}</h2>
|
||||
<p>{{ _('Purchased successfully') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<button class="button close">{{ loc('Close window') }}</button>
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
<form method="post" action="{{ url('inapp_pay.pay') }}">
|
||||
{{ csrf() }}
|
||||
<input type="hidden" name="req" value="{{ signed_request }}">
|
||||
<button href="#" class="button purchase">{{ currency }} {{ price }}</button>
|
||||
<button href="#" class="button purchase"
|
||||
data-purchasing-label="{{ _('Purchasing…') }}">
|
||||
{{ currency }} {{ price }}
|
||||
</button>
|
||||
</form>
|
||||
</footer>
|
||||
{% endblock %}
|
||||
|
|
|
@ -153,10 +153,13 @@ def pay(request, signed_req, pay_req):
|
|||
# Payment was completed using pre-auth. Woo!
|
||||
_payment_done(request, payment)
|
||||
|
||||
cfg = pay_req['_config']
|
||||
|
||||
c = dict(price=pay_req['request']['price'],
|
||||
product=pay_req['_config'].addon,
|
||||
product=cfg.addon,
|
||||
currency=pay_req['request']['currency'],
|
||||
item=pay_req['request']['name'],
|
||||
img=cfg.image_url(pay_req['request'].get('imageURL')),
|
||||
description=pay_req['request']['description'],
|
||||
signed_request=signed_req)
|
||||
return jingo.render(request, 'inapp_pay/complete.html', c)
|
||||
|
|
Загрузка…
Ссылка в новой задаче