News:

Support the VirtueMart project and become a member

Main Menu

Problem with PayPal Recurring / Monthly Payment

Started by chute09, July 01, 2009, 15:57:45 PM

Previous topic - Next topic

chute09

Hi Guys,

I have tried nearly every solution to implement Pay Pal recurring subscriptions in virtuemart including the one from http://myjoomlaextensions.net i found this tutorial on net: http://blog.halcyon-solutions.com/2008/04/07/paypal-recurring-payments-in-virtuemart/

However i think it may be incompatible with the newer virtuemart versions, after confirming my order i recieve this error:

Parse error: syntax error, unexpected ':' in /home/righttim/public_html/fireplayservers.com/components/com_virtuemart/themes/vm_mynxx/templates/pages/checkout.thankyou.tpl.php(61) : eval()'d code on line 2

The original PayPal method works fine.

The code for the extra payment info is:

<?php
        $url 
"https://www.paypal.com/cgi-bin/webscr";
        
$tax_total $db->f("order_tax") + $db->f("order_shipping_tax");
        
$discount_total $db->f("coupon_discount") + $db->f("order_discount");
        
$post_variables = Array(
                
"cmd" => "_xclick-subscriptions",
                
"business" => PAYPAL_EMAIL,
                
"receiver_email" => PAYPAL_EMAIL,
                
"item_name" => $VM_LANG->_PHPSHOP_ORDER_PRINT_PO_NUMBER.": "$db->f("order_id"),
                
"order_id" => $db->f("order_id"),
                
"invoice" => $db->f("order_number"),
                
"a3&#8243; => round( $db->f("order_subtotal")+$tax_total-$discount_total, 2),
                "
shipping" => sprintf("%.2f", $db->f("order_shipping")),
                "
currency_code" => $_SESSION['vendor_currency'],"first_name" => $dbbt->f('first_name'),
                "
last_name" => $dbbt->f('last_name'),
                "
address_street" => $dbbt->f('address_1&#8242;),
                "
address_zip" => $dbbt->f('zip'),
                "
address_city" => $dbbt->f('city'),
                "
address_state" => $dbbt->f('state'),
                "
address_country" => $dbbt->f('country'),
                "
image_url" => $vendor_image_url,
                "
return" => SECUREURL ."index.php?option=com_virtuemart&page=checkout.result&order_id=".$db->f("order_id"),
                "
notify_url" => SECUREURL ."administrator/components/com_virtuemart/notify.php",
                "
cancel_return" => SECUREURL ."index.php",
                "
undefined_quantity" => "0&#8243;,
                
"test_ipn" => PAYPAL_DEBUG,
                
"pal" => "NRUBJXESJTY24&#8243;,
                "
no_shipping" => "1&#8243;,
                
"bn" => "PP-SubscriptionsBF",
                
"lc" => "US",
                
"p3&#8243; => "1&#8243;,
                
"t3&#8243; => "M",
                "
src" => "1&#8243;,
                
"no_note" => "1&#8243;
        );
        if( 
$page == "checkout.thankyou" ) {
                
$query_string = "?";
                foreach( 
$post_variables as $name => $value ) {
                        
$query_string .= $name. "=" . urlencode($value) ."&";
                }
                mosRedirect( 
$url . $query_string );
        } else {
                echo '<form action="'.$url.'" method="
post" target="_blank">';
                echo '<input type="
image" name="submit" src="http://images.paypal.com/images/x-click-but6.gif" mce_src="http://images.paypal.com/images/x-click-but6.gif" border="0&#8243; alt="Make payments with PayPal, it is fast, free, and secure!" />';
                
foreach( $post_variables as $name => $value ) {
                        echo 
'<input type="hidden" name="'.$name.'" value="'.$value.'" />';
                }
                echo 
'</form>';
        }
?>




I have tried changing mosRedirect to vmRedirect in the above code with no luck.

Any help at all will be greatly appreciated  ;)

NWLB

Ditto.  I've tried three methods for subscriptions thus far, and none work.  And this seems to be a topic that makes a lot of folks duck and hide.

chute09

Yes it is extremely fustrating hehe; if anyone would like to make a simple PayPal recurring payment module i would be willing to pay for this and i know alot of others would too. If anyone has any news at all please post it here.

PS. Long live virtuemart :D

juno

Hi,

Did you guys find out any solution to this problem. Please do let me know  :( :( :(


Regards

darrylrio

I'm currently using the uc_credit with paypal WPP as a gateway de uc_recurring to handle monthly fees for a site subscription. Client's requirement is to allow users to update their cc information. Since this is not handled by the default uc_recurring fee handler I wrote a custom fee handler that I hope could be integrated to provide additional features to the basic handler. I've attached a simple module I created to handle this.