SMF Development > Bug Reports
Another paid subscriptions bug?
Krash.:
I'm surprised there's no interest in this problem. If I'm reading the code correctly, recurring subs shouldn't work for anyone, and never could have in 2.0.x.
This hack may fix it (haven't tried it) -
In /Sources/Subscriptions-Paypal.php find this:
--- Code: ---
// Is this a subscription?
public function isSubscription()
{
if (substr($_POST['txn_type'], 0, 14) == 'subscr_payment')
return true;
else
return false;
}
// Is this a normal payment?
public function isPayment()
{
if ($_POST['payment_status'] == 'Completed' && $_POST['txn_type'] == 'web_accept')
return true;
else
return false;
}
// How much was paid?
public function getCost()
{
return $_POST['tax'] + $_POST['mc_gross'];
}
// exit.
public function close()
{
global $smcFunc, $subscription_id;
// If it's a subscription record the reference.
if ($_POST['txn_type'] == 'subscr_payment' && !empty($_POST['subscr_id']))
--- End code ---
Change to this:
--- Code: ---
// Is this a subscription?
public function isSubscription()
{
if (substr($_POST['txn_type'], 0, 14) == 'subscr_payment' || substr($_POST['txn_type'], 0, 13) == 'subscr_signup')
return true;
else
return false;
}
// Is this a normal payment?
public function isPayment()
{
if ($_POST['payment_status'] == 'Completed' && $_POST['txn_type'] == 'web_accept')
return true;
else
return false;
}
// How much was paid?
public function getCost()
{
return $_POST['tax'] + $_POST['mc_gross'];
}
// exit.
public function close()
{
global $smcFunc, $subscription_id;
// If it's a subscription record the reference.
if (($_POST['txn_type'] == 'subscr_payment' || $_POST['txn_type'] == 'subscr_signup') && !empty($_POST['subscr_id']))
--- End code ---
There's nothing in the database that flags a recurring sub, it's treated the same as a one-time subscription, so this workaround shouldn't affect anything in the forum (if it works).
Arantor:
Well, it definitely has worked for me in the past, so I'm intrigued as to why it hasn't for you.
emanuele:
Looking at this:
http://www.paypalobjects.com/en_US/ebook/subscriptions/Appx-ipn_subscription_variables.html
and this:
http://stackoverflow.com/questions/1061683/subscriptions-with-paypal-ipn
If I understand well, signup shouldn't be "so" important, payment should be the answer that says if the payment is valid or not (that's just a guess BTW).
To debug paypal issues I need to be in a very good mood (it has to do with money and I don't want to do something wrong with someone else's money) so...later.
Arantor:
Note that you can use the sandbox setting so that you don't actually use actual money.
emanuele:
Yep, I know, the comment was intended more in the sense that if I do anything wrong here that goes into SMF it means I'm playing with someone else's money.
So (since I'm known to have...ehm...a lot of imagination in create bugs :P), I prefer to take my time and play with paypal when I have plenty of time and a good mood. ;D
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version