vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vBPurchase 1.0c.fl1 (https://vborg.vbsupport.ru/showthread.php?t=83231)

WhisperPntr 08-22-2005 09:59 PM

Although I am still having problems contacting ron1n with my MSN (i can communicate with others strangely enough) we have discussed the status of vBPurchase.

Whenever I can actually see him we'll discuss the port to 3.5. ;) On that note I do have the full port of his original script completed. The bugs seem to be worked out and it installs nicely, but being the nature of these scripts I'm sure something will break on another user's incarnation.

If time is on my side I will also port over wh1tesox's current version of HelpDesk to 3.5. It'll be a quick and dirty port though, as he is already working on the 3.5 version. With further permission, I will most likely upgrade the script to his latest version But a big thanks to him and of course ron1n for letting me play as script monkey.

Also while it does look promising, I'm not making promises this will be released.

UOXDev 08-29-2005 08:41 PM

Quote:

Originally Posted by WhisperPntr
Although I am still having problems contacting ron1n with my MSN (i can communicate with others strangely enough) we have discussed the status of vBPurchase.

Whenever I can actually see him we'll discuss the port to 3.5. ;) On that note I do have the full port of his original script completed. The bugs seem to be worked out and it installs nicely, but being the nature of these scripts I'm sure something will break on another user's incarnation.

If time is on my side I will also port over wh1tesox's current version of HelpDesk to 3.5. It'll be a quick and dirty port though, as he is already working on the 3.5 version. With further permission, I will most likely upgrade the script to his latest version But a big thanks to him and of course ron1n for letting me play as script monkey.

Also while it does look promising, I'm not making promises this will be released.

Status?

Deska 08-30-2005 10:01 PM

Yes, I like to see this hack in vB3.5 :)

TPCComOld 09-13-2005 04:17 PM

If there is anyone capable and interested installing a store on my site and integrate it into ny vb 3.0.7 and ensure that its working properly and that my users will be able to purchase downloads to their mobile phones like ringtones and graphics, and purchase products and subscription services using vbpurchase or any other store, I am paying! Either PM or reply to the thread. Please dont waste either our times if you cant make this happen.

rlamego 09-13-2005 04:26 PM

Wow! This mod looks great but it does need some better instructions and a total clean up.
My paypal account doesn't list a token value...

TPCComOld 09-13-2005 04:37 PM

Quote:

Originally Posted by rlamego
Wow! This mod looks great but it does need some better instructions and a total clean up.
My paypal account doesn't list a token value...

The question is can you or anyone install the mod. It doesnt have to list a token value for me to pay does it?

psalzmann 09-13-2005 05:00 PM

Quote:

Originally Posted by TPCCom
The question is can you or anyone install the mod. It doesnt have to list a token value for me to pay does it?

Yeah noticed that.. Paypal does have some new tools such as this token hash feature which (as followed in the authors install script) I followed each step by step and it worked no problem. It's even creating the proper IPN log files. If you do not see these from your paypal.com account, the chances are you are not setup as a Paypal Verified Business (account) and therefore will not be able to make use of this "token" feature provided to this exact script (however this can be EASILY re-written) along side with the results of IPN logs being stored in the db (vs file path).

The biggest problem (no disrepect whatsoever to author) with this script would have to be the part during paypal / ordering. As shown above, the coder has used $productinfo (or $product) .. (I cannot remember) for both arrays while inserting information into the DB. All I did to get it talking the the db properly was to carefully review the variables and what arrays were being passed around into the Query statements.

(If you notice, both arrays are on top of eachother.. one array is for the paypal response, the other is to build the array (I think) to pass into your mysql db).

Below you will find the code that works perfect for our use. As you'll see, there is a new customized email that is also sent to "you" and/or 1 other person you wish to send the order email notification to.

I am not supporting this hack, but I've noticed countless posts about IPN not working within this thread. Hopefully this code may shed some light on the subject.

<strong>Note:</strong> We have customized this script just a little to also support "product support renewals". Basically, this allows a user to download the software and they re-pay (later on) for a support "renewal". What it will do is let the user "pay to renew their downloads" and will only update the "expiry date" for that user (and will not insert a new order as it normally would). This simply prevents that 1 user from seeing many rows for the same product that expires using the original method. There is one basic if condition block in the code below that you can remove to reflect the original state of this script.



PHP Code:

if ($_GET['do'] == 'ipn')
{
    
// BUILD PAYPAL REQUEST STRING
    
$request 'cmd=_notify-validate';
    
    foreach (
$_POST as $key => $value)
    {
        
$value urlencode(stripslashes($value));
        
$request .= "&$key=$value";
    }
    
    
// POST TO PAYPAL FOR VALIDATION
    
$headerx .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
    
$headerx .= "Content-Type: application/x-www-form-urlencoded\r\n";
    
$headerx .= "Content-Length: " strlen($request) . "\r\n\r\n";
    
$sock fsockopen ('www.paypal.com'80$errno$errstr30);
    
    if (!
$sock)
    {
            
$file fopen($config['log'].$_POST['txn_id'].'.ipn'"w"0);
            
fputs($file"FAILED TO CREATE SOCK | ".$_POST['custom']." | ".$_POST['item_name']." | ".$_POST['item_number']."\n");
            
fclose($file);
    }
    else
    {
        
fputs ($sock$headerx $request);
        
        while (!
feof($sock))
        {
            
$result fgets ($sock1024);
        }
        
        if (
$result != "VERIFIED")
        {
            
$file fopen($config['log'].$_POST['txn_id'].'.ipn'"w"0);
            
fputs($file"UNVERIFIED (".$result.") | ".$_POST['custom']." | ".$_POST['item_name']." | ".$_POST['item_number']."\n");
            
fclose($file);
        }
        else
        {
            
$id $_POST['txn_id'];
            
$user explode(":",$_POST['custom']);
            
$product explode("|",$_POST['item_number']);
            
$productinfo $DB_site->query_first("SELECT * FROM ph_product WHERE `id`='".$product[0]."'");
            
$items explode("-",$product[1]);
            
            foreach(
$items as $temp)
            {
                
$temp explode(":",$temp);
                
$item $DB_site->query_first("SELECT * FROM ph_item WHERE `id`='".$temp[0]."'");
                
                if (
$item['type'] == 'license')
                {
                    
$type 'license';
                }
                elseif (
$item['type'] == 'service')
                {
                    
$type 'service';
                }
                elseif (
$item['type'] == 'renewal')
                {
                    
$type 'renewal';
                }
                
                
// is this a support renewal order?
                
if ($item['name'] == 'Support Renewal')
                {
                    
$DB_site->query("UPDATE ph_order
                    SET date = '"
.time()."',
                    length = '"
.$item['length']."',
                    active = '1'
                    WHERE userid = '"
.$user[0]."'
                    AND productid = '"
.$productinfo['id']."'
                    LIMIT 1"
);
                }
                else
                {
                    
$DB_site->query("INSERT INTO ph_order (`userid`,`username`,`itemid`,`itemname`,`itemtype`,`productid`,`productname`,`price`,`quantity`,`date`,`length`,`active`)
                    VALUES('"
.$user[0]."','".$user[1]."','".$item['id']."','".$item['name']."','".$type."','".$productinfo['id']."','".$productinfo['name']."','".$item['price']."','".$temp[1]."','".time()."','".$item['length']."','1')");
                }
            }
            
            
$message "Customer Payment via Paypal.com (ProductID# " $product['id'] . ") was received: \n\n*************************\nProduct: " $productinfo['name'] . "\nItem Name: " $_POST['item_name'] . "\nItem Number: "$_POST['item_number'] ."\nCustomer: " $user[1] . "\nCustom: " $_POST['custom'] . "\n*************************\n\nRegards,\n\nTeam ILance";

            
// Send e-mail to admin about new purchase via paypal
            
mail('????????????????????????????''[ILance Store] New Paypal Order by '.$user[1], $message,
             
"From: ?????????????????????????\r\n" .
             
"Reply-To: $bbuserinfo[email]\r\n" .
             
"X-Mailer: PHP/" phpversion());

// lets email one other staff / admin user about paypal (to be safe)
             
mail('??????????????????????''[ILance Store] New Paypal Order by '.$user[1], $message,
             
"From: ?????????????????????\r\n" .
             
"Reply-To: $bbuserinfo[email]\r\n" .
             
"X-Mailer: PHP/" phpversion());
            
            
$file fopen($config['log'].$_POST['txn_id'].'.ipn'"w"0);
            
fputs($file"VERIFIED | ".$_POST['custom']." | [".$productinfo['name']."] ".$_POST['item_name']." | ".$_POST['item_number']."\n");
            
fclose($file);
        }
    }
    
fclose ($sock);


Let me know if this helps anyone.

Regards,

Peter

TPCComOld 09-13-2005 05:28 PM

Peter,

I sent you an email. Can you take a look at it.

Creed 10-01-2005 06:39 AM

Any plans to bring this to 3.5?

Nutz 10-09-2005 12:43 PM

This would be great for 3.5 ;)

Thanks,
Mat


All times are GMT. The time now is 03:58 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01617 seconds
  • Memory Usage 1,820KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete