I have a Vue app that uses dwolla-funding-source-create to create a new funding source and dwolla-micro-deposits-verify to verify microdeposits. Everything works great in development, and I can create a new account in production, but the dwolla-micro-deposits-verify component just shows “Gathering Info” for a second then disappears.
Chrome console shows a successful request to load the funding source:
After this request succeeds, the dwolla-micro-deposits-verify component just hides the “Gathering Info” element and doesn’t show anything else. Below is the contents of the shadow-root HTML element since as a new user I’m only allowed to upload 1 media element with a new post, so can’t put a screenshot.
Here’s my dwolla.configure() call. I confirmed that I’m calling with environment: 'production'. I don’t get any error logs when experiencing this issue.
dwolla.configure({
environment: nodeEnv === 'production' ? 'production' : 'sandbox',
tokenUrl: '/.netlify/functions/getDwollaToken',
success: res => {
if (res?.resource?.endsWith('/micro-deposits')) {
api.handleDwollaPaymentMethodUpdate({
userId: this.user._id,
dwollaFundingSourceId: res.resource.match(/^funding-sources\/(.+)\/micro-deposits$/)[1]
}).then(res => {
this.showNewPaymentMethodModal = false;
this.verifyMicrodeposits = false;
let updatedExisting = false;
for (let i = 0; i < this.paymentMethods.length; ++i) {
if (this.paymentMethods[i]._id === res.paymentMethod._id) {
this.paymentMethods[i] = res.paymentMethod;
updatedExisting = true;
break;
}
}
if (!updatedExisting) {
this.paymentMethods.unshift(res.paymentMethod);
}
});
}
},
error: err => {
console.error('Dwolla error', err);
}
});
From what I’ve been able to gather, the issue is in the _checkFundingSourceEligibility() function.
const i = null === (e = t._embedded["funding-sources"]) || void 0 === e ? void 0 : e.find((e=>e.id === this.fundingSourceId));
console.log('FL', i)
if (!i)
return this._updateAlert(Me, ze),
!1;
if ("verified" === i.status)
this._updateAlert(Ye, Fe);
else {
const e = i._links;
switch (!0) {
case !!e["verify-micro-deposits"]:
return !0;
case !!e["initiate-micro-deposits"]:
this._updateAlert(Me, Ue);
break;
case !!e["failed-verification-micro-deposits"]:
this._updateAlert(Me, $e);
break;
default:
return !1
}
}
return !1
}
My funding source doesn’t have any of these links, only has “customer”, “micro-deposits”, “self”, “transfer-from-balance”, “transfer-receive” link.
If I change case !!e["verify-micro-deposits"]: to case !!e["micro-deposits"]: then the micro deposits component shows up correctly. Maybe this is an inconsistency with how sandbox vs production returns the micro deposits link?
Hi @vkarpov15! That’s a good observation, thanks for reporting this!
Maybe this is an inconsistency with how sandbox vs production returns the micro deposits link?
This is definitely correct – Sandbox returns both “verify-micro-deposits” and “micro-deposits” links as soon as MDs are initiated. On the other hand, Prod returns “micro-deposits” when MDs are initiated, then returns “verify-micro-deposits” when the MDs have finished processing and can be verified.
It looks like we need to add one more case for !!e["micro-deposits"]: which breaks the switch/case after throwing an error saying something like, “Microdeposits cannot be verified yet”.
I’ll get this added to our backlog. In the meantime, if you’d like, you can add a preliminary check to make sure the “verify-micro-deposits” link is present before loading the dwolla-micro-deposits-verify component.
Thanks for clarifying. I confirmed that the verify micro deposits component shows up correctly once the micro deposits showed up in my bank account. I was able to work around this by adding some extra logic on the backend to pull whether verify-micro-deposits is present or not in my endpoint to load payment methods.