require_once('../../connection/connect.php'); require_once('config.php'); # create request class $request = new \Iyzipay\Request\RetrieveCheckoutFormRequest(); $request->setLocale(\Iyzipay\Model\Locale::TR); $request->setConversationId("123456789"); $request->setToken($_POST['token']); # make request $checkoutForm = \Iyzipay\Model\CheckoutForm::retrieve($request, Config::options()); $payment_id = $checkoutForm->getPaymentId(); $credit_number = $checkoutForm->getLastFourDigits(); $message = $checkoutForm->getErrorMessage(); $date = $_SESSION['tarih']; $ad = $_SESSION['ad']; $soyadiniz = $_SESSION['soyadiniz']; $tel = $_SESSION['tel'] ; $email = $_SESSION['email']; $fatura_adresi = $_SESSION['fatura_adresi']; # print result if($checkoutForm->getStatus()=="success") { $status = $checkoutForm->getStatus()=="success" ? 1 : 0; try { $sorgu = $conn->prepare("INSERT INTO payment_attempts(transaction_id,user_name, user_surname,user_phone,user_email,user_address,payment_date,amount,user_card_info,is_success,payment_result_description) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $sorgu->bindParam(1,$payment_id , PDO::PARAM_STR); $sorgu->bindParam(2, $ad, PDO::PARAM_STR); $sorgu->bindParam(3, $soyadiniz, PDO::PARAM_STR); $sorgu->bindParam(4, $tel, PDO::PARAM_STR); $sorgu->bindParam(5, $email, PDO::PARAM_STR); $sorgu->bindParam(6, $fatura_adresi, PDO::PARAM_STR); $sorgu->bindParam(7, $date, PDO::PARAM_STR); $sorgu->bindParam(8, $checkoutForm->getPaidPrice(), PDO::PARAM_STR); $sorgu->bindParam(9, $credit_number, PDO::PARAM_STR); $sorgu->bindParam(10, $status, PDO::PARAM_STR); $sorgu->bindParam(11, $message, PDO::PARAM_STR); $sorgu->execute(); header("Location: https://www.portakaltercume.com/iyzico/basarili.php"); exit(); }catch (PDOException $e) { die($e->getMessage()); } $sorgu = null; ob_end_flush(); }