export const createTransfer = async ({
sourceFundingSourceUrl,
destinationFundingSourceUrl,
amount,
}: TransferParams) => {
try {
const requestBody = {
_links: {
source: {
href: sourceFundingSourceUrl,
},
destination: {
href: destinationFundingSourceUrl,
},
},
amount: {
currency: “USD”,
value: amount,
},
};
console.log(requestBody)
return await dwollaClient
.post(“transfers”, requestBody)
.then((res) => res.headers.get(“location”));
} catch (err) {
console.error(“Transfer fund failed: “, err);
}
};
Request Body:
{
_links: {
source: {
href: ‘https://api-sandbox.dwolla.com/funding-sources/695d806b-f1ca-42a5-8713-372829546325’
},
destination: {
href: ‘https://api-sandbox.dwolla.com/funding-sources/d6dcc741-a744-4951-88b2-6b78eda97277’
}
},
amount: { currency: ‘USD’, value: ‘50.00’ }
}
Error:
Transfer fund failed: Error: {“code”:“ValidationError”,“message”:“Validation error(s) present. See embedded errors list for more details.”,”_embedded”:{“errors”:[{“code”:“NotAllowed”,“message”:“Receiver cannot receive from sender.”,“path”:“/_links/destination/href”,“_links”:{}}]}}
at errorFrom (webpack-internal:///(rsc)/./node_modules/dwolla-v2/src/dwolla/Token.js:52:15)
at eval (webpack-internal:///(rsc)/./node_modules/dwolla-v2/src/dwolla/Token.js:73:29)
I am getting this validationError Don’t know the reason why?I have even logged my request body which is exactly of the same format which is required?Looking forward for your reply.
I am newbie please correct me if something is not right.
In this case, the specific error code is NotAllowed with the message “Receiver cannot receive from sender.” This error is associated with the path /_links/destination/href, which refers to the destination funding source in your transfer request.
This error typically means that the destination account (the receiver) is not allowed to receive funds from the source account (the sender). This could be due to a variety of reasons such as restrictions on the receiver’s account, the account type, status, or settings. The specific reason for your error is that you’re trying to send a payment between two different unverified Customers which is not allowed. It least one party in every transaction must complete the identity verification process and have a Verified Customer account, as referenced here.
To resolve this issue, you’ll need to upgrade one Customer account in this transaction to a Verified Customer (either the sender or receiver).
Hii @spencer Thanks for your reply but when i am trying to create a personal verified customer.Then,I am getting this error:
Creating a Dwolla Customer Failed: Error: {“code”:“ValidationError”,“message”:“Validation error(s) present. See embedded errors list for more details.”,“_embedded”:{“errors”:[{“code”:“Invalid”,“message”:“State must be a 2-letter abbreviation.”,“path”:“/state”,“_links”:{}}]}}
at errorFrom (webpack-internal:///(action-browser)/./node_modules/dwolla-v2/src/dwolla/Token.js:52:15)
at eval (webpack-internal:///(action-browser)/./node_modules/dwolla-v2/src/dwolla/Token.js:73:29)
From previous event:
at handleResponse (webpack-internal:///(action-browser)/./node_modules/dwolla-v2/src/dwolla/Token.js:60:21)
{
firstName: ‘anshu’,
lastName: ‘kumar’,
address1: ‘haryana’,
city: ‘haryana’,
state: ‘HR’,
postalCode: ‘222312’,
dateOfBirth: ‘2024-06-05’,
ssn: ‘1234’,
email: ‘anshu1@gmail.com’,
type: ‘personal’
}
These are my parameter that i am sending.
Here is my code:
export const createDwollaCustomer = async (
newCustomer: NewDwollaCustomerParams
) => {
try {
console.log(newCustomer)
return await dwollaClient
.post(“customers”, newCustomer)
.then((res) => res.headers.get(“location”));
} catch (err) {
console.error("Creating a Dwolla Customer Failed: ", err);
}
};
The state parameter is already of size which is 2.Then,why I am getting this error.
Looking forward for your reply.
The state needs to be a two character code that corresponds to a U.S. person’s physical address. At this time, Dwolla does not support individual Customer accounts for users that reside outside of the United States.
Thanks @spencer I finally solved my all problems.
Really appreciate the community support of Dwolla.Great Work.