Advertisement:

Author Topic: Paid Subscriptions Bug?  (Read 11094 times)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,164
Re: Paid Subscriptions Bug?
« Reply #20 on: December 23, 2015, 12:29:14 PM »
PayPal allows recurring payments (they call it subcriptions) in business and premier accounts.  If you do a subscription with recurring disabled, you'll go to the PP personal account payment interface.  With recurring enabled, you'll go to the business interface.  If you have the wrong type of account, PayPal will display an error message that you're not authorized to do recurring payments.

Can you set up a clean test install on same account as your production site and give me admin access?

Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,354
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes & Custom Coding
Re: Paid Subscriptions Bug?
« Reply #21 on: December 23, 2015, 02:33:35 PM »
Maybe I have it blocked in my Paypal account, will check later, but first I need to work this on another site to see if it is unique to me. I will return and report. Thanks.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,164
Re: Paid Subscriptions Bug?
« Reply #22 on: December 23, 2015, 07:52:26 PM »
You can't block IPNs in your PayPal account.  Subscriptions-PayPal.php sends a notify_url (link to your forum's subscriptions.php) which overrides IPN settings.

Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,354
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes & Custom Coding
Re: Paid Subscriptions Bug?
« Reply #23 on: March 30, 2016, 08:39:27 PM »
I am working on another site. The bug fix of "&" over ";" fixes the urlencode problem and everything works fine, however I noticed that if you check "recurring payment" then on the return Paypal sends back an "Auth=......" code rather than "profile;u=1111;area=subscriptions;sub_id=1;done" so nothing is registered. Is this happening to anyone else?

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,164
Re: Paid Subscriptions Bug?
« Reply #24 on: March 30, 2016, 09:49:57 PM »
The semicolon problem does not affect subscription activation, subscription is successful but returns user to main index instead of confirmation page.  If subscription is failing, that's a different problem altogether.  Are you getting a paid subs error in your log?  Are you running the Subscriptions-PayPal.php I posted here?  Where are you seeing the Auth= code?


Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,354
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes & Custom Coding
Re: Paid Subscriptions Bug?
« Reply #25 on: April 01, 2016, 07:03:35 PM »
Thanks for your reply. Sorry for the delayed reply.

I am seeing the Auth code in the return URL from PayPal for example:
/index.php?auth=A2.uSamhLI95WqNLKPY0i581N9NQ23wHfqpbyFgr-qex6pVdmSN29PQnhPNUelAArHkjew&form_charset=UTF-8

I did not use your edits. Just checking logs it says: "Undefined index: action"

Also, what happens if the subscriber does not hit the return to site button after payment does that mean SMF will not be able to record and Admin will have to manually enter the subscription based on an Email from Paypal? If so, is the Member ID sent as part of the info under notes?

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,164
Re: Paid Subscriptions Bug?
« Reply #26 on: April 01, 2016, 09:46:26 PM »

I am seeing the Auth code in the return URL from PayPal for example:
/index.php?auth=A2.uSamhLI95WqNLKPY0i581N9NQ23wHfqpbyFgr-qex6pVdmSN29PQnhPNUelAArHkjew&form_charset=UTF-8

Haven't a clue what that is, PayPal is changing the return url.  The correct url is put together in Profile-Actions.php -

Code: [Select]

$fields = $gateways[$id]->fetchGatewayFields($context['sub']['id'] . '+' . $memID, $context['sub'], $context['value'], $period, $scripturl . '?action=profile&u=' . $memID . '&area=subscriptions&sub_id=' . $context['sub']['id'] . '&done');


and is posted to Paypal with the other transaction data by Subscriptions-PayPal.php -

Code: [Select]

// All the standard bits.
$return_data['hidden']['business'] = $modSettings['paypal_email'];
$return_data['hidden']['item_name'] = $sub_data['name'] . ' ' . $txt['subscription'];
$return_data['hidden']['item_number'] = $unique_id;
$return_data['hidden']['currency_code'] = strtoupper($modSettings['paid_currency_code']);
$return_data['hidden']['no_shipping'] = 1;
$return_data['hidden']['no_note'] = 1;
$return_data['hidden']['amount'] = $value;
$return_data['hidden']['cmd'] = !$sub_data['repeatable'] ? '_xclick' : '_xclick-subscriptions';
>>> $return_data['hidden']['return'] = $return_url;
$return_data['hidden']['a3'] = $value;
$return_data['hidden']['src'] = 1;
$return_data['hidden']['notify_url'] = $boardurl . '/subscriptions.php';


You'll have to contact PayPal support and ask them wtf they're doing.


Quote
Also, what happens if the subscriber does not hit the return to site button after payment does that mean SMF will not be able to record and Admin will have to manually enter the subscription based on an Email from Paypal?

The subscription should activate regardless of whether the subscriber returns to your forum or not.  As I understand it, this is how the process works:

- Forum posts subscription data to PayPal
- If payment is successful, PP posts IPN to forum.  IPN includes verify_sign, which is verification code.
- Forum posts verification code back to PP.
- PP verifies code and posts verification to forum.
- Subscription activates.

None of this is affected by $return_url

Upload the modified Subscriptions-PayPal.php I posted in the other thread.  It contains additional error handling that may tell you why subscription is failing.

 

Offline Looking

  • SMF Hero
  • ******
  • Posts: 2,354
  • SMF Customization
    • jeanborde on Facebook
    • SMF Custom Themes & Custom Coding
Re: Paid Subscriptions Bug?
« Reply #27 on: April 19, 2016, 10:11:55 AM »
As a followup, everything is working well. It seems that sandbox mode limits the ability to test what happens with some of the features described above. When not in test mode everything executed fine.

Thanks for your help Sir Osis of Liver.