Created
July 28, 2022 03:13
-
-
Save rhettre/ed1837ff66b1f00226f545a18550dae6 to your computer and use it in GitHub Desktop.
Get Connected Bank Account IDs (For Deposits)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import cbpro | |
my_key = "" | |
my_secret = "" | |
my_passphrase = "" | |
def _getBankID(my_key, my_secret, my_passphrase): | |
auth_client = cbpro.AuthenticatedClient(my_key, my_secret, my_passphrase) | |
payment_methods = auth_client.get_payment_methods() | |
print(payment_methods) | |
for method in payment_methods: | |
print(f"Account: {method['name']} | ID: {method['id']}") | |
def lambda_handler(event, context): | |
_getBankID(my_key, my_secret, my_passphrase) | |
return { | |
'statusCode': 200, | |
'body': json.dumps(f'These are you bank IDs!') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this script to get the bank_id field for your connected bank accounts. You need this bank ID field to run the deposit script. To run this, your API keys need the transfer permission or you'll get a 403 Forbidden response.