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