From d37782bc9d5835e209ceab4a2ab744743e9d8c7c Mon Sep 17 00:00:00 2001 From: Kumar McMillan Date: Mon, 30 Apr 2012 16:47:19 -0500 Subject: [PATCH] Deletes the old in-app payments prototype --- media/css/mkt/in-app-payments-proto.less | 27 ---------- media/js/mkt/inapp_payments_proto.js | 21 -------- migrations/389-remove-inapp-proto.sql | 1 + mkt/asset_bundles.py | 50 ------------------- .../templates/inapp_pay/prototype/base.html | 26 ---------- .../inapp_pay/prototype/complete.html | 18 ------- .../templates/inapp_pay/prototype/error.html | 18 ------- .../inapp_pay/prototype/pay_start.html | 36 ------------- .../inapp_pay/prototype/payment_cancel.html | 8 --- mkt/inapp_pay/views.py | 27 +++------- 10 files changed, 9 insertions(+), 223 deletions(-) delete mode 100644 media/css/mkt/in-app-payments-proto.less delete mode 100644 media/js/mkt/inapp_payments_proto.js create mode 100644 migrations/389-remove-inapp-proto.sql delete mode 100644 mkt/inapp_pay/templates/inapp_pay/prototype/base.html delete mode 100644 mkt/inapp_pay/templates/inapp_pay/prototype/complete.html delete mode 100644 mkt/inapp_pay/templates/inapp_pay/prototype/error.html delete mode 100644 mkt/inapp_pay/templates/inapp_pay/prototype/pay_start.html delete mode 100644 mkt/inapp_pay/templates/inapp_pay/prototype/payment_cancel.html diff --git a/media/css/mkt/in-app-payments-proto.less b/media/css/mkt/in-app-payments-proto.less deleted file mode 100644 index 40603ea552..0000000000 --- a/media/css/mkt/in-app-payments-proto.less +++ /dev/null @@ -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; -} diff --git a/media/js/mkt/inapp_payments_proto.js b/media/js/mkt/inapp_payments_proto.js deleted file mode 100644 index 900307b5d2..0000000000 --- a/media/js/mkt/inapp_payments_proto.js +++ /dev/null @@ -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); diff --git a/migrations/389-remove-inapp-proto.sql b/migrations/389-remove-inapp-proto.sql new file mode 100644 index 0000000000..f01d01b023 --- /dev/null +++ b/migrations/389-remove-inapp-proto.sql @@ -0,0 +1 @@ +DELETE FROM waffle_switch_mkt where name='in-app-payments-proto'; diff --git a/mkt/asset_bundles.py b/mkt/asset_bundles.py index 41a69fe68e..385534a905 100644 --- a/mkt/asset_bundles.py +++ b/mkt/asset_bundles.py @@ -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', - ), } diff --git a/mkt/inapp_pay/templates/inapp_pay/prototype/base.html b/mkt/inapp_pay/templates/inapp_pay/prototype/base.html deleted file mode 100644 index 30e6ce8a8e..0000000000 --- a/mkt/inapp_pay/templates/inapp_pay/prototype/base.html +++ /dev/null @@ -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 %} - -{% endblock %} diff --git a/mkt/inapp_pay/templates/inapp_pay/prototype/complete.html b/mkt/inapp_pay/templates/inapp_pay/prototype/complete.html deleted file mode 100644 index 27f27c0e79..0000000000 --- a/mkt/inapp_pay/templates/inapp_pay/prototype/complete.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "inapp_pay/prototype/base.html" %} - -{% block screen_content %} -
-

{{ loc('Payment received') }}

-
{{ loc('Thank you!') }}
-

Close this window to continue.

-

- {% with learn_more='http://www.mozilla.org/causes' %} - Your purchase helps support Mozilla's mission. - Learn more - {% endwith %} -

-

- -

-
-{% endblock %} diff --git a/mkt/inapp_pay/templates/inapp_pay/prototype/error.html b/mkt/inapp_pay/templates/inapp_pay/prototype/error.html deleted file mode 100644 index 8da642a126..0000000000 --- a/mkt/inapp_pay/templates/inapp_pay/prototype/error.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "inapp_pay/prototype/base.html" %} - -{% block screen_content %} -

{{ loc('Mozilla Payments') }}

-

{{ loc('Payment Error') }} -{% if exc_class %} - : {{ exc_class }} -{% endif %} -

-{% if exc_message %} -

{{ exc_message }}

-{% else %} -

{{ loc('There was an error processing your payment. Please try again or contact the app if it persists.') }}

-{% endif %} -

- -

-{% endblock %} diff --git a/mkt/inapp_pay/templates/inapp_pay/prototype/pay_start.html b/mkt/inapp_pay/templates/inapp_pay/prototype/pay_start.html deleted file mode 100644 index e8f67f19be..0000000000 --- a/mkt/inapp_pay/templates/inapp_pay/prototype/pay_start.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "inapp_pay/prototype/base.html" %} - -{% block screen_content %} -

{{ loc('Mozilla Payments') }}

-
- {{ currency }} {{ price }} -
{{ item }}
-

{{ description }}

-
- {% if user.is_authenticated() %} -
- {% trans user_email=user.email %} - You are logged in as {{ user_email }}! - {% endtrans %} -
-
- {{ csrf() }} - - - -

{{ loc('Complete your purchase with PayPal. No PayPal account is necessary.') }}

- {% else %} - -

{{ loc('You need to be logged in to the Mozilla Marketplace to make payments.') }}

- {% endif %} -
-
-{% endblock %} diff --git a/mkt/inapp_pay/templates/inapp_pay/prototype/payment_cancel.html b/mkt/inapp_pay/templates/inapp_pay/prototype/payment_cancel.html deleted file mode 100644 index 35b6132d78..0000000000 --- a/mkt/inapp_pay/templates/inapp_pay/prototype/payment_cancel.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "inapp_pay/prototype/base.html" %} - -{% block screen_content %} -
-

{{ loc('Payment canceled') }}

-

{{ loc('Close this window to continue.') }}

-
-{% endblock %} diff --git a/mkt/inapp_pay/views.py b/mkt/inapp_pay/views.py index 9af382a572..0ce7a2b810 100644 --- a/mkt/inapp_pay/views.py +++ b/mkt/inapp_pay/views.py @@ -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