Skip to content

Commit

Permalink
Allow creation of merchant by specifying merchant_uri
Browse files Browse the repository at this point in the history
  • Loading branch information
Pound Marshall committed May 14, 2012
1 parent d10a44a commit d41615a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion balanced/__init__.py
@@ -1,4 +1,4 @@
__version__ = '0.8.2'
__version__ = '0.8.3'

import contextlib

Expand Down
9 changes: 6 additions & 3 deletions balanced/resources.py
Expand Up @@ -451,13 +451,16 @@ def create_buyer(self, email_address, card_uri, name=None, meta=None):
meta=meta,
).save()

def create_merchant(self, email_address, merchant, bank_account_uri=None,
name=None, meta=None):
def create_merchant(self, email_address, merchant=None, bank_account_uri=None,
name=None, meta=None, merchant_uri=None):
if not any([merchant, merchant_uri]):
raise ResourceError('Must have merchant or merchant_uri')
meta = meta or {}
return Account(
uri=self.accounts_uri,
email_address=email_address,
merchant=merchant,
merchant_uri=merchant_uri,
bank_account_uri=bank_account_uri,
name=name,
meta=meta,
Expand Down Expand Up @@ -521,7 +524,7 @@ class Card(Resource):
def debit(self, amount=None, appears_on_statement_as=None,
hold_uri=None, meta=None, description=None):
if not any((amount, hold_uri)):
raise ResourceError('Must amount or hold_uri')
raise ResourceError('Must have amount or hold_uri')

meta = meta or {}
return Debit(
Expand Down

0 comments on commit d41615a

Please sign in to comment.