By Weeblr on Wednesday, 21 August 2019
Posted in General Issues
Replies 8
Likes 0
Views 1K
Votes 0
Hi

We are using Payplans Quick registration (Built-in in PP 4.x) and in PP 3.x, we are set to use:

Never send Verification Email and activate account on subscription active

This appears to be possible in PP4 as per the documentation on this page.

However on my install of PP 4.0.11, the Account verification drop-down does not offer all the options found in the documentation:



How can I reproduce in PP4 the behavior we have in PP3?

Best regards
Hey Weebler,

In PayPlans 4.x, we simplifies and improved the subscription process. We removed Never send Verification Email and activate account on subscription active option in PayPlans 4.x. That's why it's not showing in the dropdown.

I am sorry for the inconvenience caused to you. We will correct our documentation also.

Thank you for understanding !
·
Thursday, 22 August 2019 11:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Manisha,

That sure is a simplification but is definitely not an improvement. It's a very bad idea because:

- all new accounts need to be validated
- when a purchase is made, this serves as a validation

It reduces the friction a lot for customers. Now the only option would be to disable validation for ALL accounts creation which of course is not possible, or revert to having paying customers still have to validate their email address - despite the fact we KNOW we have a valid email address as they made a payment.

Now we have to do a custom modification to Payplans 4 to achieve this. Is there an event or something we can hook to after purchase to enable the created account?

Regards
·
Thursday, 22 August 2019 18:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Weeblr,

I got your point why it's important for you. I'll log this into our feature request section and will see how we can do that.

Now we have to do a custom modification to Payplans 4 to achieve this. Is there an event or something we can hook to after purchase to enable the created account?
Regarding this, i'll check it first that how can it achieved and will get back to you on this asap.

Thank you for understanding !
·
Thursday, 22 August 2019 20:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Weeblr,

Sorry for the delayed response due to weekend.

To achieve your requirement to activate account on after payment completion you need to to work on below mentioned file path.
root\administrator\components\com_payplans\includes\registration\abstract.php

For this you need to work on onAfterRoute and onPayplansSubscriptionAfterSave (you need to add this event to catch after payment completion) event. You can take reference from PayPlans 3.x auto registration plugin.

Let me know if you have any query on this,

Thank you for understanding !
·
Monday, 26 August 2019 13:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi

Thanks for the info. I will have to do that, our very first customer after the upgrade to PP4 had that exact problem: did not see the validation email, tried to reset their password and got stuck because Joomla does not let you reset password if account has not been validated.

Can't think of any reason why you'd remove this feature frankly.

Best regards
·
Monday, 09 September 2019 21:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Weeblr,

I am really sorry for the delayed response.

I've logged this into our issue tracker under feature request section and we will consider to add it back in the future.

Thank you for understanding !
·
Tuesday, 10 September 2019 13:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi again,

Looking at this at the moment. Incidentally found a bug in root\administrator\components\com_payplans\includes\registration\abstract.php

At line 553 you use $this->xxxx but the requireUserActivation() is declared as static, so you would get a "Using ^this when not in object context" error.

I have made this code which seems to be doing what it should:


/**
* Force account activation for users who made a successful purchase.
*
* @param $prev
* @param $new
*
* @return bool
*/
public function onPayplansSubscriptionAfterSave($prev, $new)
{
// no need to trigger if previous and current state is same
if (($new->getStatus() == PP_NONE) || ($prev != null && $prev->getStatus() == $new->getStatus())) {
return true;
}

if ($new->isActive()) {
// find current User
$userId = $new->getBuyer()->getId();
$user = User\User::getInstance((int) $userId);
// is user enabled?
if($user->get('block') == 0) {
return true;
}

$user->set('block', '0');
$user->set('activation', '');
if (!$user->save())
{
\JLog::add($user->getError(), \JLog::WARNING, 'jerror');

return false;
}
}

return true;
}


Now questions:

1 - Any comments? things I should take into account?
2 - "you need to to work on below mentioned file path." Why? this looks like a user registration management class, I don't want to interfere with registration. Just enable the user on successful payment
3 - "onAfterRoute": same: why do anything at onAfterRouter?

Thanks
·
Tuesday, 10 September 2019 23:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Weeblr,

At line 553 you use $this->xxxx but the requireUserActivation() is declared as static, so you would get a "Using ^this when not in object context" error.
Thank you reporting this, actually we are not using this function anywhere in PayPlans. I'll fix it in upcoming release.


1 - Any comments? things I should take into account?

Do you mean regardint the function you add, if yes then it seems fine to me. If i misunderstood then correct me.

2 - "you need to to work on below mentioned file path." Why? this looks like a user registration management class, I don't want to interfere with registration. Just enable the user on successful payment
3 - "onAfterRoute": same: why do anything at onAfterRouter?

I shared this function as per pp3.x code which is used for that function. Well as you just need to activate the user on subscription activation then no need to work on these events.

Let me know if you have any query or correct me if i misunderstood.

Thank you for understanding !
·
Wednesday, 11 September 2019 12:19
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post