Visualizzazione dei risultati da 1 a 8 su 8

Discussione: IPN paypal

Visualizzazione discussione

  1. #3
    Utente di HTML.it
    Registrato dal
    Feb 2016
    Messaggi
    17
    il forum in se ha scritto così appena ho messo la tag PHP
    Codice PHP:
    <?php 
        error_reporting
    (E_ALL);
        
        
    // Require the configuration file \n
        
    require_once('../config.php');
        
        
    // The current time\n
        
    $time date("F j, Y, g:i a"); 


        
    // The database connection info\n
        
    $conn odbc_connect("Driver={SQL Server};Server=$DATABASE_HOST;Database=$USER_DATABASE",$DATABASE_USER,$DATABASE_PASS) or die('Database Connection Error!');
        if(!
    $conn){
            exit(
    "Connection failed:".odbc_errormsg());
        } 
        
    // Connect to the server

        
    if (!$conn) die ("failed");
        
    // The e-mail of the user submitting the payment
        
    $payer_email = isset($_REQUEST['payer_email']) ? $_REQUEST['payer_email'] : die("Payer email value not set!");
        
        
    // The email of the user receiving the payment
        
    $receiver_email = isset($_REQUEST['receiver_email']) ? $_REQUEST['receiver_email'] : die("Receiver email value not set!");
        
        
    // The payment status
        
    $payment_status = isset($_REQUEST['payment_status']) ? $_REQUEST['payment_status'] : die("Payment status value not set!");
        
        
    // The amount paid
        
    $amount_paid = isset($_REQUEST['mc_gross']) ? $_REQUEST['mc_gross'] : die("Amount paid value not set!");
        
        
    // The tax paid
        
    $tax_paid = isset($_REQUEST['tax']) ? $_REQUEST['tax'] : die("Tax value not set!");
        
        
    // Check if the payment status is completed, and the receiver email matches that in the configuration
        
    if ($payment_status == "Completed" && $receiver_email == $PAYMENT_EMAIL) {
            
            
    // The custom field set, to verify the correct details
            
    $custom_variable = isset($_REQUEST['custom']) ? $_REQUEST['custom'] : die("Custom value not set!");


            
    // Split the field to an array
            
    $custom_array explode(":"$custom_variable);
            
            
    // The User ID
            
    $user_id $custom_array[0];
            
            
    // The custom amount paid\n
            
    $custom_paid $custom_array[1];
            
            
    $insert_amountpay=odbc_exec($conn"INSERT INTO PS_UserData.dbo.DonationTest (message, UserId) VALUES ('Amount paid: '$amount_paid', Custom paid: '$custom_paid ', Tax: ' $tax_paid '!', ' $user_id ')");
            
            
    // Check if the product id exists
            
    if (isset($DONATION_VALUES[$custom_paid])) {
                
                
    // The entry
                
    $entry $DONATION_VALUES[$custom_paid];
                    
                
    $insert_tax=odbc_exec($conn"INSERT INTO PS_UserData.dbo.DonationTest (message) VALUES ('Tax paid: '$tax_paid'!')");
               
                
    // Calculate the expected amount
                
    $expected_amount = ($tax_paid != ? ($amount_paid $tax_paid) : $amount_paid);
                
                
    // Check the price and amount paid match
                
    if ($custom_paid == $expected_amount) {
                    
                    
    $pagamento odbc_exec($conn,"INSERT INTO PS_UserData.dbo.DonationTest (message, UserId) VALUES ('Points added: '$entry ' ! to', '$user_id')");
                    
                    
                    
    // The amount of points to give
                    
    $points $entry;
                        
                    
    // Check if the connection failed
                    
    if (!$conn) die("Connection to the database failed!");
                        
                    
    // The query
                    
                    
    $updatepoints odbc_exec($conn"UPDATE PS_UserData.dbo.Users_Master SET Point += '$points' WHERE UserId = '$user_id'");
                                        
                    
    // End the script
                    
    die("Donation successful! '$points' has been added to: ' $user_id'");
                } else {
                    die(
    "Request tempered! Mismatching payment amount!");
                    }
            } else {
                    die(
    "Value not found!");
                }
        }
        
    odbc_close($conn);
    ?>
    ora va bene
    Ultima modifica di AxelHack; 28-02-2016 a 12:52

Tag per questa discussione

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 © 2025 vBulletin Solutions, Inc. All rights reserved.