/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/pay_file_back.php (5326B)
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; } } } } $name = $customer[0]["name"]; $name_split = explode(" ",$name); $fname = $name_split[0]; $lname = $name_split[1]; $cus = $customer[0]["name"]; $Res["data"]["id"] = $customer[0]["id"]; $Res["data"]["name"] = $customer[0]["name"]; $Res["data"]["mobile"] = $customer[0]["mobile"]; $Res["data"]["email"] = $customer[0]["email"]; $Res["data"]["address"] = $cust_detail[0]["address"]; $Res["data"]["addr_lat"] = $cust_detail[0]["addr_lat"]; $Res["data"]["addr_long"] = $cust_detail[0]["addr_long"]; $Res["data"]["card_number"] = $cust_detail[0]["card_number"]; $card_expire = $cust_detail[0]["ExpiryMonth"]."/".$cust_detail[0]["Expiryyear"]; $Res["data"]["card_expire"] = $card_expire; $Res["data"]["cvv"] = $cust_detail[0]["cvv"]; $Res["data"]["card_zipcode"] = $cust_detail[0]["card_zipcode"]; $Res["data"]["card_holder_name"] = $cust_detail[0]["card_holder_name"]; $apiKey = '60CF3Ce97nRS1Z1Wp5m9kMmzHHEh8Rkuj31QCtVxjPWGYA9FymyqsK0Enm1P6mHJf0THbR'; $apiPassword = 'API-P4ss'; $apiEndpoint = \Eway\Rapid\Client::MODE_SANDBOX; // Use \Eway\Rapid\Client::MODE_PRODUCTION when you go live $client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint); $customer = [ 'Title' => $_REQUEST['title'], 'FirstName' => $fname, 'LastName' => $lname, 'Country' => $_REQUEST['country'], 'CardDetails' => [ 'Name' => $cus, 'Number' => $cust_detail[0]["card_number"], 'ExpiryMonth' => $cust_detail[0]["ExpiryMonth"], 'ExpiryYear' => $cust_detail[0]["Expiryyear"], 'CVN' => $cust_detail[0]["cvv"], ] ]; $response = $client->createCustomer(\Eway\Rapid\Enum\ApiMethod::DIRECT, $customer); $tokencustomerid = $response->Customer->TokenCustomerID; $tokencustomerid; $transaction = [ 'Customer' => [ 'TokenCustomerID' => $tokencustomerid, 'Reference' => $cus, 'FirstName' => $fname, 'LastName' => $lname, 'PostalCode' => $cust_detail[0]["card_zipcode"], 'Country' => $_REQUEST['country'], 'Phone' => $customer[0]["mobile"], 'Email' => $customer[0]["email"], 'CardDetails' => [ 'Name' => $cus, 'Number' => $cust_detail[0]["card_number"], 'ExpiryMonth' => $cust_detail[0]["ExpiryMonth"], 'ExpiryYear' => $cust_detail[0]["Expiryyear"], 'CVN' => $cust_detail[0]["cvv"], ] ], 'Payment' => [ 'TotalAmount' => $_REQUEST['price'], ], 'TransactionType' => \Eway\Rapid\Enum\TransactionType::PURCHASE, ]; $response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction); $tokencustomerid = $response->Customer->TokenCustomerID; if (isset($response->TransactionStatus) && $response->TransactionStatus) { $Res["transaction"]["transactionid"] = $response->TransactionID; $TransactionID = $response->TransactionID; $Res["transaction"]["AuthorisationCode"] = $response->AuthorisationCode; $authorisation_code = $response->AuthorisationCode; $Res["transaction"]["tokencustomerid"] = $response->Customer->TokenCustomerID; $tokencustomerid = $response->Customer->TokenCustomerID; $sql = "INSERT INTO `perthdes_new_pro_api`.`payments` (`id`, `transaction_id`, `authorisation_code`, `customer_name`, `customer_email`, `amount`, `token_id`, `created`, `modified`) VALUES (NULL, '".$TransactionID."', '".$authorisation_code."', '".$cus."', '".$_REQUEST['username']."', '".$_REQUEST['price']."', '".$tokencustomerid."' , NOW(), NOW())"; if ($conn->query($sql) === TRUE) { $Res['payment']["payment_id"] = $conn->insert_id; $Res["message"]["success"] = "payment success" ; } } else { $error = true; if ($response->getErrors()) { foreach ($response->getErrors() as $error) { $errormessage.= "Error: $error (".\Eway\Rapid::getMessage($error).")
\n"; } } else { $errormessage.= "Sorry, your payment was declined"; } $Res["message"]["errormessage"] = $errormessage; } //echo "
";
			//print_r($Res);
		//echo "
"; echo json_encode(new ArrayObject($Res)); /*function send_mail($to, $from, $title, $message) { $headers = "MIME-Version: 1.0 \r\n"; $headers .= "From: $from \n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html;charset=ISO-8859-1 \r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "X-Mailer: smail-PHP " . phpversion() . "\r\n"; return mail($to, $title, $message, $headers); }*/ ?>