Code: Select all
<?php
#
# CSV File reference
#
$file = fopen("cmdi_php.csv","r");
while(! feof($file))
{
print_r(fgetcsv($file));
}
fclose($file);
main();
function main()
{
#
# Sample CMDI Web Serice Client (only works with php >= 5)
#
$WSDL = "https://sample.com";
$PARAMS = getRecord();
$client = new SoapClient($WSDL);
$retMsg = $client->_process_a_gift($PARAMS)->_process_a_giftResult;
if (!isset($retMsg) || ...handle exception...) {
echo "ERROR - retcode=$ retMsg \n";
}
else {
echo "SUCCESS - retcode=$ retMsg \n";
}
}
function getRecord()
{
$rec = array();
$rec['token'] = "####";
$rec['CallerCode'] = "code";
$rec['CallerTID'] = "A1";
$rec['Prefix'] = "PHP";
$rec['FirstName'] = "First";
$rec['MiddleName'] = "Mid Name";
$rec['LastName'] = "Last Name";
$rec['Suffix'] = "Suffix";
$rec['Address1'] = "7704 Leesburg Pike";
$rec['Address2'] = "Address 2";
$rec['City'] = "City";
$rec['State'] = "VA";
$rec['Zip'] = "22043";
$rec['Plus4'] = "1111";
$rec['Email'] = "email@email.com";
$rec['Phone_Home'] = "703-790-8676";
$rec['Phone_Work'] = "(703)790-9389";
$rec['Employer'] = "Employer";
$rec['Occupation'] = "Occupation";
$rec['GiftDate'] = "2006-12-13";
$rec['GiftAmount'] = '900';
$rec['Card_Name_on'] = "John Doe";
$rec['CardNo'] = "4444333322221111";
$rec['Card_Exp_Month'] = "12";
$rec['Card_Exp_Year'] = "2006";
$rec[‘CVCode’] = "1234";
$rec['More_in_XML'] = "<more><flag>VIP</flag></more>";
return $rec;
}
?>Thank you!
Eric G.