Closed Bug 1143195 Opened 9 years ago Closed 9 years ago

fxpay: new interface with promises

Categories

(Marketplace Graveyard :: Payments/Refunds, defect)

Avenir
x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2015-04-07

People

(Reporter: kumar, Assigned: kumar)

References

Details

(Whiteboard: [qa-])

the current fxpay interface uses callbacks which are annoying to chain together and have major drawbacks like not handling uncaught exceptions.

After feedback, this proposal for a new promise based interface seems worth implementing: https://gist.github.com/kumar303/53b30027f057cab16384#file-new-fxpay-interface-js-L12 Also, promises are native in Firefox now.
Assignee: nobody → kumar.mcmillan
Blocks: 1058271
Whiteboard: [qa-]
First patch that converts just receipt validation to a promises API: https://github.com/mozilla/fxpay/pull/90
Converted fxpay.getProducts() to a promise: https://github.com/mozilla/fxpay/pull/91 The old callback approach is still supported but logs a deprecation warning.
Converted fxpay.purchase() to a promise: https://github.com/mozilla/fxpay/pull/93
Converted fxpay.init() to promises: https://github.com/mozilla/fxpay/pull/96
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2015-04-07
You need to log in before you can comment on or make changes to this bug.