Skip to content

Instantly share code, notes, and snippets.

@beweinreich
Created July 13, 2016 13:20
Show Gist options
  • Save beweinreich/d66ffe982ce6f8e700d5db823f0e0d15 to your computer and use it in GitHub Desktop.
Save beweinreich/d66ffe982ce6f8e700d5db823f0e0d15 to your computer and use it in GitHub Desktop.
from plaid import Client
from plaid import errors as plaid_errors
# import DRF, env vars, etc.
Client.config({'url': settings.PLAID_CONFIG_URL})
plaid_client = Client(client_id=settings.PLAID_CLIENT_ID, secret=settings.PLAID_SECRET)
public_token = "test,chase,connected"
account_id = "someaccountid"
try:
response = plaid_client.exchange_token(public_token, account_id)
except plaid_errors.UnauthorizedError:
raise serializers.ValidationError("Unauthorized Plaid Connection")
stripe_token = response.json()['stripe_bank_account_token'] # this is not showing up?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment