Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion plaid/api/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,25 @@ def stripeBankAccountTokenCreate(self, access_token, account_id):
Create a Stripe bank_account token for a given account ID
(`HTTP docs <https://plaid.com/docs/link/stripe>`__)

:param str public_token:
:param str access_token:
:param str account_id:
'''
return self.client.post('/processor/stripe/bank_account_token/create',
{
'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 <https://plaid.com/docs/link/dwolla>`__)

: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,
})
12 changes: 11 additions & 1 deletion tests/integration/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'