diff --git a/mkt/ecosystem/templates/ecosystem/build_payments.html b/mkt/ecosystem/templates/ecosystem/build_payments.html deleted file mode 100644 index 944f7b870b..0000000000 --- a/mkt/ecosystem/templates/ecosystem/build_payments.html +++ /dev/null @@ -1,225 +0,0 @@ -{% extends 'ecosystem/base.html' %} -{% from "ecosystem/macros.html" import navigation with context %} - -{% block title %} - {{ hub_page_title(_('Payments')) }} -{% endblock %} - -{% block content %} -
- {{ navigation('build_payments') }} -
-

Payments

-

There are two kinds of payments made by app end users in the Firefox - Marketplace: a payment made to purchase an app (a paid app), and a - payment made to buy something after the app is installed (an in-app - payment). This page covers the flow for building and submitting apps - that use both kinds of payments.

-

The - App development API reference is a central place to - find a lot of useful links to all steps in the process. More details on - payments are given below.

-

Decide on a Packaging Model (Packaged vs. Hosted)

-

Before learning about payments, it will help to decide whether your - app should be packaged or hosted. And if you need a packaged app, it - will need to follow a Content Security Policy (CSP). See the references - below for information about these things.

- -

Building a Paid App

-

When an app is sold on the Marketplace, a digital receipt for the sale - is created. Although it is not required that your app verify the - receipt, you should do it to help prevent pirating of your app. To - do this, you code your app so it verifies the receipt when the app - runs.

-

Verifying Receipts

-

Here are some references on verifying receipts.

- -

Submitting a Paid App to the Marketplace

- -

Building an App with In-App Payments

-

The following steps give the general flow for building an app that - uses in-app payments.

-
    -
  1. Get an API key. -
      -
    • - In-app payment keys -

      Marketplace developer page where you get a development key to - use while you are developing the app. Explains that you get an - official production key when you submit the app.

      -
    • -
    -
  2. -
  3. Add a JWT request from the client to the server. - -
  4. -
  5. Add a JWT response from the server to the client. -
      -
    • - - In-app payments -

      Mentions the simulate field for development and - testing.

      -
    • -
    • - JSON Web Token -

      A very technical specification useful for developers who don't - already have a JWT library for their backend/server - language.

      -
    • -
    -
  6. -
  7. Add a - - window.navigator.mozPay() call from the client - to the Marketplace payment service.
  8. -
  9. Add a postback handler on the server. -
      -
    • - - In-app payments -

      Mentions how a postback must be responded to to complete the - monetary transaction.

      -
    • -
    • - - Web payment -

      Mentions that in production the postback and chargeback URLs - must be over HTTPS, so you are going to need an SSL certificate. - You should be using encrypted traffic protocols like HTTPS and - WSS for payments.

      -
    • -
    -
  10. -
  11. Release the content to the client.
  12. -
-

Submit an App with In-App Payments

-
    -
  1. Remove the simulate field from the JWT.

    Mentioned in - - In-app payments.

    -
  2. -
  3. Use HTTPS for postback and chargeback URLs.

    Mentioned in - Web - payment.

    -
  4. -
  5. Submit the app to the Firefox Marketplace, choosing the - In-app option.
  6. -
  7. Get a new API secret. -

    See the - In-app payment keys page.

    -
  8. -
  9. Set up a Bango payment account in the developer's section of the - Marketplace.
  10. -
-

Getting More Help

- -
-
-{% endblock %} diff --git a/mkt/ecosystem/templates/ecosystem/firefox_os_simulator.html b/mkt/ecosystem/templates/ecosystem/firefox_os_simulator.html deleted file mode 100644 index cc2bbda24d..0000000000 --- a/mkt/ecosystem/templates/ecosystem/firefox_os_simulator.html +++ /dev/null @@ -1,424 +0,0 @@ -{% extends 'ecosystem/base.html' %} -{% from 'ecosystem/macros.html' import navigation with context %} - -{% block title %} - {{ hub_page_title() }} | {{ title }} -{% endblock %} - -{% block content %} -
- {{ navigation(page) }} - -
-

{{ _('Firefox OS Simulator') }}

- -
- {% trans issues='https://github.com/mozilla/r2d2b2g/issues?state=open', - dev_tools_list='https://lists.mozilla.org/listinfo/dev-developer-tools', - irc='irc://irc.mozilla.org/#devtools' %} -

The Firefox OS Simulator is still at an early stage of development, - and isn't complete or fully reliable.

-

If you find any bugs, please file them on - GitHub, and if you have any questions, try asking on the - dev-developer-tools mailing list - or on #devtools on irc.mozilla.org.

- {% endtrans %} -
- -

- {% trans %} - The Firefox OS Simulator add-on is a tool that enables you to test and - debug your app on the desktop. The code-test-debug cycle is much - faster with the simulator than with a real device, and of course, you - don't need a real device in order to use it. - {% endtrans %} -

-

{{ _('Essentially, the Simulator add-on consists of:') }}

- -

{{ _('The screenshot below shows a debugging session using the Simulator.') }}

-

- {% trans %} - The Dashboard is on the top-right, running inside a Firefox tab. We've - added one app, a packaged app called "Where am I?". At the top-left the - app is running in the Simulator. We've also connected the debugging - tools, which are in the window at the bottom. You can see that we've - just hit a breakpoint in the app. - {% endtrans %} -

-

-

{{ _('This guide covers the following topics:') }}

- -

- {% trans walkthrough='https://developer.mozilla.org/docs/Tools/Firefox_OS_Simulator/Simulator_Walkthrough' %} - For a practical walkthrough that shows how to use the Simulator to - debug a real web app, see the Simulator - Walkthrough page. - {% endtrans %} -

-

{{ _('Installing the Simulator add-on') }}

-

- {% trans %} - The Simulator is packaged and distributed as a Firefox add-on. To install it:
-
- 1. Using Firefox, go to the appropriate link for your host operating system. You'll probably have to tell Firefox to allow the site to install software: - {% endtrans %} -

- -

- {% trans bug_814505='https://bugzilla.mozilla.org/show_bug.cgi?id=814505' %} - 2. Click "Add to Firefox".
- 3. Once the add-on has downloaded you will be prompted to install it: click "Install Now".
-
- Because of the size of the add-on, Firefox may freeze for several - seconds while installing it, and a dialog titled "Warning: Unresponsive - script" may appear. It it does, click "Continue" to wait for - installation to finish. This issue is being tracked as - bug 814505.
-
- Once you have installed the Simulator add-on, Firefox will periodically - check for newer versions and keep it up to date for you. - {% endtrans %} -

-

- {% trans %} - The Dashboard opens automatically when you install the Simulator, and you can reopen it - at any time by going to the "Firefox" menu (or the "Tools" menu on OS X and Linux), then - "Web Developer", then "Firefox OS Simulator": - {% endtrans %} -

-

-

- {% trans %} - The Dashboard is the tool you use to add your app to the Simulator and run it. Here's - what it looks like: - {% endtrans %} -

-

-

{{ _('Adding, updating, and removing apps') }}

-

{{ _('Adding apps') }}

-

- {% trans packaged_apps='https://developer.mozilla.org/docs/Apps/Packaged_apps', - manifests=url('ecosystem.build_manifests') %} - To add a packaged app to the Simulator, open the - Dashboard, click "Add Directory" and select the manifest - file for your app. - {% endtrans %} -

-

- {% trans %} - To add a hosted app, enter a URL in the textbox where it says "URL for page or - manifest.webapp", then click "Add URL". If the URL points to a manifest, then that - manifest will be used. If it doesn't, the Dashboard will generate a manifest for - the URL: so you can add any website as an app just by entering its URL. - {% endtrans %} -

-

- {% trans %} - When you add an app, the Dashboard will run a series of tests on your manifest file, - checking for common problems. See the section on - Manifest Validation for details on what tests are run. - {% endtrans %} -

-

- {% trans %} - Unless manifest validation reveals that your app has errors, the Dashboard will then - automatically run your app in the Simulator. - {% endtrans %} -

-

{{ _('Managing apps') }}

-

- {% trans %} - Once you have added an app, it will appear in the Manager's list of installed apps: - {% endtrans %} -

-

-

- {% trans %} - Each entry gives us the following information about the app: - {% endtrans %} -

- -

{{ _('It also gives us three commands:') }}

- -

- {% trans %} - If you've connected a Firefox OS device to your computer, you'll see a fourth command labeled "Push to device". - {% endtrans %} -

-

{{ _('Manifest validation') }}

-

- {% trans %} - When you supply a manifest, the Manager will run some validation tests on it. It reports three categories of problems: - {% endtrans %} -

- -

- {% trans %} - It summarises the problems encountered in the entry for the app: clicking on the summary provides more details. - {% endtrans %} -

-

{{ _('Manifest errors') }}

-

- {% trans %} - The Dashboard will report the following conditions as errors, meaning that you won't be able to run your app in the Simulator without fixing them: - {% endtrans %} -

- -

- {% trans %} - Here's the result of trying to add a manifest file with a missing "name": - {% endtrans %} -

-

-

{{ _('Manifest warnings') }}

-

{{ _('The Dashboard will report the following manifest issues as warnings:') }}

- -

{{ _('Simulator-specific warnings') }}

-

{{ _('Finally, the Manager will emit warnings for apps that use features of Firefox OS not yet fully supported by the Simulator:') }}

- -

{{ _('Running the Simulator') }}

-

{{ _('There are two different ways the Simulator may be started:') }}

- -

- {% trans %} - Either way, once the Simulator is running, the button labeled "Stopped" turns green and the - label changes to "Running". To stop the Simulator, click this button again. - {% endtrans %} -

-

- {% trans %} - The Simulator appears as a separate window, sized so the simulated screen area is 320x480 pixels, - with a toolbar at the bottom that contains some extra features. - {% endtrans %} -

-

- {% trans %} - To simulate touch events you can click the mouse button and drag while holding the button down. - So by clicking and dragging right-to-left from the Home Screen, you'll see the built-in apps, - as well as any apps you have added: - {% endtrans %} -

-

- - -

-

{{ _('Simulator toolbar') }}

-

- {% trans %} - You'll see three buttons on the toolbar at the bottom of - the Simulator window: - {% endtrans %} -

-

-

- {% trans %} - From left to right, these are the Home button, the Rotation Simulation - button, and the Geolocation Simulation button. - {% endtrans %} -

- -

{{ _('Enabling console logging') }}

-

- {% trans %} - If you check the "Console" box underneath the "Stopped/Running" switch, - then the Error Console will be opened when you run the Simulator. Your - app will be able to log to this console using the global console object. - {% endtrans %} -

-

{{ _('Attaching developer tools') }}

-

- {% trans %} - You can attach developer tools to the Simulator, to help debug your - app. At the moment you can only attach the JavaScript Debugger and the - Web Console, but we're working on adding support for more developer - tools. - {% endtrans %} -

-

- {% trans %} - While the Simulator is running another button appears underneath the - "Console" checkbox. It is labeled "Connect...": - {% endtrans %} -

-

-

{% trans %}Click it, and you'll be taken to a page that looks like this:{% endtrans %}

-

-

{% trans %}Click "Connect" here and you'll see another page, this time like this:{% endtrans %}

-

-

- {% trans debug_toolbar='/docs/Tools/Debugger#The_debugger_toolbar' %} - To use the JavaScript Debugger, select - "chrome://prosthesis/content/shell.xul" here. Once it's launched, - you'll need to find your app's scripts in the - script chooser, but if you open your - app and then connect the debugger, your app's main script will be - selected by default: - {% endtrans %} -

-

-

{% trans %}To use the Web Console with your app, select "Main Process" in the "Connect to remote device" window.{% endtrans %}

-

- {% trans %} - At the moment, unfortunately, there's no single debugging target that - will work with both the Web Console and the JS Debugger - but you can - run two simultaneous instances of the debugging tools, one targeting - "shell.xul" and the other targeting "Main Process". - {% endtrans %} -

-

{{ _('Push to device') }}

-

- {% trans %} - If you have a Firefox OS device you can connect it to the Simulator, - and can then push apps from the Dashboard to the device. - {% endtrans %} -

-

{{ _('Connecting a device') }}

-

- {% trans adb='http://developer.android.com/tools/help/adb.html' %} - To connect a device to the Simulator, you need the - Android Debug Bridge (adb) to be installed, - but the Simulator add-on bundles adb for you. You do, though, - need to configure both the Firefox OS device and your desktop OS. - {% endtrans %} -

-
    -
  1. - {% trans %} - On your Firefox OS device: open the Settings app, then Device - Information > More Information > Developer. - In the developer menu, check "Remote debugging". - {% endtrans %} -
  2. -
  3. - {% trans android_tools='https://developer.android.com/tools/device.html' %} - Set up your OS to detect the device. Instructions for this are - OS-specific, and are detailed in point 3 of - "Setting up a Device for Development" - on the Android developer site. The vendor ID to use for Firefox - OS Geeksphone devices is 05c6. - {% endtrans %} -
  4. -
-

{{ _('Pushing apps to the device') }}

-

- {% trans %} - Once you've set up the device and desktop, and connected the device to - your desktop via USB, you'll see the note "Device connected." appear on - the left of the Dashboard, and a new command appear in the entry for - each app labeled "Push": - {% endtrans %} -

-

-

{% trans %}Click "Push", and the app will be installed on the Firefox OS device.{% endtrans %}

-

{{ _('Limitations of the Simulator') }}

-

{% trans %}Note that the Firefox OS Simulator isn't a perfect simulation.{% endtrans %}

-

{{ _('Hardware limitations') }}

-

- {% trans %} - Apart from screen size, the Simulator does not simulate the hardware limitations of a Firefox OS device such as available memory or CPU speed. - {% endtrans %} -

-

{{ _('Audio/video codecs') }}

-

{{ _('The following codecs depend on hardware-accelerated decoding and are therefore not yet supported:') }}

- -

{{ _('Unsupported APIs') }}

-

- {% trans %} - Certain APIs that work on the device won't work on the Simulator, - generally because the supporting hardware is not available on the - desktop. We've implemented simulations for some APIs such as - geolocation, and expect to add more in future releases. However, at - the moment the following APIs are not supported. Using them might - throw errors or just return incorrect results: - {% endtrans %} -

- -

{{ _('Getting help') }}

-

- {% trans issues='https://github.com/mozilla/r2d2b2g/issues?state=open', - mailing_list='https://lists.mozilla.org/listinfo/dev-developer-tools', - irc='irc://irc.mozilla.org/#devtools' %} - If you find any bugs, please file them on GitHub. - If you have a question, try asking us on the - dev-developer-tools mailing list or on #devtools on - irc.mozilla.org. - {% endtrans %} -

-
-
-{% endblock %} diff --git a/mkt/ecosystem/templates/ecosystem/macros.html b/mkt/ecosystem/templates/ecosystem/macros.html index cfcef8b3a2..b0f4eed413 100644 --- a/mkt/ecosystem/templates/ecosystem/macros.html +++ b/mkt/ecosystem/templates/ecosystem/macros.html @@ -149,15 +149,11 @@ {{- _('Developing Game Apps') }}
  • - + {{- _('Payments') }}
  • - + {{- _('Firefox OS Simulator') }}
  • diff --git a/mkt/ecosystem/tests/test_views.py b/mkt/ecosystem/tests/test_views.py index c3881d58e7..a0da354e9d 100644 --- a/mkt/ecosystem/tests/test_views.py +++ b/mkt/ecosystem/tests/test_views.py @@ -10,7 +10,7 @@ from amo.urlresolvers import reverse VIEW_PAGES = ( 'build_app_generator', 'build_dev_tools', 'build_quick', 'build_reference', 'build_tools', 'design_concept', 'design_fundamentals', 'design_ui', - 'dev_phone', 'partners', 'publish_deploy', 'support', 'build_payments', + 'dev_phone', 'partners', 'publish_deploy', 'support', ) REDIRECT_PAGES = ( @@ -18,6 +18,7 @@ REDIRECT_PAGES = ( 'build_manifests', 'build_mobile_developers', 'build_web_developers', 'design_patterns', 'ffos_guideline', 'publish_hosted', 'publish_packaged', 'publish_review', 'publish_submit', 'responsive_design', + 'firefox_os_simulator', 'build_payments', ) diff --git a/mkt/ecosystem/urls.py b/mkt/ecosystem/urls.py index 3e421eeef5..ad12c931b1 100644 --- a/mkt/ecosystem/urls.py +++ b/mkt/ecosystem/urls.py @@ -51,6 +51,12 @@ redirect_patterns = patterns('', url('^docs/web_developers$', redirect_doc('/Web/Apps/Quickstart/Build/For_Web_developers'), name='ecosystem.build_web_developers'), + url('^docs/firefox_os_simulator$', + redirect_doc('/Tools/Firefox_OS_Simulator'), + name='ecosystem.firefox_os_simulator'), + url('^docs/payments$', + redirect_doc('/Web/Apps/Quickstart/Build/Payments'), + name='ecosystem.build_payments'), ) urlpatterns = redirect_patterns + patterns('', @@ -58,8 +64,6 @@ urlpatterns = redirect_patterns + patterns('', url('^partners$', views.partners, name='ecosystem.partners'), url('^support$', views.support, name='ecosystem.support'), url('^dev_phone$', views.dev_phone, name='ecosystem.dev_phone'), - url('^docs/firefox_os_simulator$', views.firefox_os_simulator, - name='ecosystem.firefox_os_simulator'), url('^docs/concept$', views.design_concept, name='ecosystem.design_concept'), url('^docs/fundamentals$', views.design_fundamentals, @@ -82,8 +86,6 @@ urlpatterns = redirect_patterns + patterns('', name='ecosystem.build_app_generator'), url('^docs/dev_tools$', views.build_dev_tools, name='ecosystem.build_dev_tools'), - url('^docs/payments$', views.build_payments, - name='ecosystem.build_payments'), url('^docs/apps/(?P\w+)?$', views.apps_documentation, name='ecosystem.apps_documentation'), diff --git a/mkt/ecosystem/views.py b/mkt/ecosystem/views.py index f54924adc8..19c7651597 100644 --- a/mkt/ecosystem/views.py +++ b/mkt/ecosystem/views.py @@ -366,12 +366,6 @@ def build_dev_tools(request): {'page': 'build_dev_tools', 'category': 'build'}) -def build_payments(request): - """Build - Payments page.""" - return jingo.render(request, 'ecosystem/build_payments.html', - {'page': 'build_payments', 'category': 'build'}) - - def apps_documentation(request, page=None): """Page template for all reference apps.""" @@ -510,12 +504,3 @@ def apps_documentation(request, page=None): return jingo.render(request, ('ecosystem/reference_apps/%s.html' % page), ctx) - - -def firefox_os_simulator(request): - """Landing page for Firefox OS Simulator.""" - ctx = { - 'page': 'firefox_os_simulator', - 'category': 'build', - } - return jingo.render(request, 'ecosystem/firefox_os_simulator.html', ctx)