Dollaswagger v2 and micro-deposits


(Roberto Tijerino) #1

I have encountered an issue with trying to verify white-label customer’s funding accounts.

When I use a raw GET to the customer’s funding source I get the right information back

Request:
GET: https://api-uat.dwolla.com/funding-sources/006c232b-2485-4145-ad89-cc0792e9fe15

Response:
{
"_links": {
“self”: {
“href”: “https://api-uat.dwolla.com/funding-sources/006c232b-2485-4145-ad89-cc0792e9fe15
},
“customer”: {
“href”: “https://api-uat.dwolla.com/customers/ff41b0f3-4980-40cd-a16c-ce356aef5dc6
}
},
“id”: “006c232b-2485-4145-ad89-cc0792e9fe15”,
“status”: “verified”,
“type”: “balance”,
“name”: “Balance”,
“created”: “2016-01-21T22:48:39.000Z”,
“balance”: {
“value”: “0.00”,
“currency”: “USD”
}
}

For verification purposes I’m using a micro-deposit path. I’m using the funding source ID: 006c232b-2485-4145-ad89-cc0792e9fe15 of a verfied customer by means of the following code

fund_source = “https://api-uat.dwolla.com/funding-sources/006c232b-2485-4145-ad89-cc0792e9fe15

        funding_api.micro_deposits(fund_source, {
                                                 "amount1": {
                                                             "value": "0.03",
                                                             "currency": "USD"
                                                             },
                                                 "amount2": {
                                                             "value": "0.01",
                                                             "currency": "USD"
                                                             }
                                                 }
                                   )

But, I always get an exception of 404

Can anyone help what am I missing or how to correct this issue?


(Stephen Ausman) #2

Hey Roberto, what happens if you do…

funding_api.micro_deposits(fund_source, body = {
  "amount1": {
    "value": "0.03",
    "currency": "USD"
  },
  "amount2": {
    "value": "0.01",
    "currency": "USD"
  }
})

I think you’re just missing the body= keyword argument.


(Spencer Hunter) #3

@roberto_tijerino Also note, you can only trigger micro-deposits on a funding sources that is of type bank. From your response it looks like that funding source id corresponds to a balance funding source.


(Roberto Tijerino) #4

You are right, I am missing the “body=” part of the second parameter. Put it back (accidentally deleted) but still same problem.

I believe the second responder (spencer) also have a point. I did created a type=‘checking’ account for that customer but it got a ‘balance’ account.


(Roberto Tijerino) #5

I try to add another funding-source for the same customer with type=‘checking’ but this time it generated a “bank” type. What can be wrong creating a funding source = “checking”?

        new_fs = funding_api.create_customer_funding_source(fundingUrl, 
                                                            body = {"routingNumber": routingNumber,
                                                                    "accountNumber": accountNumber,
                                                                    "type": accountType, <= IS "checking"
                                                                    "name": accountName
                                                                    }
                                                            )

Getting funding source response:

funding-sources": [
{
"_links": {
“self”: {
“href”: “https://api-uat.dwolla.com/funding-sources/50b31053-acd5-45d4-b355-f1b3ce27b5b9
},
“customer”: {
“href”: “https://api-uat.dwolla.com/customers/ff41b0f3-4980-40cd-a16c-ce356aef5dc6
},
“initiate-micro-deposits”: {
“href”: “https://api-uat.dwolla.com/funding-sources/50b31053-acd5-45d4-b355-f1b3ce27b5b9/micro-deposits
}
},
“id”: “50b31053-acd5-45d4-b355-f1b3ce27b5b9”,
“status”: “unverified”,
“type”: “bank”,
“name”: “test-checking”,
“created”: “2016-01-25T21:52:15.000Z”
},
{
"_links": {
“self”: {
“href”: “https://api-uat.dwolla.com/funding-sources/006c232b-2485-4145-ad89-cc0792e9fe15
},
“customer”: {
“href”: “https://api-uat.dwolla.com/customers/ff41b0f3-4980-40cd-a16c-ce356aef5dc6
},
“with-available-balance”: {
“href”: “https://api-uat.dwolla.com/funding-sources/006c232b-2485-4145-ad89-cc0792e9fe15
}
},
“id”: “006c232b-2485-4145-ad89-cc0792e9fe15”,
“status”: “verified”,
“type”: “balance”,
“name”: “Balance”,
“created”: “2016-01-21T22:48:39.000Z”
}


(Spencer Hunter) #6

Hey @roberto_tijerino, It looks like you successfully created a “bank” funding source for the Customer, which is great! You’ll want to follow the initiate-micro-deposits link and POST to /funding-sources/50b31053-acd5-45d4-b355-f1b3ce27b5b9/micro-deposits


(Roberto Tijerino) #7

Spencer, thank you for the help, however I’m still having issues with the micro-deposits this time I’m getting:
400 Bad Request

Here is the code:
fund_source = “https://api-uat.dwolla.com/funding-sources/50b31053-acd5-45d4-b355-f1b3ce27b5b9/micro-deposits

        mybody = {
                "amount1": {
                            "value": "0.03",
                            "currency": "USD"
                            },
                "amount2": {
                            "value": "0.01",
                            "currency": "USD"
                            }
                }
        
        funding_api.micro_deposits(fund_source, body=mybody)

(Spencer Hunter) #8

@roberto_tijerino, Funding source verification is described in greater detail in this resource article. Initiating and verifying micro-deposits is a two step process. Step 1: Initiate micro-deposits to the bank account. Step 2: Verify micro-deposits.

Initiating micro-deposits to a bank account: you’ll want to initiate a POST with an empty request body. If successful, we’ll respond with an HTTP 201 and a link to /funding-sources/{id}/micro-deposits in the location header.

Verifying micro-deposits: In production, you or users of your application will want to check the bank account in 1-2 business days for two small amounts. Once they see these amounts arrive in their bank they’ll want to verify this amounts. In the Sandbox(UAT), we allow you to verify the bank account if you pass in any two amounts under $0.10. In this step you’ll want to initiate a POST to /funding-sources/{id}/micro-deposits with the request body you provided in your previous reply.

Let us know if you have any additional questions on funding source verification! :slightly_smiling:


(Roberto Tijerino) #9

spencer,

I don’t want to be a pain, I’m just trying to understand this.

When I try this code I get a very strange exception:

try:
fund_source = “https://uat-api.dwolla.com/funding-sources/50b31053-acd5-45d4-b355-f1b3ce27b5b9

retrieved = funding_api.id(fund_source)

except ApiException as e:

except: <-- Exception thrown here. Catch all exception

print "Unexpected error:", sys.exc_info()[0]
print "Unexpected error:", sys.exc_info()[1]
print "Unexpected error:", sys.exc_info()[2]

OUTPUT:
Unexpected error: type 'exceptions.AttributeError’
Unexpected error: ‘module’ object has no attribute 'DateTime’
Unexpected error: traceback object at 0x7fe7080e14d0

I do have the latest from version of swagger-python 1.0.5. Could this be an issue with the API?


(Roberto Tijerino) #10

So very strange but I can get RAW GET and POST to work just fine.

I was able to:

Step 1:
fund_source = "https://api-uat.dwolla.com/funding-sources/50b31053-acd5-45d4-b355-f1b3ce27b5b9"
fund_source_micro = “https://api-uat.dwolla.com/funding-sources/50b31053-acd5-45d4-b355-f1b3ce27b5b9/micro-deposits

fund_source_obj = dwollaRequest.Get(fund_source )

returns what I expected the following to return

retrieved = funding_api.id(fund_source) <== this one throws exceptions

Step 2:

funding_api.micro_deposits(fund_source) works fine

Step 3:

post_result = dwollaRequest.Post(fund_source_micro, {
“amount1”: {
“value”: “0.03”,
“currency”: “USD”
},
“amount2”: {
“value”: “0.01”,
“currency”: “USD”
}
})

Works fine and bank account is flagged as verified.

The API call fails

funding_api.verify_micro_deposits_exist(fund_source, {
“amount1”: {
“value”: “0.03”,
“currency”: “USD”
},
“amount2”: {
“value”: “0.01”,
“currency”: “USD”
}
})

Throws exceptions

I’m going to have to go with a mix of API and HTTP GET/POST unless anyone have any other suggestions.

It could be me but I feel the API is not working properly.


(Chris) #11

I’m using v2 Java SDK and running into issues here as well. Continuing to get a 500 response. I’ve tried submitting VerifyMicroDepositsRequest with populated amount values, as well as empty amount values (assuming to initiate the values need not be set). Are there known issues here @spencer @David?