Closed Bug 583428 Opened 14 years ago Closed 14 years ago

API should return a formatted suggested contribution

Categories

(addons.mozilla.org Graveyard :: API, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED
5.12.4

People

(Reporter: bparr, Assigned: davedash)

References

Details

In version 1.5 of the API, the <suggested_amount> element inside the <contribution_data> element does not provide a formatted suggested contribution. It currently only gives the currency and the amount. So, every client that wants to display this information needs to do some sort of mapping. For example, <suggested_amount currency="USD">1.99</suggested_amount> would have to be converted to $1.99 by the client. This seems better done on the server.

One possible solution:
<suggested_amount amount="1.99" currency="USD">$1.99</suggested_amount>
Whiteboard: [API-1.6]
Not sure why this is tagged for API-1.6, we really need this now for Firefox 4.
blocking2.0: --- → ?
This currently looks like:

<suggested_amount currency="USD">5.00</suggested_amount>

Can we adjust it to look like the suggestion in comment 0 without breaking anything? (essentially, adding a $ to the value)
It won't break anything in Firefox, we just display the contents of the element as-is, in fact we don't care about the other attributes Ben suggested but I can see uses for them for other API users.
Ok.  That's why it was marked 1.6 - it was adjusting the API output, but if it doesn't break anything in Fx we're fine.

-> davedash for this milestone as a P3.  We'll up its priority if it doesn't make this freeze.
Assignee: nobody → dd
Priority: -- → P3
Target Milestone: --- → 5.12.4
Whiteboard: [API-1.6]
http://github.com/jbalogh/zamboni/commit/5fc4c41

bparr let me know how this works, it's on addons.allizom.com
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Looks to be working for me
Status: RESOLVED → VERIFIED
Mossop: Some add-ons request contributions but don't set a suggested amount.  What do you want the API to return in that case?  I'm inclined to leave <suggested_amount> out in that case, but we don't know if that will break the AOM.
(In reply to comment #9)
> cc: jbalogh@mozilla.comMossop: Some add-ons request contributions but don't set a suggested amount. 
> What do you want the API to return in that case?  I'm inclined to leave
> <suggested_amount> out in that case, but we don't know if that will break the
> AOM.

In a more general sense, how are missing elements treated in the AOM?  Is it graceful, or crashtastic?
Uh yeah we don't support the concept of there being no suggested amount right now. If hte suggested_amount tag is missing then we'll not show any contribution message at all, if it is there but empty then we'll just show "Suggestion Contribution: ". Neither is good. Let me know which you want to do (leaving the tag out makes sense to me) and I'll get the client working right in bug 617493
(In reply to comment #10)
> (In reply to comment #9)
> > cc: jbalogh@mozilla.comMossop: Some add-ons request contributions but don't set a suggested amount. 
> > What do you want the API to return in that case?  I'm inclined to leave
> > <suggested_amount> out in that case, but we don't know if that will break the
> > AOM.
> 
> In a more general sense, how are missing elements treated in the AOM?  Is it
> graceful, or crashtastic?

Varies on the element but in general if something is missing then we just don't show the info it provided
(In reply to comment #11)
> Let me know which you want to do
> (leaving the tag out makes sense to me) and I'll get the client working right
> in bug 617493

I'll leave it out.  That's bug 617491.
blocking2.0: ? → final+
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.