Hi, For some reason this script is just not running. I have tried error reporting but does not come back with anything. Can anyone see where the problem lies? index.php //example include_once("class.xpay.php"); $operation = array( "amount"=>(1000); $customerinfo = array( "nameprefix"=>"Mr.", "firstname"=>"James", "lastname"=>"Dean", "company"=>"", "street"=>("123 Astreet St"), "city"=>"Acity", "stateprov"=>"Acounty", "postcode"=>"AB11CD", "countrycode"=>"UK", "phone"=>"", "email"=>""); $paymentmethod = array( "type"=>"VISA", "number"=>"4111111111111111", "issue"=>"", "startdate"=>"", "securitycode"=>"123", "expirydate"=>"01/01"; $order = array( "orderreference"=>"Order001", "orderinformation"=>"Order"); $xpay = new Xpay($sitereference,$certlocation,$port = 5000,$host = "127.0.0.1") $result = $xpay->auth($operation,$customerinfo,$paymentmethod,$order); if($result["Result"] == 1){ print "The transaction was successful"; } PHP: Cheers, Adam
$xpay = new Xpay($sitereference,$certlocation,$port = 5000,$host = "127.0.0.1") needs to be: $xpay = new Xpay($sitereference,$certlocation,5000,"127.0.0.1");
as on phpclasses site the example code is include_once("class.xpay.php"); $operation = array( "amount"=>(1000); $customerinfo = array( "nameprefix"=>"Mr.", "firstname"=>"James", "lastname"=>"Dean", "company"=>"", "street"=>("123 Astreet St"), "city"=>"Acity", "stateprov"=>"Acounty", "postcode"=>"AB11CD", "countrycode"=>"UK", "phone"=>"", "email"=>""); $paymentmethod = array( "type"=>"VISA", "number"=>"4111111111111111", "issue"=>"", "startdate"=>"", "securitycode"=>"123", "expirydate"=>"01/01"; $order = array( "orderreference"=>"Order001", "orderinformation"=>"Order"); $xpay = new Xpay($sitereference,$certlocation,$port = 5000,$host = "127.0.0.1") $result = $xpay->auth($operation,$customerinfo,$paymentmethod,$order); if($result["Result"] == 1){ print "The transaction was successful"; } PHP: Regards Alex
it's wrong, you set default value if an argument is omited in your function / constructor definition, not when you call the function... in your case, you can just drop both port and host, unless they differ from the default ones in the class.