As per your documentation and our understanding about Instant account verification we implemented following step please check and let us know if we are doing anything wrong in the process.
Step 1 : Create verified customer get link with customer id in response with following code
$customer = [
'firstName' => 'Jane',
'lastName' => 'Merchant',
'email' => 'janeMerchant@email.com',
'type' => 'business',
'address' => '99-99 33rd St',
'city' => 'Some City',
'state' => 'NY',
'postalCode' => '11101',
'dateOfBirth' => '1970-01-01',
'ssn' => '1234',
'businessClassification' => '9ed38155-7d6f-11e3-83c3-5404a6144203',
'businessType' => 'llc',
'businessName' => 'Jane Corp',
'ein' => '12-3456789'
];
$apiClient = new DwollaSwagger\ApiClient(DWOLLA_BASE_URL);
$customersApi = new DwollaSwagger\CustomersApi($apiClient);
$location = $customersApi->create($customer); //all key and value need for create customer
Note : We get a link of created verified customer follow with customer id
Step 2 : After Creating verified customer generate Iav Token using following code
$apiClient = new DwollaSwagger\ApiClient(DWOLLA_BASE_URL);
$customersApi = new DwollaSwagger\CustomersApi($apiClient);
$fsToken = $customersApi->getCustomerIavToken(DWOLLA_BASE_URL."customers/".$customer_id);
return $fsToken->token;
Step 3 : After generate IAV token we are creating one HTML page included with Dwolla.js library, Now main things is that Dwolla Directly Create verified bank to the customer without asking detail from the app, application just need to call this html page in web view further process done by the Payment gateway in iframe
$('document').ready(function(){
var iavToken = '<?php echo $iav ?>';
dwolla.configure('sandbox');
dwolla.iav.start('<?php echo $iav ?>', {
container: 'iavContainer',
stylesheets: [
'http://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext',
'http://myapp.com/iav/someStylesheet.css'
],
microDeposits: false,
fallbackToMicroDeposits: false
}, function(err, res) {
console.log("Error : " + JSON.stringify(err)+" Response : "+ JSON.stringify(res));
});
});
We set IAV token in JavaScript coming from server side.
While this HTML page is call from application with IAV token Dwolla load their own view in iframe with selecting bank, online ID etc…
After complete the process of adding bank detail in iframe it will give successful message on screen and success response in console of browser.
[Note : As all process are running inside iframe, at last we just have only fund id in our hand except other bank information]
Step 4 : After step 3 we are trying to transfer money from one bank account to another account using below code
$transfer_request = array (
'_links' => array (
'source' => array (
'href' => DWOLLA_BASE_URL.'/funding-sources/'.$source,
),
'destination' => array (
'href' => DWOLLA_BASE_URL.'/funding-sources/'.$destination,
),
),
'amount' => array (
'currency' => 'USD',
'value' => $amount,
),
"fees" => array(
"_links" => array(
"charge-to" => array(
"href" => "http://api-uat.dwolla.com/customers/07D59716-EF22-4FE6-98E8-F3190233DFB8"
)
),
"amount" => array(
"value" => "2.00",
"currency" => "USD"
)
)
);
$transferApi = new DwollaSwagger\TransfersApi($apiClient);
$myAccount = $transferApi->create($transfer_request);
return $myAccount;
We get transfer link with transfer id we also found the transfer in Dwolla console but it was in pending status
As we are using sandbox account we process that transfer from the Dwolla Sandbox Console and transfer status is change from PENDING to SUCCESS
[Note : Process transfer option is not available for production account]