/home/desid573/public_html/test_api
NameSizeModeActions
lib/-0755rm
twilio-php-master/-0755rm
vendor/-0755rm
after_booking_page.php25950644editdlrm
booking.php107160644editdlrm
booking_28-04-2017.php9470644editdlrm
booking_29-04-2017.php37170644editdlrm
cancel_booking.php56210644editdlrm
checkPrice.php13060644editdlrm
composer.json650644editdlrm
composer.lock23550644editdlrm
confirmsend.php26820644editdlrm
contact_us_mail.php9030644editdlrm
dispatch.php8770644editdlrm
emailConfirmReset.php4860644editdlrm
error_log59222470644editdlrm
generate_credit.php31870644editdlrm
generate_referall.php27790644editdlrm
getuser_byid.php23410644editdlrm
getuser_bymail.php19680644editdlrm
get_all_booking.php7790644editdlrm
get_booking_bybooking_id.php8130644editdlrm
get_booking_byuser.php10570644editdlrm
get_booking_status.php22190644editdlrm
get_completed_bookings.php7270644editdlrm
get_directions.php8130644editdlrm
get_lead_message.php6730644editdlrm
get_open_bookings.php15270644editdlrm
get_payment_byuser.php10640644editdlrm
homekey_img.png140370644editdlrm
index.php142720644editdlrm
index_backup.php47910644editdlrm
lib_tr.zip1050470644editdlrm
login_api.php84050644editdlrm
login_api_old.php56530644editdlrm
noteconfirm.php92590644editdlrm
passwordResetLink.php51950644editdlrm
pay_file.php73020644editdlrm
pay_file_back.php53260644editdlrm
placehold.html21840644editdlrm
reset_email.php17550644editdlrm
send_bulk_notif.php16920644editdlrm
test_222.php8450644editdlrm
update_api.php63180644editdlrm
update_api_on_mail.php46770644editdlrm
validatecode.php10940644editdlrm
validatephone.php10340644editdlrm
Edit: /home/desid573/public_html/test_api/update_api.php (6318B)
query($sql); while($row_details = $result->fetch_assoc()) { $cid = $row_details["id"] ; } $cid; if ($result->num_rows > 0) { $sql= "UPDATE `customers` SET "; if(isset($_REQUEST["fname"]) && isset($_REQUEST["lname"])) { $sql.= "`name` = '".$fullname."',"; } if(isset($_REQUEST["phone"])) { $phone = str_replace(" ", "", $_REQUEST["phone"]); $sql.= "`mobile` = '".$phone."',"; } if(isset($_REQUEST["email"])) { $sql.= "`email` = '".$_REQUEST["email"]."' ,"; } if(isset($_REQUEST["new_pass"])) { $new_pass = MD5($_REQUEST["new_pass"]); $sql.= "`password` = '".$new_pass."',"; } $sql.= "`modified` = NOW() WHERE `customers`.`email` ='".$_REQUEST["email"]."'"; if($conn->query($sql)) { $cust["status"][] = "ok"; $sql_detail="UPDATE `customer_details` SET "; if(isset($_REQUEST["address"])) { $sql_detail.= "`address` = '".$_REQUEST["address"]."', "; } if(isset($_REQUEST["addr_la"])) { $sql_detail.="`addr_lat` = '".$_REQUEST["addr_la"]."', "; } if(isset($_REQUEST["addr_long"])) { $sql_detail.="`addr_long` = '".$_REQUEST["addr_long"]."' "; } $sql_detail.="WHERE `customer_details`.`cid` =".$cid; if($conn->query($sql_detail)) { $cust["status"][] = "ok"; //----------------------------------------- } else { $cust["error"][] = "error"; } } else { $cust["error"][] = "error"; } $count = sizeof($cust["status"]); $count_error = sizeof($cust["error"]); if($count==2) { $Res["massege"] = "Customer Details are Updated"; $Res["status"] = "ok"; } if($count_error >0) { $Res["massege"] = "Error in update, please contact us"; $Res["status"] = "error"; } } else { $Res["massege"] = "No such Id present in database"; $Res["status"] = "error"; } echo json_encode(new ArrayObject($Res)); } //echo "
";
//print_r($response);
//print_r($data);
//print_r($Res);
//echo "
"; if($_REQUEST['update'] == "1"){ $sql = "SELECT * FROM customers where email = '".$_REQUEST["email"]."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $customer[] = $row; $sql = "SELECT * FROM `customer_details` where `cid` = '".$row["id"]."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row_details = $result->fetch_assoc()) { $cust_detail[] = $row_details; } } $sql = "SELECT * FROM `customer_tokens` where `cid` = '".$row["id"]."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row_token = $result->fetch_assoc()) { $cust_token[] = $row_token; } } } } $cus = $customer[0]["name"]; $mob = $customer[0]["mobile"]; $cid = $customer[0]['id']; $tokencustomerid = $cust_token[0]["access_token_value"]; //========================token Id =================================== $client_key = '4T7y1vuKPkdhRYUQdH6msueW9hqV2wpcwnSk0Qwxkvwf7TjQn40qymPW7IJb66gUC1w1505cDMkj9IR82juQEnIp4/8nd0nDhwYDSDoqROtNBWmkqtqYmF6F4qVGMUq3HpJrY3y2kdSljCFfWzWc7LIEn4G5XY2IZAPgAO5+mhwvYrricmqwLhqzV4FBUII5AwTvJZl4awrdul4vLWkS73vJuW/XrXHseGK/nqB3oSRluZ1jKp2qDgVTwrXYEbx4rwwS42X2w0C9tLKywxf27WD2CCK8ftSeQBimVqFI0r6VuRXFVaOn6SQTOD9V/TsCfPk5Zh6/PWcfapyVKS+l1w=='; $apiKey = '44DD7APNUxR8/4sDLhEVT11OS00fmBo4Haxj4ZGJGHvtLBP0rC/ayqNhbVu9tEJrjlJPJm'; $apiPassword = 'y2b7QMpd'; //$apiKey = '60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR'; //$apiPassword = 'API-P4ss'; $apiEndpoint = \Eway\Rapid\Client::MODE_PRODUCTION; //$apiEndpoint = \Eway\Rapid\Client::MODE_SANDBOX; // Use \Eway\Rapid\Client::MODE_PRODUCTION when you go live $client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint); $customer = [ 'Country' => 'au', 'Email' => $_REQUEST['email'], 'TokenCustomerID' => $tokencustomerid, 'CardDetails' => [ 'Name' => $cus, 'Number' => $_REQUEST["credit_card"], 'ExpiryMonth' => $expmonth, 'ExpiryYear' => $expyear, //'CVN' => $_REQUEST["CVV"], ] ]; $response = $client->updateCustomer(\Eway\Rapid\Enum\ApiMethod::DIRECT, $customer); $json = json_decode($response, true); error_log($response); if($json["ResponseCode"] == "00") { $Res["massege"] = "Credit Card is Updated"; $Res["status"] = "ok"; $slackmessage = $cus." has updated their card"; $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, 'https://hooks.slack.com/services/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'); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curlObj, CURLOPT_HEADER, 0); curl_setopt($curlObj, CURLOPT_HTTPHEADER, array('Content-type:application/json')); curl_setopt($curlObj, CURLOPT_POST, 1); curl_setopt($curlObj, CURLOPT_POSTFIELDS, '{"text": "'.$slackmessage.'"}'); $response = curl_exec($curlObj); curl_close($curlObj); } else { $Res["massege"] = "Error in Credit Card Update"; $Res["status"] = "error"; } echo json_encode(new ArrayObject($Res)); //===========================token id end here ======================== } $conn->close(); // =============== New customer user api End Here ========================== ?>