diff --git a/callUpdateOrderS2S.php b/callUpdateOrderS2S.php new file mode 100644 index 0000000..e0cbfba --- /dev/null +++ b/callUpdateOrderS2S.php @@ -0,0 +1,122 @@ + + + + + + + array( + 'FirstName' => 'Peppa', + 'Lastname' => 'Pig' + ) +); + +/**************************************************************** + * CREATING SOAP ARGUMENTS + * The $param variable will contain the argument for the S2S call. + * If you add more parameters you must add them here. + ****************************************************************/ + + +//Set up the parameters array. This array will be the argument for the SOAP call. +$param = array( + 'shopLogin' => $shopLogin, + 'bankTransactionId' => $bankTransactionId, + 'OrderDetails' => $OrderDetails +); + + +/**************************************************************** + * CALL CallUpdateOrderS2S + ****************************************************************/ +//setting up the WSDL url +$wsdl = "https://ecomms2s.sella.it/gestpay/gestpayws/WSs2s.asmx?WSDL"; +if ($testEnv) { + //Test + $wsdl = "https://testecomm.sella.it/gestpay/gestpayws/WSs2s.asmx?WSDL"; +} + +//Soap client +$client = new SoapClient($wsdl); + +//do the call to Encrypt method +try { + $objectResult = $client->CallUpdateOrderS2S($param); +} //catch SOAP exceptions +catch (SoapFault $fault) { + die($fault); +} + +//parse the XML result +$result = simplexml_load_string($objectResult->CallUpdateOrderS2SResult->any); + +//Error Check +$errCode = (string)$result->ErrorCode; +$errDesc = (string)$result->ErrorDescription; + +if ($errCode != "0") { + //An error has occurred; check ErrorCode and ErrorDescription + echo '
Error: '; + echo $errCode; + echo '
ErrorDesc: '; + echo $errDesc; + echo '
'; +} +//this is the output +echo '
';
+print_r($result);
+echo '
'; + +?> + + +