AuthLocalUser signup with Authorize.net

Asked by John Clements

I would like to implement Authorize.net with the AuthLocalUser plugin. I have looked through the code and became lost with all the class calls back and forth. Is there anyone familiar with the code for this plugin that could point me in the right direction where I could add the calls to Authorize.net? I already have the PHP code (like 4 lines) for the verification.

I need to be able to add the form fields for the CCNUM, EXP DATE, etc to the signup form.

I also need to know where AuthLocalUser actually saves the new user to the DB and add an if statement there to check the return stats of the Authorize.net call.

If anyone could give me a push in the right direction, I would greatly appreciate it. Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
AuthPuppy Edit question
Assignee:
No assignee Edit question
Solved by:
gbastien
Solved:
Last query:
Last reply:
Revision history for this message
Best gbastien (gbastien02) said :
#1

For the verification, you might want to create a new validator class like those in lib/validator and add a form "post validator" to the lib/form/apAuthLocalUserSigninForm.php (for examples see the lines $this->mergePostValidator in lib/form/apAuthLocalUserSignupForm.php)

As for ccnum and expdate, do you need to keep them in the database? If so, just add the fields to the table with a migration class (see lib/migration/doctrine for examples) and add them to the $this->useFields(...) in lib/form/apAuthLocalUserSignupForm.php. If not, modify that same form class to manually add those fields.

Any logic upon saving the new user should be added to the model class at lib/model/doctrine/PluginapUser.php in the save() method. Or if you want to keep the verification code all at a same easy to find place, you may also add a validator to the signup form.

Revision history for this message
John Clements (jclements-i) said :
#2

Thanks gbastien, that solved my question.