$value) { if (strpos($value, 'REFUND') !== false || strpos($value, '|') !== false) { continue; } $paramStr .= ($flag) ? checkString_e($value) : "|" . checkString_e($value); $flag = 0; } return $paramStr; } function getArray2StrForVerify($arrayList) { $paramStr = ""; $flag = 1; foreach ($arrayList as $key => $value) { $paramStr .= ($flag) ? checkString_e($value) : "|" . checkString_e($value); $flag = 0; } return $paramStr; } function removeCheckSumParam($arrayList) { if (isset($arrayList["CHECKSUMHASH"])) { unset($arrayList["CHECKSUMHASH"]); } return $arrayList; } function callAPI($apiURL, $requestParamList) { $JsonData = json_encode($requestParamList); $postData = 'JsonData=' . urlencode($JsonData); $ch = curl_init($apiURL); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($postData))); $jsonResponse = curl_exec($ch); return json_decode($jsonResponse, true); } function callRefundAPI($refundApiURL, $requestParamList) { $JsonData = json_encode($requestParamList); $postData = 'JsonData=' . urlencode($JsonData); $ch = curl_init($refundApiURL); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $refundApiURL); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $jsonResponse = curl_exec($ch); return json_decode($jsonResponse, true); } ?>