| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/HostingSpaces/admin/247sms.com/wwwroot/test/assets/thesmsworks/ |
Upload File : |
<?php
include "general.php";
include "connect.php";
$messageID="";
$status="";
$body ="";
$phonenumber="";
$country="";
// Retrieve the request's body
$body = rawurldecode(@file_get_contents("php://input"));
//echo "Nosa";
// retrieve the signature sent in the reques header's.
//$signature = (isset($_SERVER['HTTP_VERIF_HASH']) ? $_SERVER['HTTP_VERIF_HASH'] : '');
//$body = "id=585525748&txRef=amebqdbwyuMKI&flwRef=OQOJ9020929056098&orderRef=URF_1645832382783_1398235&paymentPlan=1000&paymentPage=&createdAt=2022-02-25T23%3A39%3A43.000Z&amount=50&charged_amount=50.7&status=successful&IP=105.112.28.98¤cy=NGN&appfee=0.7&merchantfee=0&merchantbearsfee=0&customer%5Bid%5D=340782575&customer%5Bphone%5D=&customer%5BfullName%5D=Jackson%20&customer%5Bcustomertoken%5D=&customer%5Bemail%5D=nosa.osahon%40penpalamerica.com&customer%5BcreatedAt%5D=2022-02-25T23%3A39%3A43.000Z&customer%5BupdatedAt%5D=2022-02-25T23%3A39%3A43.000Z&customer%5BdeletedAt%5D=&customer%5BAccountId%5D=129120&entity%5Bid%5D=16929276&entity%5Bcard6%5D=559432&entity%5Bcard_last4%5D=0112&entity%5Bcard_country_iso%5D=NG&entity%5BcreatedAt%5D=2021-04-23T12%3A25%3A40.000Z&event.type=CARD_TRANSACTION";
//$body = rawurldecode('{"udh":{"complete":false,"numparts":0,"parts":[]},"archived":false,"flash":false,"gateway":0,"responseemail":[""],"ttl":0,"unicode":false,"unread":true,"validity":2880,"_id":"647f0e799ba06829dd4c8f3e","content":"Just test","country":"GB","credits":1,"customerid":"8f2580e7-9f3d-4919-9c56-aa89a915f1d4","deliveryreporturl":"","destination":447405178550,"identifier":"447405178550","international":false,"keyword":"","messageid":"147060610461720297","messageparts":1,"originip":"38.17.52.109","schedule":"2023-06-06T10:46:17.212Z","sender":"SWIFTALL","status":"DELIVERED","tag":"","forwarding":[],"modified":"2023-06-06T10:46:17.213Z","created":"2023-06-06T10:46:17.213Z","contentsafe":"Just test","__v":0}');
$arr = json_decode($body,true);
//var_dump($body_object);
//$status = $body_object->{'udh'};
//echo $status;
foreach ($arr as $key => $value) {
if ($key =='messageid') {
$messageID = $value;
}
if ($key =='status') {
$status = $value;
}
if ($key =='destination') {
$phonenumber = $value;
}
if ($key =='country') {
$country = $value;
}
}
//echo "Status ".$status."\n";
//echo "MessageID ".$messageID."\n";
/* It is a good idea to log all events received. Add code *
* here to log the signature and body to db or file */
$query ="insert into thesmsworkslog (body,messageid,phonenumber,country,status) VALUES ('$body','$messageID','$phonenumber','$country','$status')";
//echo $query;
$queryresponse = updateQuery($query);
exit();
?>