Home › Forums › Community Forum › How to get the EOT in a s2member php script ?
This topic contains 13 replies, has 3 voices. Last updated by Raam Dev 4 years, 8 months ago.
Topic Author | Topic |
---|---|
Posted: Tuesday Apr 17th, 2012 at 10:21 am #11000 | |
|
|
Hello, I need to get the EOT date value in a php script called by the s2member script paypal-checkout-in.inc.php. Is there a kind of global User array containing that value ? The get_user_field (“s2member_auto_eot_time”) method (who works fine in a wordpress page) doesn’t work in the paypal-checkout-in.inc.php script. Any idea ? Sincerely
|
List Of Topic Replies
Author | Replies |
---|---|
Author | Replies |
Posted: Wednesday Apr 18th, 2012 at 4:27 am #11081 | |
|
|
I’m not sure I understand this. Could you explain a bit more, please? Does the user have an EOT time in his profile? The EOT time field could be empty too.
|
|
Posted: Wednesday Apr 18th, 2012 at 9:00 am #11107 | |
|
|
Thank you for your answer. Yes the user is logged, he has a current subscription and he has a EOT time field filled with a date. When I use the get_user_field (“s2member_auto_eot_time”) method in a wordpress page (using php tags) it works well but when I use it in a paypal module php script I’m not able to get the value (but no error)). Do I have to put a require() or include() to have access to the the get_user_field() method ? I use the instruction below and the shown result is “No value for eot”: if ($s2member_auto_eot_time = get_user_field (“s2member_auto_eot_time”) ) |
|
Posted: Thursday Apr 19th, 2012 at 12:16 am #11189 | |
|
|
When you say “a paypal module php script”, then you’re talking about a script ouside WordPress, right? Well, then you’ll not have the get_user_field function available to you if it’s not defined in your script. That’s a function s2Member adds, and that happens in WordPress. You’d either have to include WP to your script or query the WP db directly from your script. I hope that helps. :) |
|
Posted: Thursday Apr 19th, 2012 at 4:51 am #11207 | |
|
|
Thank you for your answer. When you say “to include WP to your script” do you think of an include() instruction ? How to use the wp api outside of wordpress scripts ? Sincerely |
|
Posted: Saturday Apr 21st, 2012 at 7:08 am #11489 | |
|
|
Something like this: http://www.primothemes.com/forums/viewtopic.php?f=4&t=3145&p=9683#p9683 |
|
Posted: Monday Apr 23rd, 2012 at 11:33 am #11604 | |
|
|
Hello, Thank you for your answer. I still get an empty value for $eot = get_user_field (“s2member_auto_eot_time”) But I think I’m taking a too complex way for my purpose because I simply need to catch a post paid event and acquire the new automatically calculated End Of Term value. I guess I’m not the first needing that… I think the API “Payment notifications” could be the best solution for me, but in the availables variables in the [s2Member > API / Notifications > Payment Notifications] section I don’t see any %%EOT%% variable. How to get that value ? Sincerely |
|
Posted: Monday Apr 23rd, 2012 at 1:52 pm #11623 | |
![]() |
|
Hello, s2Member does not calculate or set the Automatic EOT time for subscriptions upon payment. For subscriptions, s2Member will wait until it receives an IPN message from the payment gateway indicating that an EOT has occurred and only then will it calculate and set the Automatic EOT time. If you’re using Buy Now transactions and not Subscriptions, then yes, s2Member will calculate and set the Automatic EOT time. Can you tell us which one you’re using? |
|
Posted: Tuesday Apr 24th, 2012 at 2:49 am #11658 | |
|
|
I think we are using the subscription method because the IPN configuration has been made and Then I guess I need a trigger when coming back from paypal, when the new EOT has been calculated ? |
|
Posted: Tuesday Apr 24th, 2012 at 2:52 pm #11727 | |
![]() |
|
The EOT time will not be calculated upon return from PayPal after making a payment. For subscriptions, it’s only calculated when the subscription ends. So let’s say you have someone sign up for a recurring monthly subscription. There will be no Automatic EOT time recored by s2Member at this time. Let’s say after 5 months, the user cancels their PayPal subscription. s2Member will then receive an IPN message from PayPal and calculate the Automatic EOT time. As long as their recurring subscription is active, s2Member will not calculate an Automatic EOT time. |
|
Posted: Wednesday Apr 25th, 2012 at 4:07 am #11808 | |
|
|
Hello, Thank you for your answer. We don’t allow recurrent payment. Currently I get the EOT value directly from the database when the payment is done, adding personal code in the “paypal-checkout-in.inc.php” script. I use the table “wp_usermeta”, column “meta_key” with value “wp_s2member_auto_eot_time” for the current user_id and it works fine. To be safe beside s2member future upgrades I would like to get this value without going directly to the database. I plan also to replace that code insertion (in “paypal-checkout-in.inc.php”) by an API Notification in the future, but I didn’t see any %%eot%% variable available in the documentation. How to acquire the post-paid EOT time using the API Notification standard s2member mecanism ? Sincerely, |
|
Posted: Wednesday Apr 25th, 2012 at 9:55 pm #11882 | |
![]() |
|
Hi Guillaume, The EOT Time is not an available variable when using the API Notification. We recommend obtaining the value from the database as you’re currently doing. |
|
Posted: Thursday Apr 26th, 2012 at 11:45 am #11952 | |
|
|
Hi Raam, Thank you for the answer, I’m happy to know I did well… Do you plan to add the %%eot%% variable in the futur or is there an impossibility or a contradiction to give it by the API ? If you plan to add it I’ll be back in a few months… Regards, |
|
Posted: Thursday Apr 26th, 2012 at 7:25 pm #12001 | |
![]() |
|
Hi Guillaume, That’s certainly a possibility and we will consider making it available in the next major release of s2Member. |
This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.