From 583001e91d1823c3e9ee324e64622ad09c0cbc7a Mon Sep 17 00:00:00 2001 From: Gabriel Pedro Date: Mon, 2 May 2016 04:12:14 -0400 Subject: [PATCH] feat: improving pagseguro payment --- buypoints.php | 21 ++++++++++++++++++++- config.php | 26 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/buypoints.php b/buypoints.php index eec0fe7..ba428ed 100644 --- a/buypoints.php +++ b/buypoints.php @@ -54,6 +54,25 @@ if ($paypal['enabled']) { + +

Buy points using Pagseguro:

+
+ + + + + + + + + + +
+
+ + @@ -73,5 +92,5 @@ if ($config['paygol']['enabled'] == true) { Buy Points system disabled.

Sorry, this functionality is disabled.

'; +if (!$config['paypal']['enabled'] && !$config['paygol']['enabled'] && !$config['pagseguro']['enabled']) echo '

Buy Points system disabled.

Sorry, this functionality is disabled.

'; include 'layout/overall/footer.php'; ?> \ No newline at end of file diff --git a/config.php b/config.php index 485e6eb..7a50ac0 100644 --- a/config.php +++ b/config.php @@ -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 /// //////////////////