Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Created May 10, 2012 16:45
Show Gist options
  • Save BFTrick/2654404 to your computer and use it in GitHub Desktop.
Save BFTrick/2654404 to your computer and use it in GitHub Desktop.
SOAP Connection to Midax API
<?php
try{
$serviceWsdlUri = "https://XXX.XXX.XXX.XXX/eft/Cards.asmx?WSDL";
$soapClient = new SoapClient($serviceWsdlUri);
$username = "XXXXX";
$password = "XXXXX";
$cardNumber = "XXXXX";
$plasticNo = "";
$amount=3;
$result = $soapClient->ActivateGiftCard(array("username"=>$username, "password"=>$password, "CardNumber"=>$cardNumber, "PlasticNo"=>$plasticNo, "Amount"=>$amount));
if ($result->ActivateGiftCardResult->Type == "Success"){
echo "Gift Card Balance:<br/>\n";
echo "<pre>\n";
print_r($result->ActivateGiftCardResult->Message);
echo "\n</pre>\n";
}//if
else{
echo "Error:<br/>\n";
echo $result->ActivateGiftCardResult->Message;
}//else
}//try
catch (SoapFault $exception){
echo "Exception:<br/>\n";
echo $exception;
}//catch
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment