Beste mensen,
Ik heb 3 betaal modules op mijn site staan.
Paypal, wallie, telefoon
Het script kunt u bekijken op http://ikleerhacken.nl
Paypal en telefoon werkt het, maar als je betaalt met wallie geeft hij een paar errors aan.
Regel 99 & 100 uit aankopen.phpWarning: Division by zero in /home/digitax/public_html/ikleerhacken.nl/aankopen.php on line 99
Notice: Use of undefined constant php - assumed 'php' in /home/digitax/public_html/ikleerhacken.nl/aankopen.php on line 99
Notice: Use of undefined constant bedankt - assumed 'bedankt' in /home/digitax/public_html/ikleerhacken.nl/aankopen.php on line 100
Warning: Division by zero in /home/digitax/public_html/ikleerhacken.nl/aankopen.php on line 100
Notice: Use of undefined constant php - assumed 'php' in /home/digitax/public_html/ikleerhacken.nl/aankopen.php on line 100
aankopen.phpPHP Code:
$siteReportUrl = $site_url/aankopen.php;
$siteReturnUrl = $site_url/bedankt.php;
Wie kan me helpen?PHP Code:
<?php
error_reporting(E_ALL);
include("common.php");
require_once 'Mollie/Wallie.php';
require('Mollie/class.micropayment-mollie.php');
$regel;
$m = new micropayment();
$molliePartnerID = 184351; // Fill in your own Mollie Partner ID!
$m->setPartnerID($molliePartnerID);
$wallie = new Mollie_Wallie($molliePartnerID);
$error = "";
$my_sFirstName = "";
$my_sLastName = "";
$my_clientEmail ="";
$my_clientIp ="";
$q1 = "select * from cart, items where cart.OrderID = '".GetCartId()."' and cart.ItemID = items.ItemID order by items.ItemName";
$r1 = mysql_query($q1) or die(mysql_error());
$col = "white";
$rows = "";
$order_total = 0;
$order = 0;
while($a1 = mysql_fetch_array($r1)){
//haalt de korting uit de tabel korting en tabel discount
$discount = "select discount FROM korting";
$disc = mysql_query($discount) or die(mysql_error());
$disc2 = mysql_result($disc,0,'discount');
//echo $disc2; //geeft waarde van kolom weer
//Haalt de korting tekst uit de tabel kortin kolom kortingtekst
$kortingstekst = "select tekstkorting FROM korting";
$kortingstekst1 = mysql_query($kortingstekst) or die(mysql_error());
$kortingstekst2 = mysql_fetch_assoc($kortingstekst1);
$kortingstekst3 = $kortingstekst2["tekstkorting"];
if($col == "white"){
$col = "dddddd";
}else{
$col = "white";
}
$a1['ItemTotal'] = ( $a1['ItemPrice'] * $a1['ItemQty'] );
$a1['ItemTotal'] = number_format($a1['ItemTotal'], 2, ".", ",");
$rows .= "<tr bgcolor=\"$col\">\n\t<td class=BlackLink>".$a1['ItemName']."</td>\n<td align=right>$aset[currency_sign] $a1[ItemPrice]</td>\t\n\t<td align=center>$a1[ItemQty]</td>\n\t<td align=right>$aset[currency_sign] $a1[ItemTotal]</td>\n</tr>\n\n";
$order += $a1['ItemPrice'] * $a1['ItemQty'];
$showdiscount = ($order * $disc2) / 100;
$order_total = $order - $showdiscount;
}
$order_total = number_format($order_total, 2, ".", ",");
$order = number_format($order, 2, ".", ",");
$showdiscount = number_format($showdiscount, 2, ".", ",");
if(isset($_POST['submit_out']) || isset($_POST['submit_out_x'])){
$my_sFirstName = strip_trim($_POST['sFirstName']);
$my_sLastName = strip_trim($_POST['sLastName']);
$my_clientEmail = strip_trim($_POST['clientEmail']);
$my_clientIp = $_SERVER['REMOTE_ADDR'];
if(empty($my_sFirstName)){
$error = "<span class=RedLink>Gelieve je voornaam in te geven</span>";
}elseif(empty($my_sLastName)){
$error = "<span class=RedLink>Gelieve je naam in te geven</span>";
}elseif(empty($my_clientEmail) || !ereg("@", $my_clientEmail)){
$error = "<span class=RedLink>Gelieve je e-mail adres in te geven</span>";
}
if(empty($error)){
$q1 = "insert into orders_info set
FirstName = '$my_sFirstName',
LastName = '$my_sLastName',
email = '$my_clientEmail',
ip = '$my_clientIp',
order_date = '$t',
order_total = '$order_total',
showdiscount = '$showdiscount'";
mysql_query($q1) or die(mysql_error());
$order_id = mysql_insert_id();
$q2 = "update cart set OrderID = '$order_id' where OrderID = '".GetCartId()."' ";
mysql_query($q2) or die(mysql_error());
$check = "select * from newsletter where nEmail = '$my_clientEmail'";
$result = mysql_query($check);
if(mysql_num_rows($result) == 0 ) {
$q3 = "insert into newsletter set
nEmail = '$my_clientEmail' ";
mysql_query($q3);
}
$payment_option = $_POST['payment_option'];
if($payment_option == '2') {
//redirect to paypal
header("location:https://www.paypal.com/xclick?business=$aset[PayPalEmail]&item_name=OrderID $order_id&first_name=$my_sFirstName&last_name=$my_sLastName&email=$my_clientEmail&item_number=1&custom=$order_id&amount=$order_total¤cy_code=$aset[currency_id]¬ify_url=$site_url/download_link.php&return=$site_url/bedankt.php");
exit();
} elseif($payment_option == '3') {
$prijs = $order_total;
$amount = str_replace(".", "", $prijs);
$siteReportUrl = $site_url/aankopen.php;
$siteReturnUrl = $site_url/bedankt.php;
if ($wallie->createPayment($amount, $siteReportUrl, $siteReturnUrl)) {
// Payment created, You could(/should) save the payment information in your database
// Get the url of the chosen bank to redirect the user to,
// to complete the payment
header('location: ' . $wallie->getWallieUrl());
}
else {
// show message that the payment could not be created
// the function $wallie->getStatus() returns the status
// message that Mollie returns
echo $wallie->getStatus();
}
if (isset($_GET['payment_type']) and $_GET['payment_type'] == 'wallie' and isset($_GET['transaction_id']) and isset($_GET['amount'])) {
// Check if payment is OK.
$checkPayment = $wallie->checkPayment($_GET['transaction_id'], $_GET['amount']);
// Mollie makes sure a transaction can only
// be used one time!
if ($checkPayment == true) {
// Get the amount of money the user has payed
$paymentAmount = $wallie->getAmount();
header('location: ' . $site_url/download_link.php);
// Set in your database the paymentstatus to OK.
}
}
}elseif($payment_option == '4'){
?>
<form action="bellen_pay.php" method="post" name="myForm">
<input type="hidden" name="order_total" value="<? echo $order_total; ?>" />
<input type="submit" value="Ga door naar betaalpagina" />
</form>
<script type='text/javascript'>document.myForm.submit();</script>
<?
}
}
}
require_once("templates/hoofdtemplate.php");
include_once("templates/afrekenen.php");
include_once("templates/voetnoot.php");
?>
- Paar errors
-
21-11-2010, 10:04 #1
- Berichten
- 1.025
- Lid sinds
- 14 Jaar
Paar errors
-
-
21-11-2010, 10:53 #2
- Berichten
- 1.263
- Lid sinds
- 16 Jaar
Re: Paar errors
Code:$siteReportUrl = $site_url ."/aankopen.php"; $siteReturnUrl = $site_url ."/bedankt.php";
-
21-11-2010, 11:08 #3
- Berichten
- 1.025
- Lid sinds
- 14 Jaar
Re: Paar errors
Bedankt
het werkt
-
21-11-2010, 11:18 #4
- Berichten
- 1.263
- Lid sinds
- 16 Jaar
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic