Please help me out my code is below


#1
<?php require_once('vendor/autoload.php'); $paynow = new Paynow\Payments\Paynow( '12126', '1d52a084-d77b-4e2a-b8e2-a2344b850d72', 'http://example.com/gateways/paynow/update', // The return url can be set at later stages. You might want to do this if you want to pass data to the return url (like the reference of the transaction) 'https://food4less.co.za/index.php?page=checkout-complete' ); # $paynow->setResultUrl(''); # $paynow->setReturnUrl(''); $email = $checkout_rs['email']; $payment = $paynow->createPayment('Payment Invoice', $email); $cart_sql = "SELECT * FROM `cart` where user_id = '1'"; $cart_qry = mysqli_query($dbconnect,$cart_sql); $cart_rs = mysqli_fetch_assoc($cart_qry); $cart_count = mysqli_num_rows($cart_qry); if($cart_count==0){ $total_rs['SUM(price)'] = "0.00"; }else{ $total_sql = "SELECT SUM(price) FROM `cart`"; $total_qry = mysqli_query($dbconnect,$total_sql); $total_rs = mysqli_fetch_assoc($total_qry); $total_count = mysqli_num_rows($total_qry); } if($cart_count==0){ }else{ do{ $price = $cart_rs['quantity'] * $books_rs['softcopy price']; $payment->add('Book', $price); }while($cart_rs = mysqli_fetch_assoc($cart_qry)); } $response = $paynow->send($payment); if($response->success()) { // Or if you prefer more control, get the link to redirect the user to, then use it as you see fit $link = $response->redirectUrl(); $pollUrl = $response->pollUrl(); // Check the status of the transaction $status = $paynow->pollTransaction($pollUrl); } $response = $paynow->sendMobile($payment, '077777777', 'ecocash'); $arguments = 'id=12126&amount='.$sumproduct.'&f1=Red&f2=Pay+when%3F+Paynow%21&f3=32&l=1'; $arguments = base64_encode($arguments); ?>
									<a href="https://www.paynow.co.zw/payment/billpaymentlink/<?php echo $email; ?>?q=<?php echo $arguments; ?>" class="btn btn-lg place-order-btn">place order</a>