latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Paypal Subscr Mod Button FAIL

Home Forums Community Forum Paypal Subscr Mod Button FAIL

This topic contains 5 replies, has 2 voices. Last updated by  Cristián Lávaque 4 years ago.

Topic Author Topic
Posted: Tuesday Dec 11th, 2012 at 4:25 am #34211
Yosuke Hasumi
Username: yosuke

Background:
I’ve been working on a system for adoptions for charity using S2member pro. it relies on ccaps to allow users to view their adopted animal content. Each animal is created as a custom post type and with any posts tagged with a category with the same slug as the custom post type. This way i can control what the user sees depending on which ccaps they have. for example if they have adopted JOEY animal then they will have access to any posts categorized as JOEY. The adoption process works like a charm and payments work great.

Problem:
When a user tries to add another animal, say BOBBI, I’d like this animal to be added to the existing adoption and the monthly donation amount to be increased. As far as I understand modifying the original recurring subscription (adoption) isn’t possible unless the user modifies that in paypal. But using the Paypal Subscription Modification Button I can modify the subscription with completely new terms (i hope that’s right). So my button reads this now:

<?php echo do_shortcode('[s2Member-PayPal-Button modify="1" level="1" ccaps="joey,bobbi" desc="Testing adoption modification for Joey, Bobbi" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="mysite.org" ta="0" tp="" tt="D" ra="0.02" rp="1" rt="M" rr="1" rrt="" rra="1" image="default" output="button" success="mysite.org/my-dashboard/" /]'); ?> 

The button seems to work to expectations, I process my order on paypal and it looks like everything is in order. My $0.01/month for JOEY is updated to $0.02/month for JOEY and BOBBI. After finishing my transaction i get to that awful grey screen that says:

Thank you! ( you MUST check your email before proceeding ).

* Note: It can take ( up to 15 minutes ) for Email Confirmation with important details. If you don’t receive email confirmation in the next 15 minutes, please contact Support.

Check Your Email ( Then Click Here )

Of course i get nothing from mysite.org in my email so basically this becomes a dead end for the user. I do however receive my paypal notification that my subscription has been modified (so this part is good). Checking the IPN log I can see that my transaction has gone through and it’s received all the relevant variables but i get this:

's2member_log' => 
  array (
    0 => 'IPN received on: Tue Dec 11, 2012 8:58:12 am UTC',
    1 => 's2Member POST vars verified through a POST back to PayPal®.',
    2 => 's2Member originating domain ( `$_SERVER["HTTP_HOST"]` ) validated.',
    3 => 's2Member `txn_type` identified as ( `subscr_modify` ).',
    4 => 'Unable to modify Subscription. Could not get the existing User ID from the DB.',
  ),

So item 4 tells me that s2member is having troubles understanding WHO this subscription mod if for (am i translating that correctly?). Yes I am logged in while i’m beginning this transaction. Any insight from the amazing wizards at S2member? Could use some help, this has been plaguing me for long enough.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Tuesday Dec 11th, 2012 at 9:00 am #34253

Hi Yosuke.

Could you show me the full log entry? Do you have entries from the other log files for the same transaction? Could I see those as well? x’ing out any private info, please. [hilite path]Dashboard -› s2Member® -› PayPal® Options -› Account Details -› Logging[/hilite]

Of course i get nothing from mysite.org in my email so basically this becomes a dead end for the user.

Maybe this helps: http://www.primothemes.com/forums/viewtopic.php?f=4&t=10368&p=33365#p33365

But using the Paypal Subscription Modification Button I can modify the subscription with completely new terms (i hope that’s right).

You may need to adjust it dynamically based on what ccaps the user already has. Knowledge Base » Using variables in a shortcode

Posted: Wednesday Dec 12th, 2012 at 4:25 pm #34421
Yosuke Hasumi
Username: yosuke

Hey Christian, Thanks for the feedback,
So it looks like nothing is logging in either the paypal-api.log or the paypal-rtn.log Nothing has been logged in either of those since May! Eitherway logging has been enabled but it seems only the paypal-ipn.log is recording anything. This what the full log for that transaction is:

PHP v5.3.5 :: WordPress® v3.4.2 :: s2Member® v121204 :: s2Member® Pro v121204
Memory 32.42 MB :: Real Memory 34.25 MB :: Peak Memory 33.44 MB :: Real Peak Memory 34.25 MB
mysite.org/?s2member_paypal_notify=1
User-Agent: 
array (
  'txn_type' => 'subscr_modify',
  'subscr_id' => 'S-XXXXXXXXXX8433941',
  'last_name' => 'hasumi',
  'option_selection1' => 'S-XXXXXXXXXX705640N',
  'option_selection2' => 'XX.XX.XXX.XX',
  'residence_country' => 'CA',
  'mc_currency' => 'USD',
  'item_name' => 'Testin adoption modification for Gunung,Oscarina',
  'business' => 'mysite_owner@gmail.com',
  'amount3' => '0.02',
  'subscr_effective' => '02:00:00 Nov 23, 2013 PST',
  'recurring' => '0.02',
  'verify_sign' => 'ADXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXFzBOr',
  'payer_status' => 'verified',
  'payer_email' => 'JIM@BOB.com',
  'first_name' => 'JIMBOB',
  'receiver_email' => 'mysite_owner@gmail.com',
  'payer_id' => 'GRQFXXXXXXX',
  'option_name1' => 'Referencing Customer ID',
  'invoice' => 'XXXXXX4dd6ee4a~XX.XX.XXX.XX',
  'option_name2' => 'Customer IP Address',
  'reattempt' => '1',
  'item_number' => '1:gunung,oscarina',
  'subscr_date' => '00:57:56 Dec 11, 2012 PST',
  'custom' => 'mysite.org',
  'charset' => 'windows-1252',
  'notify_version' => '3.7',
  'period3' => '1 M',
  'mc_amount3' => '0.02',
  'ipn_track_id' => 'XXXXX7a11afe6',
  's2member_log' => 
  array (
    0 => 'IPN received on: Tue Dec 11, 2012 8:58:12 am UTC',
    1 => 's2Member POST vars verified through a POST back to PayPal®.',
    2 => 's2Member originating domain ( `$_SERVER["HTTP_HOST"]` ) validated.',
    3 => 's2Member `txn_type` identified as ( `subscr_modify` ).',
    4 => 'Unable to modify Subscription. Could not get the existing User ID from the DB.',
  ),
  'subscr_gateway' => 'paypal',
  'ccaps' => 'gunung,oscarina',
  'level' => '1',
  'ip' => 'XX.XX.XXX.XX',
  'period1' => '0 D',
  'mc_amount1' => '0.00',
  'initial_term' => '0 D',
  'initial' => '0.02',
  'regular' => '0.02',
  'regular_term' => '1 M',
)

Maybe this helps: http://www.primothemes.com/forums/viewtopic.php?f=4&t=10368&p=33365#p33365

As for me not receiving anything in my email from mysite.org regarding my new adoption: It seems reasonable to consider that since the user ID cannot be found in the DB by s2member it cannot find the user email address to send the confirmation link/thank you message to. I’m assuming if i can figure out how to get s2member to recognize the user then the email would probably go out successfully.

You may need to adjust it dynamically based on what ccaps the user already has. Knowledge Base » Using variables in a shortcode

Oh good. I’ve figured this part out. I’ve got a script that finds all the existing ccaps, it then takes the newest desired adoptee and appends it to this list.

So any ideas why the user returns from paypal and s2member can’t recognize them?

Posted: Thursday Dec 13th, 2012 at 6:29 pm #34492

Hmm… Is the user logged into his account when he loads the page with the PayPal button? And does he already have a subscription?

I see you’re using do_shortcode in a PHP block, why? Do you also have this problem if you just use the shortcode in a post/page normally?

Posted: Friday Dec 14th, 2012 at 1:56 pm #34683
Yosuke Hasumi
Username: yosuke

Hey Christian,

Is the user logged into his account when he loads the page with the PayPal button? And does he already have a subscription?

Yup, this is from a backend area that only logged in users can access.

I see you’re using do_shortcode in a PHP block, why? Do you also have this problem if you just use the shortcode in a post/page normally?

The reason I’m using the do_shortcode function is because I’m dynamically outputting two buttons for each of my adoptions. The way this works is:

  1. I find out how many adoptions they have currently (ex. 3 animals @ $10/month)
  2. figure out the ccaps for each (ex. ccaps=”joey,stu,susan”)
  3. find out which animals are NOT adopted (ex. “kirk, mike, alison”)
  4. foreach of the NOT adopted animals output two buttons
    1. add kirk to the list of existing ccaps (ex. ccaps=”joey,stu,susan,kirk”)
      • with the new total monthly price and recurring period set to monthly ($10 x 4 charged monthly)
      • with the new total yearly price and recurring period set to yearly ($120 x 4 charged yearly)
    2. add mike to the list of existing ccaps (ex. ccaps=”joey,stu,susan,mike”)
      • with the new total monthly price and recurring period set to monthly ($10 x 4 charged monthly)
      • with the new total yearly price and recurring period set to yearly ($120 x 4 charged yearly)
    3. add alison to the list of existing ccaps (ex. ccaps=”joey,stu,susan,alison”)
      • with the new total monthly price and recurring period set to monthly ($10 x 4 charged monthly)
      • with the new total yearly price and recurring period set to yearly ($120 x 4 charged yearly)

Now this isn’t the ideal way of handling it for me. If I could find out the current recurring payment period (Yearly or Monthly) I’d prefer not to change it. So if KNEW that they were paying yearly ideally I’d only output yearly paypal buttons. But I don’t think this is possible from the S2Member side since this is a configured setup in paypal at the time of the adoption. Is that right?

Anyway that doesn’t solve the original thread question but it may give you some insight as to why things are the way they are.

Posted: Sunday Dec 16th, 2012 at 8:18 am #34777

Thanks for the explanation.

Well, you could do that without using do_shortcode. Actually, if I’m not mistaken, you could just echo the shortcode and WP will parse it. I know for sure you can echo values for the shortcode attributes with PHP. Knowledge Base » Using variables in a shortcode

figure out the ccaps for each (ex. ccaps=”joey,stu,susan”)

It’s fine if you do this step to find out how many adoptions he’ll have in total to calculate the new subscription amount. You don’t need to add the ccaps he already has to the ccaps attribute, since what you put there will be added to whichever he already has. So if you just have [hilite mono]ccaps="kirk"[/hilite], he’d end up with joey, stu, susan and kirk.


You can try those, but did you test if the modification button works when using the shortcode normally?

Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.