3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class StartTransactionResult { public $customerReference; // string public $errorDescription; // string public $redirectURL; // string public $success; // boolean } class TransactionDetails { public $billingAddress; // Address public $currencyCode; // int public $customerReference; // string public $description; // string public $goodsList; // GoodsItem public $languageCode; // string public $merchantAdditionalInformationList; // AdditionalInformation public $merchantId; // string public $returnURL; // string public $terminalId; // string public $totalAmount; // string public $merchantLocalDateTime;//string public $purchaserName;//string public $purchaserPhone;//string public $purchaserEmail;//string public $orderId;//string } class Address { public $addressLine1; // string public $addressLine2; // string public $city; // string public $country; // string public $county; // string public $zip; // string } class GoodsItem { public $amount; // string public $currencyCode; // int public $merchantsGoodsID; // string public $nameOfGoods; // string } class AdditionalInformation { public $key; // string public $value; // string } class StoredTransactionStatus { public $additionalInformation; // AdditionalInformation public $amountAuthorised; // string public $amountRefunded; // string public $amountRequested; // string public $amountSettled; // string public $authCode; // string public $goods; // GoodsItem public $transactionCurrencyCode; // string public $transactionStatus; // string } class startTransaction { public $transaction; // TransactionDetails } class startTransactionResponse { public $return; // StartTransactionResult } class refundTransaction { public $merchantId; // string public $password; // string public $referenceNr; // string public $refundAmount; // string public $description; // string public $goodsToRefund; // GoodsItem public $additionalInformation; // AdditionalInformation } class refundTransactionResponse { public $return; // boolean } class getVersionResponse { public $return; // string } class getTransactionStatus { public $merchantId; // string public $referenceNr; // string } class getTransactionStatusResponse { public $return; // StoredTransactionStatus } class completeTransaction { public $merchantId; // string public $referenceNr; // string public $transactionSuccess; // boolean public $overrideAmount; // string } class completeTransactionResponse { public $return; // boolean } /** * CNPMerchantWebServiceClient class * * * * @author {author} * @copyright {copyright} * @package {package} */ class CNPMerchantWebServiceClient extends SoapClient { private static $client = NULL; private static $classmap = array( 'StartTransactionResult' => 'StartTransactionResult', 'TransactionDetails' => 'TransactionDetails', 'Address' => 'Address', 'GoodsItem' => 'GoodsItem', 'AdditionalInformation' => 'AdditionalInformation', 'StoredTransactionStatus' => 'StoredTransactionStatus', 'startTransaction' => 'startTransaction', 'startTransactionResponse' => 'startTransactionResponse', 'refundTransaction' => 'refundTransaction', 'refundTransactionResponse' => 'refundTransactionResponse', 'getVersionResponse' => 'getVersionResponse', 'getTransactionStatus' => 'getTransactionStatus', 'getTransactionStatusResponse' => 'getTransactionStatusResponse', 'completeTransaction' => 'completeTransaction', 'completeTransactionResponse' => 'completeTransactionResponse', ); public function CNPMerchantWebServiceClient($wsdl = 'https://test.processing.kz/CNPMerchantWebServices/CNPMerchantWebService.wsdl', $options = array('connection_timeout' => 60, 'cache_wsdl' => WSDL_CACHE_MEMORY, 'trace' => 1, 'soap_version' => 'SOAP 1.2', 'encoding' => 'UTF-8', 'exceptions' => true, 'location' => 'https://test.processing.kz/CNPMerchantWebServices/services/CNPMerchantWebService')) { foreach(self::$classmap as $key => $value) { if(!isset($options['classmap'][$key])) { $options['classmap'][$key] = $value; } } parent::__construct($wsdl, $options); } /** * * * @param startTransaction $parameters * @return startTransactionResponse */ public function startTransaction(startTransaction $parameters) { return $this->__soapCall('startTransaction', array($parameters), array( 'uri' => 'https://kz.processing.cnp.merchant_ws/', 'soapaction' => '' ) ); } /** * * * @param refundTransaction $parameters * @return refundTransactionResponse */ public function refundTransaction(refundTransaction $parameters) { return $this->__soapCall('refundTransaction', array($parameters), array( 'uri' => 'https://kz.processing.cnp.merchant_ws/', 'soapaction' => '' ) ); } /** * * * @param * @return getVersionResponse */ public function getVersion() { return $this->__soapCall('getVersion', array(), array( 'uri' => 'https://kz.processing.cnp.merchant_ws/', 'soapaction' => '' ) ); } /** * * * @param getTransactionStatus $parameters * @return getTransactionStatusResponse */ public function getTransactionStatus(getTransactionStatus $parameters) { return $this->__soapCall('getTransactionStatus', array($parameters), array( 'uri' => 'https://kz.processing.cnp.merchant_ws/', 'soapaction' => '' ) ); } /** * * * @param completeTransaction $parameters * @return completeTransactionResponse */ public function completeTransaction(completeTransaction $parameters) { return $this->__soapCall('completeTransaction', array($parameters), array( 'uri' => 'https://kz.processing.cnp.merchant_ws/', 'soapaction' => '' ) ); } } function guid(){ if (function_exists('com_create_guid')){ return str_replace("}", "", str_replace("{", "", com_create_guid())); } else { mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up. $charid = strtoupper(md5(uniqid(rand(), true))); $hyphen = chr(45);// "-" $uuid = substr($charid, 0, 8).$hyphen .substr($charid, 8, 4).$hyphen .substr($charid,12, 4).$hyphen .substr($charid,16, 4).$hyphen .substr($charid,20,12); } return $uuid; } ?>
Output for 7.0.0 - 7.1.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; CNPMerchantWebServiceClient has a deprecated constructor in /in/L62YE on line 118 Fatal error: Class 'SoapClient' not found in /in/L62YE on line 118
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Class 'SoapClient' not found in /in/L62YE on line 118
Process exited with code 255.
Output for 5.0.0 - 5.3.29
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/L62YE on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/L62YE on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/L62YE on line 4
Process exited with code 255.