1. Go to this page and download the library: Download tathevik/fatca library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tathevik / fatca example snippets
use FatcaIdesPhp\Transmitter;
// set tax year
$taxYear=2014;
// example client data
$di=array(
array("Compte"=>"1234","ENT_FIRSTNAME"=>"Clyde","ENT_LASTNAME"=>"Barrow","ENT_FATCA_ID"=>"123-1234-123","ENT_ADDRESS"=>"Some street somewhere","ResidenceCountry"=>"US","posCur"=>100000000,"cur"=>"USD","ENT_TYPE"=>"Individual"),
array("Compte"=>"5678","ENT_FIRSTNAME"=>"Bonnie","ENT_LASTNAME"=>"Parker","ENT_FATCA_ID"=>"456-1234-123","ENT_ADDRESS"=>"Dallas, Texas","ResidenceCountry"=>"US","posCur"=>100,"cur"=>"LBP","ENT_TYPE"=>"Individual")
);
// config with paths to files downloaded
$config = array(
# SSL certificate bought using the private key
"FatcaCrt" => "/var/lib/IDES/keys/ssl_certificate.crt",
# Private key used to get the SSL certificate
"FatcaKeyPrivate" => "/var/lib/IDES/keys/institution-fatca-private.pem",
# public key extracted out of private key above
"FatcaKeyPublic" => "/var/lib/IDES/keys/institution-fatca-public.pem",
# Fatca Sender GIIN
"ffaid" => 'A1BBCD.00000.XY.123',
# Fatca Receiver GIIN, e.g. IRS
"ffaidReceiver" => '000000.00000.TA.840',
# email configuration if Transmitter::toEmail is used
"swiftmailer" => array(
"host" => "my.host.com",
"port" => 12345,
"username" => "myusername",
"password" => "mypassword",
"name" => "My Name",
"reply" => "[email protected]")
);
$factory = new \FatcaIdesPhp\Factory();
$fda = new \FatcaIdesPhp\FatcaDataArray($di);
$fdo = $factory->array2oecd($fda); // , false, null, $taxYear, "zip", "", $config
$tmtr=$factory->transmitter($fdo);
$tmtr->getZip();
$sxe = simplexml_load_file("path/to/xml");
$fdx = new \FatcaIdesPhp\FatcaDataXml($sxe);
$tmtr=$factory->transmitter($fdx);