Authorize.net: Review order before capture the card feature

Authorize.net: Review order before capture the card feature

by Ethem Evlice -
Number of replies: 21

Hello all,

I am author of authorize.net plugin. I am going to to improve authorize module. A new feature called "review order" will be added soon. In this feature a admin or teacher can review order before capture the credit card. In this mode, the credit card will be authorized but not will be captured. After that, admin or teacher can accept/deny payment in administration panel. If he won't do that, trancaction will be cancelled within 30 days.  I am going to add new feature called "autocapture" to prevent cancelling payment. If you enabled autocapture and you enter $CFG->review_day (like 10), cron will be captured the credit card after 10 days and will notified admin & teachers. In this mode cron must be enabled.

Sounds looks like nice, but I have a problem. I have a test account at authorize.net. In test account, authorize.net always sends x_trans_id=0 to me. This is problem, because you cannot post authorization (means accept payment) in test mode. The system needs x_trans_id must be greater than "0". To do that, your authorize.net account must be real, not test account. After you turned on your account to the real mode, I will send 1$ to your account, and the system give me a real x_trans_id value greater than "0". After do that, I will send test transactions with this value to test accept/deny payments. In test mode, accept/deny payments are not real, but it will give me real response code to test the system. I mean, if you have an real (not test) authorize.net account, I will send 1$ to your account, but before, I need your account loginname and trans_key to test system. You know, I cannot login to your account with these values. I don't want your password, I need only loginname & transkey. I want to improve moodle with new features, but I don't have a real account at authorize. If you have a real account, please let me run test transactions with your account.  After you do that, I will test new features and you will able to use new features in moodle.

Please contact me at "ethem .AT. evlice .DOT. com", if you have a real account.

NOTE: After my all test are completed, in real mode I will send 1$ to your account, I promise smile.

Sorry for my poor english. Please write simple words to me if you decide to email me smile

Average of ratings: -
In reply to Ethem Evlice

New authorize.net module is more powerful. :)

by Ethem Evlice -

New authorize.net module is more powerful. smile

- Review order:

   Review order before processing the credit card.

- Auto-Capture:
   If auto-capture enabled the credit card will be captured
   after an_review_day later, then student will be enrolled
   to course, otherwise it will be expired or
   admin must accept/deny payment.

   NOTE: Set-up Transaction Cut-Off Time correctly.
         When the last transaction is picked up for settlement?

- Payment Management:

   Accept/Deny/Refund payments: cvs:/moodle/enrol/authorize/index.php

- TO DO: Batch upload: It will sync authorize.net and moodle from csv file.

Thanks to Shamaila, a mother from Pakistan who have 2 boys, smile for sharing her authorize.net account with me. Allah Hafiz.

Attachment sample.gif
In reply to Ethem Evlice

Re: New authorize.net module is more powerful. :)

by Michael Shaffer -

I'm sorry...how do we download and install this new version?

I don't see an index.php under /moodle/enroll/authorize???

Thank you,

Mike Shaffer

In reply to Michael Shaffer

Re: New authorize.net module is more powerful. :)

by M Johns -

I also am interested in installing the new version as well,  but I think the original post implies that it isn't released yet and is still part of the CVS.

Can someone confirm this?
In reply to M Johns

Ynt: Re: New authorize.net module is more powerful. :)

by Ethem Evlice -

Thats true. It is still part of the CVS.

Moodle 1.6 will be released on February and you will able to use new features in 1.6.

If you don't want to wait, you can test new features. Do not use for production sites please.

Latest Development Nightly (Moodle 1.6devsmile

 http://download.moodle.org/

In reply to Ethem Evlice

Re: Ynt: Re: New authorize.net module is more powerful. :)

by M Johns -

I'm now testing Authorize.net on beta site (version 1.5.3), and I'm not sure how to interpret this error message:

(TESTMODE) Bill To Address is required.

Where does Authorize.net capture the user billing information? Do I need to edit this form to include billing address information? If so, where is this page to change this?

Authorize.net form












I would gladly give access to help beta test this. I have a presentation on this tool in about two weeks and I'm having a deuce of a time getting it to work because I don't understand what's happening on the backend. Is there any documentation any where? For example in the Authorize.net enrolment configuration file it asks for a referrer page? What is this supposed to be? Doesn't Authorize.net require the referrer page to be registered with their services? Does the referrer page have to include an https url?
In reply to M Johns

Ynt: Re: Ynt: Re: New authorize.net module is more powerful. :)

by Ethem Evlice -

Update your profile.

You will see a textbox at the bottom of page called Address.

In reply to Ethem Evlice

Re: Ynt: Re: Ynt: Re: New authorize.net module is more powerful. :)

by M Johns -
The very last field on the profile page asks for an address.  To date, I have this filled in completely to include the street, city, state and zip code.

Perhaps I am somewhat confused, but the sample I posted was done after several moments of frustration with filling out the address field with various sequences of information.  I'm asked to supply the Bill to State, or the Bill to Address as part of the error messages received when I've completed - fully the address field on the profile page depending on how I've entered the information.
In reply to M Johns

Re: New authorize.net module is more powerful. :)

by Ethem Evlice -

You must only enter street for address. You can see you able to update city, country etc in your profile.

Anyway, I think you activated AVS. I have implemented new feature for AVS. Please download latest stable 1.5.3+, 12 hours later.

Go to >> Admin >> Enrolments >> Authorize >> AVS

Check this if you have activated Address Verification System (AVS) in your authorize.net account. This demands address fields like street, state, country and zip when user fills out payment form.

In reply to Ethem Evlice

Re: New authorize.net module is more powerful. :)

by M Johns -
Okay, I'm setting up a new testing environment using moodle cvs.  I'll download the latest version and check for AVS.  Thanks for getting back to me.
~m
In reply to Ethem Evlice

Ynt: New authorize.net module is more powerful. :)

by Ethem Evlice -

Now, there is an option called 'Teachers can manage payments'.

In this mode, course teachers can manage pending payments if admin setup this in authorize.net configuration page.

In reply to Ethem Evlice

Re: Authorize.net: Review order before capture the card feature

by Nithyasatya Ananda -
Hi,

The zip code field in the payment form does not seem to accept alpha-numeric zip codes. Canadian zip codes are alpha-numeric. As a result, people are not able to make a payment whose credit card billing address is a canadian address.

Do I need to do something to fix this issue or am I missing something here...
In reply to Nithyasatya Ananda

Ynt: Re: Authorize.net: Review order before capture the card feature

by Ethem Evlice -
Thanks for the reporting.
Fixed in HEAD, 1.9 and 1.8.
In reply to Ethem Evlice

Authorize.net: Review order before capture the card feature

by J Rogers -
Ethem,

Thanks for making a great module. I was wondering if you could detail the settings for completely automatic transaction capturing?

Also, how does the system send emails to the admin? I don't seem to be getting notices from your enrolment plugin.

Thanks,
Jeremy
In reply to J Rogers

Re: Authorize.net: Review order before capture the card feature

by J Rogers -
Another quesiton related to capture:

I want both immediate capture and authorization, and allow purchasers to go immediately to the website. How do I do this?

Here are the related settings and my setup:

an_review is UNCHECKED
an_capture_day is 1 (since 0 means scheduled-capture is disabled)

(may not be as importantsmile
an_emailexpired is 5
enrol_mailadmins is CHECKED

Perhaps my confusion would be alleviated by some clarification in the settings descriptions.

an_capture_day
" Capture the credit card automatically unless a teacher or administrator review the order within 1 days. CRON MUST BE ENABLED."

Does this mean that "the admin has 1 day to review the order before it gets sent automatically to authorize.net for processing?"

an_capture_day (cont'd)
"(0 day means it will disable scheduled-capture, also means teacher or admin review order manually. Transaction will be cancelled if you disable scheduled-capture or unless you review it within 30 days.)"

OK, so if "1" in an_capture_day is interpreted to mean there is a review period of one day, and "0" is interpreted to mean scheduled-capture is disabled, does that mean there is no way to do "immediate"-capture (a 0-day review period)? Personally I would like to see these values be used: -1 for disabling scheduled-capture, 0 for immediate capture, and 1-29 the number of days to wait before capture. Would this be possible?

The second sentence seems to imply that the transaction will be cancelled if I disable scheduled-capture, but isn't that what I would be doing if I used "0" in the an_capture_day field?

Can anyone clarify the distinctions here?


One final question: Even though I have an_capture_day set as 1, when I run cron.php, the logfile says this:
Processing authorize cron...
 scheduled capture: disabled
Did I miss a configuration step, or is this the expected behavior?


Thanks for your help,
Jeremy

In reply to J Rogers

Ynt: Re: Authorize.net: Review order before capture the card feature

by Ethem Evlice -
Hi,

an_review UNCHECKED equals = "I want both immediate capture and authorization, and allow purchasers to go immediately to the website."

If you tick an_review then the credit card is be authorized but not be captured. To capture, go to Payment management (under course admin menu). OR set-up scheduled-capture (for ex: an_capture_day=6)
0: Disable. The admin must be capture at paymant page manually or the the transaction will be cancelled 30 days later.
6: the admin has 6 days to review the order before it gets sent automatically to authorize.net for processing. If he doesn't review with in 6 days, scheduled-capture is captured automatically at 6nd days.
That's all..

The cron log shows "scheduled capture: disabled" because you didn't checked an_review.

Sorry my poor english. I think you understand my explains. If you add some documantation here for this, I can add to your commentary to the translation.
In reply to Ethem Evlice

Re: Ynt: Re: Authorize.net: Review order before capture the card feature

by J Rogers -
Ethem,

I've been playing around with Google Analytics, and trying to get the eCommerce tracking to work with the authorize.net plugin you've created.

GA's help section has a page titled "How do I track e-commerce transactions?" which gives the steps to enable it.

Here's what I came up with, I will place it right before the line that says "// Credit Card captured, ENROL student now..." in the enrol.php:

 echo >>>END
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
 var pageTracker = _gat._getTracker("UA-XXXXX-1"); //put your code # here
END;
 echo 'pageTracker._addTrans("'.$order->id.'","'.$order->transid.'","'.$order->amount.'","0","0","'.$extra->x_cccity.'","'.
 $extra->x_ccstate.'","'.$extra->x_cccountry.'");';
 
 echo 'pageTracker._addItem("'.$order->id.'","Course","'.$course->fullname.'","","'.get_course_cost($course).'","1");';
 echo 'pageTracker._trackTrans();';
 echo '</script>';

Some explanatory comments / notes:

 /* useful variables:
 $order->id
 $order->transid
 $order->amount
 $course->fullname
 $extra->x_cccity
 $extra->x_ccstate
 $extra->x_cccountry
 get_course_cost($course) 
 */
/* _addTrans arguments:
 "1234", // Order ID
 "Mountain View", // Affiliation
 "11.99", // Total
 "1.29", // Tax
 "5", // Shipping
 "San Jose", // City
 "California", // State
 "USA" // Country
 );*/
/* _addItem arguments: 
 "1234", // Order ID
 "DD44", // SKU
 "T-Shirt", // Product Name 
 "Green Medium", // Category
 "11.99", // Price
 "1" // Quantity
 );*/

My concern is: this works for immediately captured credit card transactions, but it won't track the ones taken captured manually or with the cron function. Where can I put this code to cover all capture scenarios?

Thank you, -J

Also, feel free to use this code if it helps you improve the authorize.net. enrolment plugin to support Google Analytics.


                                    
In reply to J Rogers

Ynt: Re: Ynt: Re: Authorize.net: Review order before capture the card feature

by Ethem Evlice -
Hi Rogers,

If you want to track all captures look at authorizenet.class.php:
line 303-304, before break.
 AN_ACTION_AUTH_ONLY:
  AN_ACTION_CAPTURE_ONLY:
  AN_ACTION_AUTH_CAPTURE:
  AN_ACTION_PRIOR_AUTH_CAPTURE:
 


to track all refunds: line 317-318
 AN_ACTION_CREDIT:
 


to track all cancels: line: 331-332
 AN_ACTION_VOID:

 


to track all transtactions (auth/capture/refund/void): line: 333-334
 AN_ACTION_VOID:
 
  = ;
  >status == AN_STATUS_CREDIT 
  = ;
 >paymentmethod;
 
 >status = AN_STATUS_VOID;
   >update_record,  
 message_to_admin, ;
 
 
 ;

 
**************


------------
  = 0;
   == AN_APPROVED ||  == AN_REVIEW   = 6;
   ||  == 0   ;   

In reply to Ethem Evlice

Re: Ynt: Re: Ynt: Re: Authorize.net: Review order before capture the card feature

by Jonas Clark -
Hello: where do I find this plugin for moodle?
In reply to Jonas Clark

Re: Ynt: Re: Ynt: Re: Authorize.net: Review order before capture the card feature

by Jonas Clark -
Hello:

Even though my authorizenet payment is set to:

an_review: unchecked Help with Order Review (new window)
Review order before processing the credit card.
an_capture_day: 5 Help with Scheduled-Capture Day (new window)


When a student from Singapore tried to enroll, the report I got back was that it was in "testing." As a result the student kept trying until he finally gave up.

What does this "testing" mean and how/where can I change that.

BTW. an_test is unchecked.

Thanks,

Brian
In reply to Ethem Evlice

Re: Authorize.net: Review order before capture the card feature

by Jason King -

Hello Ethem,

This comment really does not go with this post, but since I found out you were the author of the authroize.net plugin, I thought I would post this to you.

in the prevent_double_paid function of localfuncs.php, why are you checking to see if $SESSION->ccpaid is set and if so, logging the user out?

I have a situation where a user may enrol in a course and then go back to the course list and enrol in a second course.  This code is making them logout before enroling into the second course.

Before I made any modifications, I wanted to fully understand the reasoning behind the logout.  Do they have to logout or can I just unset $SESSION->ccpaid?

Thanks for your help.

Jason

In reply to Jason King

Re: Authorize.net: Review order before capture the card feature

by Navjot Singh -

Hi All

can anybody provide be documentation for how to implement authorize payment gateway in moodle 1.9 when i click on edit i get no parameters to edit. Need urgent help

payment gateway

Thanks,
Navjot

Attachment payment1.JPG