This repository has been archived by the owner. It is now read-only.
JavaScript library for Firefox Marketplace payments
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


JavaScript library to support Firefox Marketplace payments in a web application.

Build Status Bower Version devDependency Status


This is a complete guide to fxpay usage on MDN


You can find working code in the example directory of this repository

FxPay Developers

To hack on this library you need NodeJS and npm installed. After cloning the source, cd to the root and install all dependencies:

npm install

To execute scripts, you should add the local .bin directory to your $PATH:

export PATH

This is pretty standard for any Node project so you you might already have it.

To test that you have your path set up, type which grunt and make sure you see a path to the executable.

Before going any further, you'll need to install the bower components used for development. Run this:

grunt bower


To build yourself a compressed version of fxpay.js, run this:

grunt compress

The compressed source file will appear in the build directory as fxpay.min.js. You'll also get a source map file in the same directory as

IMPORTANT: To use this library in a web page you have to compress it first because the source code spans multiple files. The usage instructions above explain how to install public releases from Bower which is of course easier.

Running Tests

From a source checkout, run all tests and lint checks like this:

grunt test

To run the JavaScript unit tests continuously while you are developing, type:

grunt karma:dev

This opens a web browser and will report test results to your console. As you edit a code file, it will re-run the tests. NOTE: this can be buggy sometimes.

To fire off a single test run with a browser and see the results, type:

grunt karma:run

Here's how to run a specific test file:

grunt karma:run --tests tests/test-get-products.js

You can also use grep patterns to match files:

grunt karma:run --tests 'tests/test-get-*'

If you want to run a specific test function, you can use a grep pattern to match the name in the describe() or it() definition. For example, run all tests under describe('fxpay.purchase()') like this:

grunt karma:run --grep='fxpay.purchase()'

or run a test defined as it('should open a payment window on the web') like this:

grunt karma:run --grep='should open a payment window on the web'

If you should need to change the karma log-level (default is ERROR) you can do so as follows:

grunt test --log-level=DEBUG

Check For Lint

To check for syntax errors (lint), run:

grunt jshint

Create A Release

You have to do a couple things to create a release:

  • Run grunt release. This compresses the files and copies them to the dist dir.

    • Commit and push your changes to master.
  • Publish the pending github release (or create one) which will tag master at the version string.

    • Make sure all release notes in the draft are up to date.
    • If no release exists yet, create one and title it as the pending version number. For example: 0.0.1.
    • Alternatively, you could manually tag the release with git by running git tag 0.0.1 && git push upstream 0.0.1.
  • Bump the version for the next release. Library version numbers are managed in multiple files. To increment the version number and update all files at once, run grunt bump.

    • Commit and push your changes.

Build the docs

To build the JSDoc API docs locally run grunt docs. The built docs can be found in build/docs.

For anyone with the commit bit that wants to publish the docs to the gh-pages branch of this repo run: grunt publish-docs.

The current API docs are available here: FxPay API Docs (Note: they are currently under development).


See the release page