Merge lp://staging/~michael.nelson/software-center/add-initiate-purchase into lp://staging/~canonical-ca-hackers/software-center/scaclient

Proposed by Michael Nelson
Status: Merged
Merged at revision: 9
Proposed branch: lp://staging/~michael.nelson/software-center/add-initiate-purchase
Merge into: lp://staging/~canonical-ca-hackers/software-center/scaclient
Diff against target: 133 lines (+105/-1)
1 file modified
scaclient.py (+105/-1)
To merge this branch: bzr merge lp://staging/~michael.nelson/software-center/add-initiate-purchase
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Review via email: mp+137831@code.staging.launchpad.net

Description of the change

This scaclient branch adds the functionality for two new api calls, retrieve_payment_method and purchase_with_default_method.

These are tested in the following two SCA branches:

https://code.launchpad.net/~michael.nelson/software-center-agent/initiate-purchase-api/+merge/137832

and

https://code.launchpad.net/~michael.nelson/software-center-agent/further-tests-scaclient/+merge/139717

NOTES:
 * For the purchase_with_default_method call, i'm assuming that the oauth token used to authenticate will itself be the fresh token (as the client can use the SSO api to refresh a token). But if the decision goes otherwise, I can update that also.
 * Also, currently the subscription id is being returned as 'order_id', but based on the gdoc, perhaps 'sca_%' % subscription['id'] is intended?

To test the scaclient, branch the further-tests-scaclient branch above, link this current scaclient branch in the right spot and run the tests:
$ bzr branch lp:~michael.nelson/software-center-agent/further-tests-scaclient
$ bzr branch lp:~michael.nelson/software-center/add-initiate-purchase
$ cd further-tests-scaclient && fab bootstrap
$ cd django_project && rm scaclient.py && ln -s ../../add-initiate-purchase/scaclient.py
$ cd .. && fab test:softwarecenteragent.SCAClientSubscriptionsTestCase

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Looks good to me.

My only minor concern is that order-id and subscription-id being identical is a bit confusing, maybe we should have a the subscription id encoded in the order-id much like you suggested? Like "sca_subscriptionid:%s" % subscription['id'] or something? just to make it obvious that they are not the same (or if they are the same we could make this obvious too as the subscription-id is the bit that will be used by aptdaemon/software-center-purchase-helper to actually retrieve the app.

review: Approve
26. By Michael Nelson

orde_id should be 'scasubscription_id:%s' % subscription['id'].

Revision history for this message
Michael Nelson (michael.nelson) wrote :

On Mon, Dec 17, 2012 at 9:35 AM, Michael Vogt <email address hidden>wrote:

> Review: Approve
>
> Looks good to me.
>
> My only minor concern is that order-id and subscription-id being identical
> is a bit confusing, maybe we should have a the subscription id encoded in
> the order-id much like you suggested? Like "sca_subscriptionid:%s" %
> subscription['id'] or something? just to make it obvious that they are not
> the same (or if they are the same we could make this obvious too as the
> subscription-id is the bit that will be used by
> aptdaemon/software-center-purchase-helper to actually retrieve the app.
>

Thanks mvo - I've pushed that change with r26, the relevant test change
r887 on the sca branch at:

https://code.launchpad.net/~michael.nelson/software-center-agent/further-tests-scaclient/+merge/139717

> --
>
> https://code.launchpad.net/~michael.nelson/software-center/add-initiate-purchase/+merge/137831
> Your team Canonical Consumer Applications Hackers is subscribed to branch
> lp:~canonical-ca-hackers/software-center/scaclient.
>

--
Michael Nelson - http://micknelson.wordpress.com/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches