Created
May 10, 2012 16:45
-
-
Save BFTrick/2654404 to your computer and use it in GitHub Desktop.
SOAP Connection to Midax API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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