balanced / balanced-api

Balanced API specification.
220 stars 72 forks source link

Bank Account <-> Customer aren't quite linked right #618

Closed steveklabnik closed 9 years ago

steveklabnik commented 10 years ago

Reported by @phethyr

https://dashboard.balancedpayments.com/#/marketplaces/MP3p24TnhXrMhBEGJWIA7Eeq/bank_accounts/BA65ZoeDJ2yLIrh2UUkeaR0u

https://dashboard.balancedpayments.com/#/marketplaces/MP3p24TnhXrMhBEGJWIA7Eeq/customers/CU67abbRIQyz2awcsvWbdtnt

On the bank account page, there's a customer. On the customer's page, there is no bank account.

This isn't a dashboard issue because the API response for 'give me the bank account for this customer' returns zero accounts.

This leads to not being able to charge the customer:

#<Balanced::Conflict: 
                Balanced::Conflict(409)::Conflict:: POST https://api.balancedpayments.com/v1/customers/CU67abbRIQyz2awcsvWbdtnt/credits: 
                no-funding-destination: Customer CU67abbRIQyz2awcsvWbdtnt has no funding destination. Your request id is 
                OHM82885d6edce911e3b0f902b12035401b. >

I'm not sure how it'd get associated one way but another.

phethyr commented 10 years ago

Turns out, the bank account was deleted. Here's the email notification we received from Balanced:

The bank has notified us that the tokenization for bank account BA65ZoeDJ2yLIrh2UUkeaR0u is no longer valid. In response, we have marked this bank account as invalid. The reason given for this is:

Incorrect transaction code.

When you try to load the bank account, you get this error:

bank_account = Balanced::Account.find('/v1/bank_accounts/BA65ZoeDJ2yLIrh2UUkeaR0u')
Balanced::NotFound: Balanced::NotFound(404)::Not Found:: GET https://api.balancedpayments.com/v1/bank_accounts/BA65ZoeDJ2yLIrh2UUkeaR0u: not-found: "/bank_accounts/BA65ZoeDJ2yLIrh2UUkeaR0u" has been deleted. Your request id is OHM920bcc4add2911e39cf202b12035401b. 

That's why the bank account doesn't show up in the customer view on the dashboard. Might be good to update the dashboard to show deleted bank accounts or on the bank account view, show that it's a deleted bank account.

steveklabnik commented 10 years ago

Ahh, a NOC. (notice of change)