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

Commit

Permalink
pass in transaction uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy McKay committed Jan 4, 2013
1 parent dfe4e39 commit 9fa9052
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions samples/bango-basic.py
Expand Up @@ -9,10 +9,11 @@
root = 'http://localhost:8001' root = 'http://localhost:8001'


def call(url, method, data): def call(url, method, data):
print
method = getattr(requests, method) method = getattr(requests, method)
url = root + url url = root + url
print 'Calling url:', url print 'Calling url:', url
print 'Data:' print 'Request data:'
pprint.pprint(data) pprint.pprint(data)
data = json.dumps(data) data = json.dumps(data)
result = method(url, data=data, result = method(url, data=data,
Expand All @@ -21,10 +22,13 @@ def call(url, method, data):
if result.status_code not in (200, 201, 202, 204): if result.status_code not in (200, 201, 202, 204):
print 'Error:', result.content print 'Error:', result.content
sys.exit() sys.exit()
print 'Data:'
pprint.pprint(result.json) if result.content:
print print 'Response data:'
return result.json data = result.json
pprint.pprint(data)
return data



uid = str(uuid.uuid4()) uid = str(uuid.uuid4())


Expand Down Expand Up @@ -121,6 +125,7 @@ def call(url, method, data):
call('/bango/billing/', 'post', { call('/bango/billing/', 'post', {
'pageTitle': 'yep', 'pageTitle': 'yep',
'prices': [{'amount': 1, 'currency': 'EUR'}], 'prices': [{'amount': 1, 'currency': 'EUR'}],
'transaction_uuid': str(uuid.uuid4()),
'seller_product_bango': bango_product_uri, 'seller_product_bango': bango_product_uri,
'redirect_url_onerror': 'https://marketplace-dev.allizom.org/mozpay/err', 'redirect_url_onerror': 'https://marketplace-dev.allizom.org/mozpay/err',
'redirect_url_onsuccess': 'https://marketplace-dev.allizom.org/mozpay/ok', 'redirect_url_onsuccess': 'https://marketplace-dev.allizom.org/mozpay/ok',
Expand Down

0 comments on commit 9fa9052

Please sign in to comment.