Funding sources error 2.0


(Michael Arulgnanendran) #1

Hi, I’m using the code below, but I’m sure I dont have the correct url for the funding source and that’s why I’m getting the error. Both my code and error are below. I’m kind of stumped, where can i get the URL for a my Sandbox account funding source?

Error

File “C:\Users\Sherlock\Anaconda3\lib\site-packages\dwollav2\response.py”, line 7, in init
raise Error.map(res)

ValidationError: {“code”:“ValidationError”,“message”:“Validation error(s) present. See embedded errors list for more details.”,"_embedded":{“errors”:[{“code”:“Invalid”,“message”:“Funding source not found.”,“path”:"/_links/source/href","_links":{}}]}}

Code

import dwollav2

client = dwollav2.Client(
key = ‘yyy’,
secret = ‘xxxx’,
environment = ‘sandbox’
)
account_token = client.Token(access_token = ‘hCKCWEoMzrGDezXlZZhYEjNqHUmHkuTaRFu8yjOnVLOX34Z2rL’,
refresh_token = ‘TMR1rolwmYiCiMzZpAF9IsR2CN7FfPkM6AI61iu4MbatzPqEIi’)

#[funding_source_url = ‘https://api-uat.dwolla.com/funding-sources/aca7559f-bf6a-4a1a-b22f-f558f5e4a2a0
#funding_source = account_token.get(funding_source_url)
#funding_source.body[‘name’] # => ‘Test checking account’] not using this code yet, not sure it’s necessary

request_body = {
’_links’: {
‘source’: {
‘href’: ‘https://api-uat.dwolla.com/funding-sources/[6113318b-5707-4ced-9289-23ee792c29c3]’ WHAT SHOULD THIS BE?
},
‘destination’: {
‘href’: ‘https://api-uat.dwolla.com/funding-sources/4d6b2115-b689-461f-bc59-63b4e9f0d5b9
}
},
‘amount’: {
‘currency’: ‘USD’,
‘value’: ‘1.00’
},
‘metadata’: {
‘paymentId’: ‘12345678’,
‘note’: ‘payment for completed work Dec. 1’
},
‘clearing’: {
‘destination’: ‘next-available’
}
}

transfer = account_token.post(‘transfers’, request_body)
transfer.headers[‘location’] # => ‘https://api.dwolla.com/transfers/74c9129b-d14a-e511-80da-0aa34a9b2388


(Michael Arulgnanendran) #2

resolved. thank you