Deletes the old in-app payments prototype

This commit is contained in:
Kumar McMillan 2012-04-30 16:47:19 -05:00
Родитель 8be72f9d4c
Коммит d37782bc9d
10 изменённых файлов: 9 добавлений и 223 удалений

Просмотреть файл

@ -1,27 +0,0 @@
html {
background: none;
}
body {
border: none;
}
#page {
margin: 0;
min-height: 250px;
min-width: 300px;
max-width: none;
width: auto;
height: auto;
}
.payment-screen {
border: 0;
width: 300px;
margin: 0 auto;
z-index: auto;
border-radius: 0;
box-shadow: none;
padding: 1em;
position: relative;
float: none;
background: none;
left: auto;
}

Просмотреть файл

@ -1,21 +0,0 @@
(function(exports) {
"use strict";
// Close the thank you window. TODO: Thank you windows are going away!
$('#close-moz-pay-win').click(function(e) {
e.preventDefault();
_send('moz-pay-success');
});
$('#close-moz-error-win').click(function(e) {
e.preventDefault();
_send('moz-pay-failure');
});
function _send(msg) {
// This is using '*' because we're not sure what the app domain is.
// Maybe we can find that out.
window.top.postMessage(msg, '*');
}
})(typeof exports === 'undefined' ? (this.inapp_payments = {}) : exports);

Просмотреть файл

@ -0,0 +1 @@
DELETE FROM waffle_switch_mkt where name='in-app-payments-proto';

Просмотреть файл

@ -106,53 +106,6 @@ CSS = {
'css/mkt/buttons.less',
'css/mkt/in-app-payments.less',
),
'mkt/in-app-payments-proto': (
# Temporarily re-using PayPal styles for in-app-payments UI
# until we actually have a UI.
'css/impala/base.css',
'css/legacy/jquery-lightbox.css',
'css/impala/site.less',
'css/impala/typography.less',
'css/global/headerfooter.css',
'css/impala/forms.less',
'css/impala/header.less',
'css/impala/footer.less',
'css/impala/moz-tab.css',
'css/impala/hovercards.less',
'css/impala/toplist.less',
'css/impala/carousel.less',
'css/impala/reviews.less',
'css/impala/buttons.less',
'css/impala/promos.less',
'css/impala/addon_details.less',
'css/impala/policy.less',
'css/impala/expando.less',
'css/impala/popups.less',
'css/impala/l10n.less',
'css/impala/contributions.less',
'css/impala/lightbox.less',
'css/impala/prose.less',
'css/impala/sharing.less',
'css/impala/abuse.less',
'css/impala/paginator.less',
'css/impala/listing.less',
'css/impala/versions.less',
'css/impala/users.less',
'css/impala/collections.less',
'css/impala/tooltips.less',
'css/impala/search.less',
'css/impala/suggestions.less',
'css/impala/colorpicker.less',
'css/impala/personas.less',
'css/impala/login.less',
'css/impala/dictionaries.less',
'css/impala/apps.less',
'css/impala/formset.less',
'css/impala/tables.less',
'css/impala/compat.less',
'css/impala/localizers.less',
'css/mkt/in-app-payments-proto.less',
),
'mkt/stats': (
'css/mkt/stats.less',
),
@ -274,7 +227,4 @@ JS = {
'js/mkt/browserid.js',
'js/mkt/login.js',
),
'mkt/in-app-payments-proto': (
'js/mkt/inapp_payments_proto.js',
),
}

Просмотреть файл

@ -1,26 +0,0 @@
{% extends "mkt/base.html" %}
{% block site_css %}
{{ css('mkt/in-app-payments-proto') }}
{% endblock %}
{% block siteheader %}
{% endblock %}
{% block sitefooter %}
{% endblock %}
{% block js %}
{{ js('mkt/in-app-payments-proto') }}
{% endblock %}
{% block content %}
<div class="paypal-modal modal payment-screen">
{% block screen_content %}
{% endblock %}
</div>
{% endblock %}

Просмотреть файл

@ -1,18 +0,0 @@
{% extends "inapp_pay/prototype/base.html" %}
{% block screen_content %}
<section class="paypal-parent paypal-thank-you">
<h2>{{ loc('Payment received') }}</h2>
<h5>{{ loc('Thank you!') }}</h5>
<p>Close this window to continue.</p>
<p class="mozilla-mission">
{% with learn_more='http://www.mozilla.org/causes' %}
Your purchase helps support Mozilla's mission.
<a href="{{ learn_more }}" target="_blank">Learn more</a>
{% endwith %}
</p>
<p>
<button id="close-moz-pay-win">{{ loc('Close window') }}</button>
</p>
</section>
{% endblock %}

Просмотреть файл

@ -1,18 +0,0 @@
{% extends "inapp_pay/prototype/base.html" %}
{% block screen_content %}
<h2>{{ loc('Mozilla Payments') }}</h2>
<h3>{{ loc('Payment Error') }}
{% if exc_class %}
: {{ exc_class }}
{% endif %}
</h3>
{% if exc_message %}
<p>{{ exc_message }}</p>
{% else %}
<p>{{ loc('There was an error processing your payment. Please try again or contact the app if it persists.') }}</p>
{% endif %}
<p>
<button id="close-moz-error-win">{{ loc('Close window') }}</button>
</p>
{% endblock %}

Просмотреть файл

@ -1,36 +0,0 @@
{% extends "inapp_pay/prototype/base.html" %}
{% block screen_content %}
<h2>{{ loc('Mozilla Payments') }}</h2>
<div class="paypal-content">
<span class="price">{{ currency }} {{ price }}</span>
<h5>{{ item }}</h5>
<p>{{ description }}</p>
<div class="paypal-parent">
{% if user.is_authenticated() %}
<div class="paypal-user">
{% trans user_email=user.email %}
You are logged in as <strong>{{ user_email }}</strong>!
{% endtrans %}
</div>
<form method="post" action="{{ url('inapp_pay.pay') }}">
{{ csrf() }}
<input type="hidden" name="req" value="{{ signed_request }}">
<button class="button prominent paypal">
{# The <small> makes it smaller, <em> makes it darker. Don't localize "PayPal". #}
{{ loc('Pay <small>with</small> Pay<em>Pal</em>')|xssafe }}
</button>
</form>
<p>{{ loc('Complete your purchase with PayPal. No PayPal account is necessary.') }}</p>
{% else %}
<div class="paypal-user login">
<a href="#" class="browserid-login button prominent"
data-url="{{ url('users.browserid_login') }}" data-event="login-complete">
{{ loc('Log in / Register') }}
</a>
</div>
<p>{{ loc('You need to be logged in to the Mozilla Marketplace to make payments.') }}</p>
{% endif %}
</div>
</div>
{% endblock %}

Просмотреть файл

@ -1,8 +0,0 @@
{% extends "inapp_pay/prototype/base.html" %}
{% block screen_content %}
<section class="paypal-parent paypal-thank-you">
<h2>{{ loc('Payment canceled') }}</h2>
<p>{{ loc('Close this window to continue.') }}</p>
</section>
{% endblock %}

Просмотреть файл

@ -43,9 +43,6 @@ def pay_start(request, signed_req, pay_req):
signed_request=signed_req)
tasks.fetch_product_image.delay(pay_req['_config'].pk,
_serializable_req(pay_req))
if waffle.switch_is_active('in-app-payments-proto'):
return jingo.render(request, 'inapp_pay/prototype/pay_start.html',
data)
if not request.user.is_authenticated():
return jingo.render(request, 'inapp_pay/login.html', data)
preapproval = None
@ -146,18 +143,13 @@ def pay(request, signed_req, pay_req):
# Payment was completed using pre-auth. Woo!
_payment_done(request, payment)
if waffle.switch_is_active('in-app-payments-proto'):
tpl = 'inapp_pay/prototype/complete.html'
c = {}
else:
tpl = 'inapp_pay/complete.html'
c = dict(price=pay_req['request']['price'],
product=pay_req['_config'].addon,
currency=pay_req['request']['currency'],
item=pay_req['request']['name'],
description=pay_req['request']['description'],
signed_request=signed_req)
return jingo.render(request, tpl, c)
c = dict(price=pay_req['request']['price'],
product=pay_req['_config'].addon,
currency=pay_req['request']['currency'],
item=pay_req['request']['name'],
description=pay_req['request']['description'],
signed_request=signed_req)
return jingo.render(request, 'inapp_pay/complete.html', c)
@xframe_allow
@ -166,10 +158,7 @@ def pay(request, signed_req, pay_req):
@write
@waffle_switch('in-app-payments-ui')
def pay_status(request, config_pk, status):
if waffle.switch_is_active('in-app-payments-proto'):
tpl_path = 'inapp_pay/prototype/'
else:
tpl_path = 'inapp_pay/'
tpl_path = 'inapp_pay/'
with transaction.commit_on_success():
cfg = get_object_or_404(InappConfig, pk=config_pk)
uuid_ = None