Пример #1
0
    echo "ERR101:INVALID AMOUNT";
} elseif ($amount == NULL) {
    echo "ERR102:MISSING AMOUNT";
} elseif ($servicename == NULL) {
    echo "ERR103:MISSING SERVICENAME";
} elseif ($enduseridentifier == NULL) {
    echo "ERR104:MISSING MSISDN";
} elseif (preg_match('/^[0-9]{0,12}$/', $enduseridentifier)) {
    if (preg_match('/^[0-9]{0,12}$/', $enduseridentifier)) {
    } else {
        echo "ERR104:INVALID MSISDN";
    }
} elseif ($token == NULL) {
    echo "ERR105:MISSING TOKEN";
} elseif ($token != $tokrow) {
    echo "ERR106:INVALID TOKEN";
} elseif (strpos(strtolower($response), 'chargeamountresponse') !== false) {
    $browser = 'success';
} else {
    $browser = 'failure';
}
$status = $result;
//var_dump($msge);
$statusdesc = '';
if (strpos(strtolower($status), 'chargeamountresponse') !== false) {
    $statusdesc = 'success';
} else {
    $statusdesc = 'failure';
}
$msge = billme($spid, $serviceid, $ts, $servicename, $token, $oa, $fa, $password, $sppassword, $host, $description, $currency, $amount, $code, $enduseridentifier, $referencecode, $status, $statusdesc);
print_r($browser);
Пример #2
0
  <soapenv:Body>  
   <loc:chargeAmount>  
   <loc:endUserIdentifier>' . $endUserIdentifier . '</loc:endUserIdentifier> 
   <loc:charge>
     <description>' . $description . '</description>
               <currency>' . $currency . '</currency>
               <amount>' . $amount . '</amount>
               <code>' . $code . '</code>
       </loc:charge>
<loc:referenceCode>' . $referenceCode . '</loc:referenceCode>
   </loc:chargeAmount>   
  </soapenv:Body>  
  </soapenv:Envelope> ';
$headers = array("POST  HTTP/1.1", "Host: {$host}", "Content-type: application/soap+xml; charset=\"utf-8\"", "SOAPAction: \"\"", "Content-length: " . strlen($xml));
$soap_do = curl_init();
curl_setopt($soap_do, CURLOPT_URL, $url);
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($soap_do, CURLOPT_POST, true);
curl_setopt($soap_do, CURLOPT_HTTPHEADER, $headers);
curl_setopt($soap_do, CURLOPT_POSTFIELDS, $xml);
//curl_setopt($soap_do, CURLOPT_USERPWD, $username . ":" . $password);
$result = curl_exec($soap_do);
$err = curl_error($soap_do);
//log_action($result, 'messages.log');
print_r($result);
return billme($spId, $serviceId, $ts, $OA, $FA, $password, $spPassword, $host, $description, $currency, $amount, $code, $endUserIdentifier, $referenceCode);
?>