feat: improving pagseguro payment

This commit is contained in:
Gabriel Pedro 2016-05-02 04:12:14 -04:00
parent afee5eab13
commit 583001e91d
2 changed files with 46 additions and 1 deletions

View File

@ -54,6 +54,25 @@ if ($paypal['enabled']) {
</table>
<?php } ?>
<?php
if ($config['pagseguro']['enabled'] == true) {
?>
<h2>Buy points using Pagseguro:</h2>
<form target="pagseguro" action="https://<?=$pagseguro['urls']['www']?>/checkout/checkout.jhtml" method="post">
<input type="hidden" name="email_cobranca" value="<?=$pagseguro['email']?>">
<input type="hidden" name="tipo" value="CP">
<input type="hidden" name="moeda" value="<?=$pagseguro['currency']?>">
<input type="hidden" name="ref_transacao" value="<?php echo (int)$session_user_id; ?>">
<input type="hidden" name="item_id_1" value="1">
<input type="hidden" name="item_descr_1" value="<?=$pagseguro['product_name']?>">
<input type="number" name="item_quant_1" min="1" step="4" value="1">
<input type="hidden" name="item_peso_1" value="0">
<input type="hidden" name="item_valor_1" value="<?=$pagseguro['price']?>">
<input type="submit" value=" PURCHASE ">
</form>
<br>
<?php } ?>
<?php
if ($config['paygol']['enabled'] == true) {
?>
@ -73,5 +92,5 @@ if ($config['paygol']['enabled'] == true) {
</form>
<?php }
if (!$config['paypal']['enabled'] && !$config['paygol']['enabled']) echo '<h1>Buy Points system disabled.</h1><p>Sorry, this functionality is disabled.</p>';
if (!$config['paypal']['enabled'] && !$config['paygol']['enabled'] && !$config['pagseguro']['enabled']) echo '<h1>Buy Points system disabled.</h1><p>Sorry, this functionality is disabled.</p>';
include 'layout/overall/footer.php'; ?>

View File

@ -707,6 +707,32 @@
30 => 420, // +40% bonus
);
/////////////////
/// PAGSEGURO ///
/////////////////
// Write your pagseguro address here, and what currency you want to recieve money in.
$config['pagseguro'] = array(
'enabled' => true,
'sandbox' => false,
'email' => '', // Example: pagseguro@mail.com
'token' => '',
'currency' => 'BRL',
'product_name' => '',
'price' => 100, // 1 real
'ipn' => "http://".$_SERVER['HTTP_HOST']."/pagseguro_ipn.php",
'urls' => array(
'www' => 'pagseguro.uol.com.br',
'ws' => 'ws.pagseguro.uol.com.br',
'stc' => 'stc.pagseguro.uol.com.br'
)
);
if ($config['pagseguro']['sandbox']) {
$config['pagseguro']['urls'] = array_map(function ($item) {
return str_replace('pagseguro', 'sandbox.pagseguro', $item);
}, $config['pagseguro']['urls']);
}
//////////////////
/// PAYGOL SMS ///
//////////////////