Skip to content
Browse files

Allow creation of merchant by specifying merchant_uri

  • Loading branch information...
1 parent d10a44a commit d41615a9c9998e3f1fd0139098a1ef5cb8644367 Pound Marshall committed May 14, 2012
Showing with 7 additions and 4 deletions.
  1. +1 −1 balanced/__init__.py
  2. +6 −3 balanced/resources.py
View
2 balanced/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '0.8.2'
+__version__ = '0.8.3'
import contextlib
View
9 balanced/resources.py
@@ -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,
@@ -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(

0 comments on commit d41615a

Please sign in to comment.
Something went wrong with that request. Please try again.