samuelav3
Member
- Joined
- Aug 18, 2014
- Messages
- 95
- Reaction score
- 5
need help when someone makes a purchase through paypal I get the money
but they do not reach the point: /
buypoints.php
config.php
but they do not reach the point: /
buypoints.php
Code:
// Import from config:
$paypal = $config['paypal'];
$prices = $config['paypal_prices'];
if ($paypal['enabled']) {
?>
<img id="ContentBoxHeadline" class="Title" src="layout/images/cosas/headline-donate.png" alt="Contentbox headline">
<h2>Buy points using Paypal</h2>
<table id="buypointsTable" class="table table-striped table-hover">
<tr class="yellow">
<th>Price:</th>
<th>Points:</th>
<?php if ($paypal['showBonus']) { ?>
<th>Bonus:</th>
<?php } ?>
<th>Action:</th>
</tr>
<?php
foreach ($prices as $price => $points) {
echo '<tr class="special">';
echo '<td>'. $price .'('. $paypal['currency'] .')</td>';
echo '<td>'. $points .'</td>';
if ($paypal['showBonus']) echo '<td>'. calculate_discount(($paypal['points_per_currency'] * $price), $points) .' bonus</td>';
?>
<td>
<form action="https://www.paypal.com/cgi-bin/webscr" method="POST">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo $paypal['email']; ?>">
<input type="hidden" name="item_name" value="<?php echo $points .' shop points on '. $config['site_title']; ?>">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="<?php echo $price; ?>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="<?php echo $paypal['currency']; ?>">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="hidden" name="return" value="<?php echo $paypal['success']; ?>">
<input type="hidden" name="cancel_return" value="<?php echo $paypal['failed']; ?>">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="notify_url" value="<?php echo $paypal['ipn']; ?>" />
<input type="hidden" name="custom" value="<?php echo (int)$_SESSION['user_id']; ?>">
<input type="submit" value=" PURCHASE ">
</form>
</td>
<?php
echo '</tr>';
}
?>
</table>
<?php } ?>
Code:
//////////////
/// PAYPAL ///
//////////////
// Write your paypal address here, and what currency you want to recieve money in.
$config['paypal'] = array(
'enabled' => true,
'email' => '[email protected]', // Example: [email protected]
'currency' => 'USD',
'points_per_currency' => 45, // 1 currency = ? points? [ONLY used to calculate bonuses]
'success' => "http://".$_SERVER['HTTP_HOST']."/success.php",
'failed' => "http://".$_SERVER['HTTP_HOST']."/failed.php",
'ipn' => "http://".$_SERVER['HTTP_HOST']."/ipn.php",
'showBonus' => true,
);
// Configure the "buy now" buttons prices, first write price, then how many points you get.
// Giving some bonus points for higher donations will tempt users to donate more.
$config['paypal_prices'] = array(
// price => points,
1 => 45, // +0% bonus
5 => 234, // +4% bonus
10 => 495, // +10% bonus
15 => 783, // +16% bonus
20 => 1080, // +30% bonus
30 => 1890, // +40% bonus
);