Confirmed users
324
edits
(I brought the docs up to date with what Mozilla will be shipping in Firefox OS. Some major API changes: prices became pricePoint; postback/chargeback URLs are mandatory; and more!) |
(Document icons, added in https://bugzilla.mozilla.org/show_bug.cgi?id=848675) |
||
Line 76: | Line 76: | ||
"name": "Magical Unicorn", | "name": "Magical Unicorn", | ||
"description": "Adventure Game item", | "description": "Adventure Game item", | ||
"icons": { | |||
"64": "https://yourapp.com/img/icon-64.png", | |||
"128": "https://yourapp.com/img/icon-128.png" | |||
}, | |||
"productData": "user_id=1234&my_session_id=XYZ", | "productData": "user_id=1234&my_session_id=XYZ", | ||
"postbackURL": "https://yourapp.com/payments/postback", | "postbackURL": "https://yourapp.com/payments/postback", | ||
Line 90: | Line 94: | ||
**'''nbf''': (optional) Not-before time. A UTC Unix timestamp of the earliest time the JWT can be processed. | **'''nbf''': (optional) Not-before time. A UTC Unix timestamp of the earliest time the JWT can be processed. | ||
**'''request''' (mandatory): Request object. | **'''request''' (mandatory): Request object. | ||
*** '''id''' (mandatory): A unique identifier for the product you are selling. This only needs to be unique within your own catalog, not unique among all products from all apps. | |||
*** '''pricePoint''' (mandatory): An identifier that corresponds to a price according to the Payment Provider. For example, pricePoint 1 might translate into €0.89 when the buyer is in Europe or $0.99 when in the US, etc. The exact price point values are managed by the Payment Provider and they may change based on currency exchange rates. | *** '''pricePoint''' (mandatory): An identifier that corresponds to a price according to the Payment Provider. For example, pricePoint 1 might translate into €0.89 when the buyer is in Europe or $0.99 when in the US, etc. The exact price point values are managed by the Payment Provider and they may change based on currency exchange rates. | ||
*** '''name''' (mandatory): A short description of the product. | *** '''name''' (mandatory): A short description of the product. | ||
*** '''description''' (mandatory): A long description of the product. | *** '''description''' (mandatory): A long description of the product. | ||
*** ''' | *** '''icons''' (optional): A map of icon URLs for the product you are selling. The keys are width/height pixel values (images must be square). The Payment Provider will use an image at the appropriate size on the payment confirmation page. For details about how Mozilla's Payment Provider handles icons, see the [https://developer.mozilla.org/en-US/docs/Web/Apps/Publishing/In-app_payments payments guide]. | ||
*** '''productData''' (optional): A freeform string, no longer than 255 characters. This can be anything the app might need to identify the product with when a postback is sent back to the app. | *** '''productData''' (optional): A freeform string, no longer than 255 characters. This can be anything the app might need to identify the product with when a postback is sent back to the app. | ||
*** '''postbackURL''' (mandatory): URL where the payment processor sends an HTTP POST message to whenever a purchase completes. The application server needs to acknowledge these POST messages, or else the transactions will be canceled. | *** '''postbackURL''' (mandatory): URL where the payment processor sends an HTTP POST message to whenever a purchase completes. The application server needs to acknowledge these POST messages, or else the transactions will be canceled. | ||
Line 141: | Line 146: | ||
"name": "Magical Unicorn", | "name": "Magical Unicorn", | ||
"description": "Adventure Game item", | "description": "Adventure Game item", | ||
"icons": { | |||
"64": "https://yourapp.com/img/icon-64.png", | |||
"128": "https://yourapp.com/img/icon-128.png" | |||
}, | |||
"productData": "user_id=1234&my_session_id=XYZ", | "productData": "user_id=1234&my_session_id=XYZ", | ||
"postbackURL": "https://yourapp.com/payments/postback", | "postbackURL": "https://yourapp.com/payments/postback", | ||
Line 176: | Line 185: | ||
"name": "Magical Unicorn", | "name": "Magical Unicorn", | ||
"description": "Adventure Game item", | "description": "Adventure Game item", | ||
"icons": { | |||
"64": "https://yourapp.com/img/icon-64.png", | |||
"128": "https://yourapp.com/img/icon-128.png" | |||
}, | |||
"productData": "user_id=1234&my_session_id=XYZ", | "productData": "user_id=1234&my_session_id=XYZ", | ||
"postbackURL": "https://yourapp.com/payments/postback", | "postbackURL": "https://yourapp.com/payments/postback", |