Advertisement:

Author Topic: Another paid subscriptions bug?  (Read 21688 times)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,312
Re: Another paid subscriptions bug?
« Reply #40 on: February 10, 2013, 02:45:42 PM »

Yes, that's the usual error.  It's not a gateway problem because payment is successful, and subscriptions.php receives the IPN - correct payment details are in the logged error.  It just isn't processed correctly and the subscription isn't activated.  This is a common problem, and doesn't always involve recurring payments.  I've been unable to duplicate it on my test forums, so it may be host or php config related.


Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Another paid subscriptions bug?
« Reply #41 on: February 10, 2013, 04:21:05 PM »
As far as I can tell from the code, that error is generated here:
Code: [Select]
$txnType = '';
$gatewayHandles = loadPaymentGateways();
foreach ($gatewayHandles as $gateway)
{
$gatewayClass = new $gateway['payment_class']();
if ($gatewayClass->isValid())
{
$txnType = $gateway['code'];
break;
}
}

if (empty($txnType))
generateSubscriptionError($txt['paid_unknown_transaction_type']);

and isValid simply checks if the gateway *can* handle the transaction.
The checks for paypal are rather trivial:
Code: [Select]
public function isValid()
{
global $modSettings;

// Has the user set up an email address?
if (empty($modSettings['paypal_email']))
return false;
// Check the correct transaction types are even here.
if ((!isset($_POST['txn_type']) && !isset($_POST['payment_status'])) || (!isset($_POST['business']) && !isset($_POST['receiver_email'])))
return false;
// Correct email address?
if (!isset($_POST['business']))
$_POST['business'] = $_POST['receiver_email'];

if ($modSettings['paypal_email'] !== $_POST['business'] && (empty($modSettings['paypal_additional_emails']) || !in_array($_POST['business'], explode(',', $modSettings['paypal_additional_emails']))))
return false;
return true;
}
so:
* is paypal enabled?
* is there:
   * a) a txn_type or a payment_status POSTed?
   or
   * b) business or receiver_email POSTed?
* is the email correct?

and that's all...
It doesn't check what tnx_type contains at all.

The only case I didn't see the subscription activated was when paypal (seller paypal) was wrongly set to "ask me" for currencies different than USD and the subscriptions were set in something different than USD. In that case paypal correctly don't accept the payment and SMF doesn't activate the subscription.


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,312
Re: Another paid subscriptions bug?
« Reply #42 on: February 11, 2013, 01:26:24 PM »

I only encountered the currency problem once, and was able to fix it.  All the other forums with failed subscriptions were using USD.  If you look at my first post top of this thread, I found IPN transaction types that are specified in Subscriptions-PayPal.php, and others that are not.  In some cases sub will fail with unknown txn_type error even though txn_type in IPN is valid and specified in Subscriptions-PayPal.php.  IIRC, in at least one case, a sub was successful with a txn_type that is not specified in Subscriptions-PayPal.php.  Wasn't able to duplicate the problem, so didn't pursue it.  I can't do anything with recurring payments because I have a personal Paypal account, and it requires a business account, but otherwise Paid Subs has worked for me in all 2.0.x versions. 


Offline madfiddler

  • Full Member
  • ***
  • Posts: 667
  • Gender: Male
  • Flit Kills Moths
    • madfiddler
Re: Another paid subscriptions bug?
« Reply #43 on: February 11, 2013, 03:46:40 PM »
Wonder if I should start accepting USD rather than GBP then....

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,312
Re: Another paid subscriptions bug?
« Reply #44 on: February 11, 2013, 08:51:28 PM »

Paid Subs should accept GBP - it's one of the currency choices in Settings.


Offline madfiddler

  • Full Member
  • ***
  • Posts: 667
  • Gender: Male
  • Flit Kills Moths
    • madfiddler
Re: Another paid subscriptions bug?
« Reply #45 on: February 11, 2013, 08:54:06 PM »
Yep, I just want to find a way to make this work, and not have the 2005 bug. Just a thought to try dollars and see if that does indeed work.

Offline madfiddler

  • Full Member
  • ***
  • Posts: 667
  • Gender: Male
  • Flit Kills Moths
    • madfiddler
Re: Another paid subscriptions bug?
« Reply #46 on: February 11, 2013, 09:01:07 PM »
Tried $ instead of £. Get the 'pending payment' issue.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,312
Re: Another paid subscriptions bug?
« Reply #47 on: February 11, 2013, 10:01:31 PM »

Is your Paypal account set up for GBP?


Offline madfiddler

  • Full Member
  • ***
  • Posts: 667
  • Gender: Male
  • Flit Kills Moths
    • madfiddler
Re: Another paid subscriptions bug?
« Reply #48 on: February 12, 2013, 04:29:48 AM »
I have a business account which is set in GPB, yes, but accepts anything it seems. I've reverted back to GBP payment now, just thought I'd try.

I wonder if this is a server issue though. The SFMHacks Shop IPN appear to work either however my server logs show that Paypal is indeed contacting the server.

Offline madfiddler

  • Full Member
  • ***
  • Posts: 667
  • Gender: Male
  • Flit Kills Moths
    • madfiddler
Re: Another paid subscriptions bug?
« Reply #49 on: February 12, 2013, 04:33:07 AM »
Something else which is interesting, if I select currency "other" it says

currency code - GBP
symbol used - £%1.2f

Shouldn't symbol used be £%1.2f ?

Perhaps the internal symbol for GBP when selecting the drop down menu is incorrect?

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,312
Re: Another paid subscriptions bug?
« Reply #50 on: February 12, 2013, 02:35:42 PM »

&pound will give you the correct symbol in html.

Post an error from your error log for a failed subscription.


Offline madfiddler

  • Full Member
  • ***
  • Posts: 667
  • Gender: Male
  • Flit Kills Moths
    • madfiddler
Re: Another paid subscriptions bug?
« Reply #51 on: February 12, 2013, 05:05:03 PM »
OK, thanks.

I've never been able to find an error in the log, no mention at all. Only only mention in the server log saying there was a call from notify.paypal.com

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,312
Re: Another paid subscriptions bug?
« Reply #52 on: February 13, 2013, 12:29:25 PM »

If there's no error, that usually means the IPN never reached the forum.  It's being blocked, either by a mod or your host.  If you contact Paypal merchant support, they can confirm that the IPN was sent, and if it's getting to the forum or not.

Offline madfiddler

  • Full Member
  • ***
  • Posts: 667
  • Gender: Male
  • Flit Kills Moths
    • madfiddler
Re: Another paid subscriptions bug?
« Reply #53 on: February 13, 2013, 06:42:43 PM »
OK Krash, thankyou - I will do.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,665
    • StoryBB/StoryBB on GitHub
Re: Another paid subscriptions bug?
« Reply #54 on: January 09, 2014, 11:08:37 PM »
Retracked under https://github.com/SimpleMachines/SMF2.1/issues/1169 to prevent it falling through the cracks any further. (Having a central place to co-ordinate all the issues does actually help :))
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.