Visualizzazione dei risultati da 1 a 9 su 9
  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2011
    Messaggi
    3

    Sistema pagamento PAYPAL e ALERTPAY

    Salve a tutti,

    mi iscrivo a questo forum in quanto sono alle prese con una porzione di codice molto importante che ho trovato online.

    Premetto che: il codice occorre per fare pagamenti dal sito verso i clienti e non da errori PHP, ho attivato cURL necessario per pagamenti realtime e tutto.
    PROBLEMA: ho provato ad effettuare un micropagamento verso il mio conto AP e/o PP e mi riporta (senza errori di codice) al punto in cui dice che non puo' processare il pagamento, riprova piu' tardi.

    E' una simulazione che volevo fare e quindi l'account AP e PP dell'owner del sito (io) e' lo stesso del primo cliente (io), e' per questo che non funziona il pagamento??

    Vi posto anche il codice che ho trovato online senza cmq gli altri file php che sono quelli forniti da Paypal o Alertpay e quindi standard...


    -----------------------
    Codice PHP:
    <?php

    if (!defined('GEN2_PROCESS'))

    {

        exit();

    }



    if (
    $loggedin)

    {



        include_once (
    'menu.php');



        
    $contents .= "$menu_text
    "
    ;


        
    $ref_title "Cashout Funds";

        if (isset(
    $_GET['alertpay']) && $ir['balance'] >= $set['min_cashout'])

        {

            if (
    $set['ap_automated'] and $do->is_curl_installed() and (($set['upg_automated'] >

                
    and $ir['upgraded'] > time()) or $set['upg_automated'] == 0))

            {

                include 
    "modules/autopay/alertpay.php";

                

                
    $alertpay_payment_details = array(

                    
    "USER"          => $set['ap_username'],

                    
    "PASSWORD"      => $set['ap_api_password'],

                    
    "AMOUNT"        => round($ir['balance'], 2),

                    
    "CURRENCY"      => "USD",

                    
    "RECEIVEREMAIL" => $ir['alertpay_email'],

                    
    "PURCHASETYPE"  => "0",

                    
    "NOTE"          => $set['ap_note']

                );

                

                
    //print_r($payment_details);

                

                //die;

                

                
    if (alertpay_make_payment($alertpay_payment_details))

                {

                    
    $contents .= "<td width='80%' valign='top'>

        <div id='box7'>

            <div id='lb'>

                <div id='rb'>

                    <div id='bb'>

                        <div id='blc'>

                            <div id='brc'>

                                <div id='tb'>

                                    <div id='tlc'>

                                        <div id='trc'>        

                                            <div id='content'><h3>Payment sent successfully.</h3>



    Your payment was sent successfully. Please check your email to confirm.</p>

                                                                                    </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </td>

    </tr>

    </table>"
    ;

                    

                    
    mysql_query("UPDATE users SET balance='0', withdrew=withdrew+'{$ir['balance']}', cashouts=cashouts+'1' WHERE username='{$ir['username']}' LIMIT 1;");

                    
    mysql_query("UPDATE settings SET set_value=set_value+'{$ir['balance']}' WHERE set_name='total_paid' LIMIT 1;");

                    
    mysql_query("INSERT INTO history (username, time, type, custom1) VALUES ('{$ir['username']}', unix_timestamp(), 'cashout', '{$ir['balance']}')");

                    
    mysql_query("UPDATE stats SET cashouts=cashouts+'{$ir['balance']}'");

                }

                else

                {

                    
    $contents .= "<td width='80%' valign='top'>

        <div id='box7'>

            <div id='lb'>

                <div id='rb'>

                    <div id='bb'>

                        <div id='blc'>

                            <div id='brc'>

                                <div id='tb'>

                                    <div id='tlc'>

                                        <div id='trc'>        

                                            <div id='content'><h3>Unable to send payment</h3>



    Sorry, we couldn't send your payment - try again later.


    [url='javascript:history.back()']Back[/url]
    </p>

                                                                                    </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </td>

    </tr>

    </table>"
    ;

                }

                

                
    $do->refresh_sess(); //vital

            
    }

            else

            {

                if (
    $ir['pcashout'] > 0)

                {

                    
    $contents .= "<td width='80%' valign='top'>

        <div id='box7'>

            <div id='lb'>

                <div id='rb'>

                    <div id='bb'>

                        <div id='blc'>

                            <div id='brc'>

                                <div id='tb'>

                                    <div id='tlc'>

                                        <div id='trc'>        

                                            <div id='content'><h3>You have a payment pending.</h3>



    You cannot cashout while you have a payment which needs to be sent - Please wait until you have been paid your previous requests first.</p>

                                                                                    </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </td>

    </tr>

    </table>"
    ;

                }

                else

                {

                    
    mysql_query("UPDATE users SET balance='0', pcashout=pcashout+'{$ir['balance']}', pmethod='2' WHERE username='{$ir['username']}' LIMIT 1;");

                    
    $contents .= "<td width='80%' valign='top'>

        <div id='box7'>

            <div id='lb'>

                <div id='rb'>

                    <div id='bb'>

                        <div id='blc'>

                            <div id='brc'>

                                <div id='tb'>

                                    <div id='tlc'>

                                        <div id='trc'>        

                                            <div id='content'><h3>Payment Requested</h3>



    Your payment has been requested, We'll check the request and then send it via AlertPay - If you wish to change your payment email, simply check your account.</p>

                                                                                    </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </td>

    </tr>

    </table>"
    ;

                    
    $do->refresh_sess(); //vital

                
    }

            }

        } 
        elseif (isset(
    $_GET['paypal']) && $ir['balance'] >= $set['min_cashout'])

        {
            if (
    $set['pp_automated'] and $do->is_curl_installed() and (($set['upg_automated'] > and $ir['upgraded'] > time()) or $set['upg_automated'] == 0))
            {
                include 
    "modules/autopay/paypal.php";

                
    $paypal_payment_details = array(

                    
    "USER"          => $set['pp_api_username'],

                    
    "PWD"           => $set['pp_api_password'],

                    
    "SIGNATURE"     => $set['pp_api_signature'],

                    
    "EMAILSUBJECT"  => $set['pp_subject'],

                    
    "CURRENCYCODE"  => "USD",

                    
    "L_EMAIL0"      => $ir['paypal_email'],

                    
    "L_AMT0"        => round($ir['balance'], 2),

                    
    "L_NOTE0"       => $set['pp_message']

                );

                

                if (
    paypal_make_payment($paypal_payment_details))

                {

                    
    $contents .= "<td width='80%' valign='top'>

        <div id='box7'>

            <div id='lb'>

                <div id='rb'>

                    <div id='bb'>

                        <div id='blc'>

                            <div id='brc'>

                                <div id='tb'>

                                    <div id='tlc'>

                                        <div id='trc'>        

                                            <div id='content'><h3>Payment sent successfully.</h3>



    Your payment was sent successfully. Please check your email to confirm.</p>

                                                                                    </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </td>

    </tr>

    </table>"
    ;

                    

                    
    mysql_query("UPDATE users SET balance='0', withdrew=withdrew+'{$ir['balance']}', cashouts=cashouts+'1' WHERE username='{$ir['username']}' LIMIT 1;");

                    
    mysql_query("UPDATE settings SET set_value=set_value+'{$ir['balance']}' WHERE set_name='total_paid' LIMIT 1;");

                    
    mysql_query("INSERT INTO history (username, time, type, custom1) VALUES ('{$ir['username']}', unix_timestamp(), 'cashout', '{$ir['balance']}')");

                    
    mysql_query("UPDATE stats SET cashouts=cashouts+'{$ir['balance']}'");

                }

                else

                {

                    
    $contents .= "<td width='80%' valign='top'>

        <div id='box7'>

            <div id='lb'>

                <div id='rb'>

                    <div id='bb'>

                        <div id='blc'>

                            <div id='brc'>

                                <div id='tb'>

                                    <div id='tlc'>

                                        <div id='trc'>        

                                            <div id='content'><h3>Unable to send payment</h3>



    Sorry, we couldn't send your payment - try again later.


    [url='javascript:history.back()']Back[/url]
    </p>

                                                                                    </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </td>

    </tr>

    </table>"
    ;

                   

                }            

                

                
    $do->refresh_sess(); //vital

            
    }

            else

            {

                if (
    $ir['pcashout'] > 0)

                {

                    
    $contents .= "<td width='80%' valign='top'>

        <div id='box7'>

            <div id='lb'>

                <div id='rb'>

                    <div id='bb'>

                        <div id='blc'>

                            <div id='brc'>

                                <div id='tb'>

                                    <div id='tlc'>

                                        <div id='trc'>        

                                            <div id='content'><h3>You have a payment pending.</h3>



    You cannot cashout while you have a payment which needs to be sent - Please wait until you have been paid your previous requests first.</p>

                                                                                    </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </td>

    </tr>

    </table>"
    ;

                }

                else

                {

                    
    mysql_query("UPDATE users SET balance='0', pcashout=pcashout+'{$ir['balance']}', pmethod='1' WHERE username='{$ir['username']}' LIMIT 1;") or

                        die(
    mysql_error());

                    
    $contents .= "<td width='80%' valign='top'>

        <div id='box7'>

            <div id='lb'>

                <div id='rb'>

                    <div id='bb'>

                        <div id='blc'>

                            <div id='brc'>

                                <div id='tb'>

                                    <div id='tlc'>

                                        <div id='trc'>        

                                            <div id='content'><h3>Payment Requested</h3>



    Your payment has been requested, We'll check the request and then send it via PayPal - If you wish to change your payment email, simply check your account.</p>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </td>

    </tr>

    </table>"
    ;

                    
    $do->refresh_sess(); //vital

                
    }

            }

        }

        else

        {

            
    $tp .= "<td width='80%' valign='top'>

        <div id='box7'>

            <div id='lb'>

                <div id='rb'>

                    <div id='bb'>

                        <div id='blc'>

                            <div id='brc'>

                                <div id='tb'>

                                    <div id='tlc'>

                                        <div id='trc'>        

                                            <div id='content'>

                                            <table>

        <tr>

            <td>[img]themes/GeN3/images/cashout.png[/img]</td>

            <td><h3><font color='black'><h3>Cashout</h3></font></h3></td>

        </tr>

    </table>"
    ;

            if (
    $set['pp_enabled'])

            {

                
    $tp .= "<div style='overlay:auto;'>

    [url='cashout.php?paypal'][b]Cashout \$
    {$ir['balance']} via PayPal[/b][/url]</p>";

                if (
    $set['pp_automated'] and (($set['upg_automated'] > and $ir['upgraded'] >

                    
    time()) or $set['upg_automated'] == 0))

                {

                    
    $tp .= "

    Your funds will be sent [b]INSTANTLY[/b] via PayPal, So you should recieve your funds on average 30 seconds after you've requested it.</p></div>"
    ;

                }

                else

                {

                    
    $tp .= "

    Your funds will be audited and screened by our professional anti-fraud department - Your funds should be dispatched within 5-7 days.</p></div>"
    ;

                }

            }

            
    $tp .= "

    "
    ;

            if (
    $set['ap_enabled'])

            {

                
    $tp .= "<div style='overlay:auto;'>

    [url='cashout.php?alertpay'][b]Cashout \$
    {$ir['balance']} via AlertPay[/b][/url]</p>";

                if (
    $set['ap_automated'] and (($set['upg_automated'] > and $ir['upgraded'] >

                    
    time()) or $set['upg_automated'] == 0))

                {


    ...

  2. #2
    Scusa che vorresti fare non ho capito.....

    il cliente paga > paypal contatta al tuo sito per dargli OK > e gli arriva email?
    Io penso con la mia di testa..tu come?

  3. #3
    Utente di HTML.it
    Registrato dal
    Sep 2011
    Messaggi
    3
    no quella parte del codice funziona in quanto si appoggia su Paypal.

    Qui il cliente viene pagato dal sito istantaneamente per un lavoro che ha fatto ad esempio.
    Quindi una volta che i "suoi" soldi sono sul suo account all'interno del sito li puo' prelevare tramite il codice che ho postato.

    Il problema e': ho provato ad essere cliente e richiedere i soldi, ma mi porta su un punto del codice (quindi non un errore ma un opzione)

    Il mio dubbio e' se qualcosa non e' settato correttamente nelle opzioni Paypal (o Alertpay) API, ma credo mi verrebbe fuori un errore di PHP e nonun messaggio programmato dal codice,
    oppure e' perche' uso lo stesso account Paypal del sito (cioe' il mio)

    qualche AIUTO?????

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2011
    Messaggi
    3
    PLZ qualche suggerimento??

  5. #5
    Utente di HTML.it
    Registrato dal
    Sep 2011
    Messaggi
    3
    qualcuno ha esperienza in ambito?

  6. #6
    Mi dispiace, ma non puoi prendere soldi o fare dei movimenti sullo stesso conto paypal, puoi farlo solo con 2 conti paypal anche se intestati allo stesso nome, il problema potrebbe essere quello.
    Io penso con la mia di testa..tu come?

  7. #7
    Utente di HTML.it
    Registrato dal
    Sep 2011
    Messaggi
    3
    Giustamente!! grazie dell'aiuto,
    sono piu' rilassato in quanto apprendo che non e' un problema di codice quindi.

    Come posso fare pero' per testarlo?

  8. #8
    Crea un secondo account di paypal anche con il tuo stesso nome ma con un'altra email, in questo modo potrai fare tutte le prove che vuoi!...
    Io penso con la mia di testa..tu come?

  9. #9
    Utente di HTML.it
    Registrato dal
    Sep 2011
    Messaggi
    3
    sul serio? non sapevo si potesse creare un secondo account su Paypal...!
    posso?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.