Skip to content
A catalog of products for navigator.mozPay()
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
www
.gitignore
README.md
package.json
server.js
settings-dist.js
stackato.yml

README.md

mozpay-catalog

This is an experimental prototype of a product catalog server for navigator.mozPay().

If successful, this could let developers do in-app payments without hosting their own server. I.E. Mozilla would provide a server such as this one.

The exact developer API needs more work and should ultimately be an extension of navigator.mozPay(). See the discussion for gory details.

Run the server

You need to host the server on a public IP such as a Stackato PAAS or locally with a tunnel.

Let's get started!

npm install
cp settings-dist.js settings.js

Get an Application Key and Application Secret from the Firefox Marketplace Dev Hub. You probably want to start by getting a key for simulations. Edit settings.js and fill in the keys.

Run a local server:

npm start

Or upload to Stackato:

stackato push

Update the Stackato app with:

stackato update

Open up the app in a Firefox OS browser and purchase one of the items such as the Magic Cheese. You can see a test version of the app running here: http://mozpay-catalog.paas.allizom.org/.

Take a look at www/js/index.js to see the developer API.

You can’t perform that action at this time.