Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Latest commit

 

History

History
692 lines (488 loc) · 18.6 KB

payment.rst

File metadata and controls

692 lines (488 loc) · 18.6 KB

Payments

This API is specific to setting up and processing payments for an app in the Marketplace.

Configuring payment accounts

Payment accounts can be added and listed.

Note

Authentication is required.

Upsell

Payment accounts

Preparing payment

Produces the JWT that is passed to navigator.mozPay.

Note

Authentication is required.

Signature Check

Retrieve a JWT that can be used to check the signature for making payments. This is intended for system health checks and requires no authorization. You can pass the retrieved JWT to the WebPay API to verify its signature.

Payment status

Note

Authentication is required.

Installing

When an app is installed from the Marketplace, call the install API. This will record the install.

Free apps

Premium apps

Note

Authentication is required.

Developers

Developers of the app will get a special developer receipt that is valid for 24 hours and does not require payment. See also Test Receipts.

Reviewers

Reviewers should not use this API.

Test Receipts

Returns test receipts for use during testing or development. The returned receipt will have type test-receipt. Only works for hosted apps.

Receipt reissue

This is currently not implemented awaiting bug. It will be used for replacing receipts.

Pay Tiers

Localized tier

To display a price to your user, it would be nice to know how to display a price in the app. The Marketplace does some basic work to calculate the locale of a user. Information that would be useful to show to your user is placed in the localized field of the result.

A request with the HTTP Accept-Language header set to pt-BR, means that localized will contain:

{
    "localized": {
        "amount": "10.00",
        "currency": "BRL",
        "locale": "R$10,00",
        "region": "Brasil"
    }
}

The exact same request with an Accept-Language header set to en-US returns:

{
    "localized": {
        "amount": "0.99",
        "currency": "USD",
        "locale": "$0.99",
        "region": "United States"
    }
}

If a suitable currency for the region given in the request cannot be found, the result will be empty. It could be that the currency that the Marketplace will accept is not the currency of the country. For example, a request with Accept-Language set to fr may result in:

{
    "localized": {
        "amount": "1.00",
        "currency": "USD",
        "locale": "1,00\xa0$US",
        "region": "Monde entier"
    }
}

Please note: these are just examples to demonstrate cases. Actual results will vary depending upon data sent and payment methods in the Marketplace.

Product Icons

Authenticated clients like WebPay need to display external product images in a safe way. This API lets WebPay cache and later retrieve icon URLs.

Note

All write requests (POST, PATCH) require authenticated users to have the ProductIcon:Create permission.

Transaction failure

Note

Requires authenticated users to have the Transaction:NotifyFailure permission. This API is used by internal clients such as WebPay.