I know I am late, yet I have only now moved my vB 3.8.9 forum straight to vB 4.2.5.
I have been using the similar Donate hack on vB3, so it made sense to install this one. It looks similar, but there are some differences and I found a pretty big bug - surprising nobody talks about it in 57 pages of comments. I did find a workaround for the bug as I will explain.
First of all, I compared the differences in what is sent to PayPal between the old and new version.
This mod adds the following to the url string sent to PayPal: &sra=1&src=1&srt=1
Seems harmless enough, until you try to submit a donation for one month. This results in the following error on PayPal:
"The link you have used to enter the PayPal system is invalid. Please review the link and try again."
As I knew that only three parameters had been added, I tested each of them until I found the problem: srt=1
PayPal defines that parameter as follows: "Specify an integer with a minimum value of 2 and a maximum value of 52."
Sure enough, as soon as I set srt=2, it worked.
As I did not want recurring subscriptions, I made some changes to the .xml file to get it to work as it did in the vB3 version. I also decided to set the locale to US as otherwise, my mainly US subscribers were being presented with a German PayPal page.
Find the following in VSa_PPDon.xml
Code:
if(strstr($vbulletin->GPC['amount'],'|'))
{
$vsapp_get_amount = explode('|', $vbulletin->GPC['amount']);
$vsapp_ppurl = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions';
$vsapp_ppurl .= '&a3='.$vsapp_get_amount[0];
$vsapp_ppurl .= '&p3='.$vsapp_get_amount[1];
$vsapp_ppurl .= '&t3=M';
$vsapp_ppurl .= '&no_note=1';
$vsapp_ppurl .= '&sra=1';
$vsapp_ppurl .= '&src=1';
$vsapp_ppurl .= '&srt='.$vsapp_get_amount[1];
}
else
{
$vsapp_ppurl = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick';
$vsapp_ppurl .= '&amount='.$vbulletin->GPC['amount'];
}
Replace with:
Code:
if(strstr($vbulletin->GPC['amount'],'|'))
{
$vsapp_get_amount = explode('|', $vbulletin->GPC['amount']);
$vsapp_ppurl = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions';
$vsapp_ppurl .= '&a3='.$vsapp_get_amount[0];
$vsapp_ppurl .= '&p3='.$vsapp_get_amount[1];
$vsapp_ppurl .= '&t3=M';
$vsapp_ppurl .= '&no_note=1';
$vsapp_ppurl .= '&lc=US';
}
else
{
$vsapp_ppurl = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick';
$vsapp_ppurl .= '&amount='.$vbulletin->GPC['amount'];
$vsapp_ppurl .= '&lc=US';
}
In this change, I have completely removed the "&sra=1&src=1&srt=1" and added "&lc=US" to the string sent to PayPal. This makes all donations one-time, as it was in vB3, and ensures that all sponsors land on an English PayPal language page.
I find this works better for me and avoids the error for one month subscriptions. I also found that PayPal will show an error for any subscriptions longer than 24 months, so avoid that.
What I would really like, is an option to have this mod make use of the original vBulletin PayPal subscription system. Then a two month subscription could actually add the donor to the specified VIP group for those two months and then automatically remove the subscription to that usergroup, when the subscription expires. I do that manually, but it would be great if that possibility could be added to this mod. Is perhaps Valter, or someone else, up to the challenge?
I have attached my modified .xml file, in case anyone here finds it useful.