Page 1 of 1

ERROR: Unable to modify Subscription (AliPay Payment)

PostPosted: October 18th, 2011, 5:14 am
by smallfish
Hi

I bought S2member Pro 3 days ago.

Today I started test it with AliPay (I only need AliPay as my prospects are Chinese) today, I encountered the following issue. Here are my detailed steps:

1. Create a AliPay button. Code:

[s2Member-Pro-AliPay-Button level="1" ccaps="" desc="自学版" custom="*****" ra="0.01" rp="1" rt="M" image="default" output="anchor" /]

2. Put it in my web page

3. Click the button and make payment

4. Payment success and I get redirected to my website.

5. Get an error message:

[ERROR: Unable to modify Subscription.
Please contact Support for assistance.

Could not get the existing User ID from the DB. ]

6. Read logs in the s2member log folder (I enabled the log option before test), but can't find more information.

For detailed error log and website url I'll send it privately.

Very appreciate for your kindly help.


Thanks

Re: ERROR: Unable to modify Subscription (AliPay Payment)

PostPosted: October 19th, 2011, 12:22 am
by smallfish
Found the cause.

Should be a bug of S2Member.

Relative info In paypal_ipn.log,

Code: Select all
  'option_name1' => 'Referencing Customer ID',
  'option_selection1' => '68.68.**.**',
  'option_name2' => 'Customer IP Address',
  'item_number' => '1::1 M',
  'item_name' => 'basic',
  'proxy_verified' => 'alipay',
  's2member_log' =>
  array (
    0 => 'IPN received on: Tue Oct 18, 2011 9:15:46 am UTC',
    1 => 's2Member POST vars verified with a Proxy Key',
    2 => 's2Member originating domain ( `$_SERVER["HTTP_HOST"]` ) validated.',
    3 => 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ).',
    4 => 's2Member `txn_type` identified as ( `web_accept|subscr_signup` ) w/ update vars.',
    5 => 'Unable to modify Subscription. Could not get the existing User ID from the DB. Please check the `on0` and `os0` variables in your Button Code.',
  ),


For option 1 "Referencing Customer ID", the value is ip address. But S2Member treat it like a user id and try to modify exist subscription instead of create new one.

I changed code line 107 in paypal-return-in-subscr-or-wa-w-level.inc.php. Check the value of option 1 to choose the correct route. It works now.

source line

Code: Select all
if (preg_match ("/(referenc|associat|updat|upgrad)/i", $paypal["option_name1"]) && $paypal["option_selection1"] )


modified line

Code: Select all
if (preg_match ("/(referenc|associat|updat|upgrad)/i", $paypal["option_name1"]) && $paypal["option_selection1"] && !preg_match ("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $paypal["option_selection1"]))


Post it here for anyone who may encounter this issue.

Re: ERROR: Unable to modify Subscription (AliPay Payment)

PostPosted: October 21st, 2011, 1:40 pm
by Jason Caldwell
Thanks for reporting this important issue.
Your email has also been received.
~ Investigating now.

Re: ERROR: Unable to modify Subscription (AliPay Payment)

PostPosted: October 23rd, 2011, 1:23 pm
by Jason Caldwell
Investigation completed.
Thank you. This bug has been identified and corrected in the development copy of s2Member Pro.

We'll include this fix in the next official release of s2Member Pro.
Until then, I'm attaching a patch file that you can use to fix an existing installation of s2Member Pro v111017. Please unzip and upload the attached file. Let it override your existing copy of:
/s2member-pro/includes/classes/gateways/alipay/alipay-button-in.inc.php
alipay-button-in.inc.php.zip
(2.61 KiB) Downloaded 89 times

Re: ERROR: Unable to modify Subscription (AliPay Payment)

PostPosted: October 27th, 2011, 11:51 pm
by smallfish
Thanks Jason