Pointing out the drawbacks of the different models for payments on the web that are currently available, Mozilla has revealed that it is looking to introduce a common web API that would make payments through web devices easier and secure while being flexible and retaining today’s checkout button features that is available for merchants. Partly based on Google Wallet, Mozilla’s WebPayment API will remain open to ensure that it is used by a wide range of payment service providers.

As a first step towards this the Firefox OS maker has introduced the navigator.mozPay function allowing web apps to accept payments. The function, in an ideal scenario, offers a choice of payment service providers. Developer of webapps will have to provide data in the form of a signed JSON Web Token (JWT) for each of those providers. Details that should be included in the JWT are provider’s address; unique IDs of app and product; and success and failure events URLs events. Price of the app is to be specified in the form of tiered price points.

Once the token is formed, it is then forwarded to the payment service provider for further processing. Providers will have to provide a WebPaymentProvider interface that would allow for processing of the JWT. Initial implementations have been released in Node.js and Python with more to follow.

Firefox Marketplace is able to process the payments through the WebPayment API and eager developers can test it using the marketplace. As of now there are only two options for payments – credit cards and mobile phone billing but, more would be available soon.

“Mozilla plans to work with other vendors through the W3C to reach consensus on a common API that supports web payments in the best way possible. After shipping in Firefox OS, Mozilla plans to add navigator.mozPay() to Firefox for Android and desktop Firefox.” notes Mozilla.