From f0d12d26ac07652d6103850cb6b5a7d55fa5afad Mon Sep 17 00:00:00 2001 From: Justin Myers Date: Thu, 31 May 2018 09:51:04 -0700 Subject: [PATCH] Add support for Dwolla processor token --- plaid/api/processor.py | 16 +++++++++++++++- tests/integration/test_processor.py | 12 +++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/plaid/api/processor.py b/plaid/api/processor.py index a21f2f7b2..3db2d9449 100644 --- a/plaid/api/processor.py +++ b/plaid/api/processor.py @@ -9,7 +9,7 @@ def stripeBankAccountTokenCreate(self, access_token, account_id): Create a Stripe bank_account token for a given account ID (`HTTP docs `__) - :param str public_token: + :param str access_token: :param str account_id: ''' return self.client.post('/processor/stripe/bank_account_token/create', @@ -17,3 +17,17 @@ def stripeBankAccountTokenCreate(self, access_token, account_id): 'access_token': access_token, 'account_id': account_id, }) + + def dwollaBankAccountTokenCreate(self, access_token, account_id): + ''' + Create a Dwolla processor token for a given account ID + (`HTTP docs `__) + + :param str access_token: + :param str account_id: + ''' + return self.client.post('/processor/dwolla/processor_token/create', + { + 'access_token': access_token, + 'account_id': account_id, + }) diff --git a/tests/integration/test_processor.py b/tests/integration/test_processor.py index 826ae911a..08c92c30c 100644 --- a/tests/integration/test_processor.py +++ b/tests/integration/test_processor.py @@ -12,10 +12,20 @@ create_client ) -def test_processor_token(): + +def test_stripe_processor_token(): client = create_client() # Just test the failure case - behavior here depends on the API keys used with pytest.raises(InvalidRequestError) as e: client.Processor.stripeBankAccountTokenCreate( 'fakeAccessToken', 'fakeAccountId') assert e.code == 'INVALID_INPUT' + + +def test_dwolla_processor_token(): + client = create_client() + # Just test the failure case - behavior here depends on the API keys used + with pytest.raises(InvalidRequestError) as e: + client.Processor.dwollaBankAccountTokenCreate( + 'fakeAccessToken', 'fakeAccountId') + assert e.code == 'INVALID_INPUT'