Accounts Online
Accounts Online
User Management
Invoices & receipts
Custom Order Forms
Custom Fields
Protected Directories
Auto Accounts
API Functions
Handling Taxes
Shipping&Handling
|
Using custom order forms you can easily integrate Accounts Online into your business process using
custom order templates. In this mode Accounts Online scripts serve as a middleman between a form and your custom script,
which handles the form. Template is an html page, which contains a form to submit new account data. Being submitted the
form activates proper script from Accounts Online package, which registers new account (or validates an existing one),
posts an invoice and adds a subscription if necessary, then it passes control to your custom script preserving all the
form's fields. If Accounts Online is unable to create new account, it will reload template preserving field values and
will display error message (e.g. missing required field, duplicate account id).
Here are the steps, required to configure custom form.
1. Create custom form template. The template is an html page, with one or more <form> tags.
Here is a sample code for a form, used to subscribe a customer with existing account to product "wktrial".
<font color="red"><b>*ERRORMESSAGE*</b></font><br><br>
<form method="POST" action="*CGIURL*">
<input type="hidden" name="cmd" value="subscribe">
<input type="hidden" name="prodid" value="wktrial">
<input type="hidden" name="template" value="subscribe.html">
<input type="hidden" name="confirmurl" value= "http://www.eastwright.com/internet/accnts/demo/welcome.pl">
Account ID: <input type="text" name="accid" size="10" value="*ACCID*"><br>
Password: <input type="password" name="passwd" size="25"><br>
Brand of your monitor: <input type="text" name="customarg1" size="25" value="*CUSTOMARG1*"><br>
Brand of your car: <input type="text" name="customarg2" size="25" value="*CUSTOMARG2*"><br>
<input type="submit" value="Subscribe Now!">
</form>
Notes:
1. The very first line is a placeholder for error messages, generated by Accounts Online (the *ERRORMESSAGE* tag will be
replaced with a text of error message, if any).
2. *CGIURL* is a placeholder for script url
3. form field "cmd" is reserved for Accounts Online, you can use either "subscribe" to subscribe existing user (that is the one, which already has an account registered with Accounts Online), or "subscribenew" to subscribe new user
4. form field "prodid" is reserved for Accounts Online, it keeps a product id, the one you define using Product Manager (Admin Panel)
5. form field "template" is reserved for Accounts Online, it keeps filename of the custom form template.
6. form field "confirmurl" is reserved for Accounts Online, it keeps url of custom script to be activated after invoice posted to customer's account
7. form field "accid" is reserved for Accounts Online, use it to obtain customer id
8. form field "passwd" is reserved for Accounts Online, use it to obtain customer password
9. You can use any custom fields, their content will be passed to your custom script. But only values of text fields with names "customargX" (where X - is any single character) could be restored on custom form reloads.
The above form is being used to validate existing accounts. To create new account you should use "subscribenew" value
for "cmd" field. This command will try to create new account using account data submitted. To initiate account fields please use
the following fields:
Name | Description | Required | Tag |
accid | User ID (login) | Yes | *ACCID* |
name | First name | No | *NAME* |
lname | Last name | No | *LNAME* |
street | Street address | No | *STREET* |
city | City | No | *CITY* |
state | State | No | *STATE* |
zip | ZIP | No | *ZIP* |
country | Country | No | *COUNTRY* |
country | Country | No | *SELCOUNTRY*4 |
notes | Notes | No | *COUNTRY* |
cctype | Credit card type | No | *CARDBOX*1 |
ccnumber | Credit card number | No | *CCNUMBER* |
ccvalid | Credit card exp date | No | *CCVALID* |
ccissue | Credit card CVV/issue number | No | *CCISSUE* |
ccname | Name on card | No | *CCNAME* |
ccstreet | Street address, as per bank statement | No | *CCSTREET* |
cccity | City, as per bank statement | No | *CCCITY* |
ccstate | State, as per bank statement | No | *CCSTATE* |
cczip | ZIP, as per bank statement | No | *CCZIP* |
cccountry | Country, as per bank statement | No | *CCCOUNTRY* |
phone | Phone number | No | *PHONE* |
bizphone | Business phone number | No | *BIZPHONE* |
fax | Fax number | No | *FAX* |
email | Email address | No | *EMAIL* |
customN2 | custom field | No | *CUSTOMN*2 |
gst | Sales tax code | No | *GST*, *GSTBOX*3 |
vat | VAT code | No | *VAT*, *VATBOX*3 |
cuspasswd | customer password | Yes | |
cuspasswd1 | customer password (re-entered for verification) | Yes | |
Notes:
1 - the *CARDBOX* macro will generate complete html <select> tag using credit card
types list as per System Setup form.
2 - N is a number in the range 0-9. The custom0-custom9 inputs convey values to be stored in
customer account record,
3 - *GSTBOX* and *VATBOX* macros will generate complete html <input type=checkbox ...> tags
4 - the *SELCOUNTRY* macro will generate complete html <select> using countries
list as defined via country editor (Shipping & Handling menu).
2. Store the form template at your basedir/tmpl directory, where basedir is Base Directory set via Admin Panel (System Setup command).
3. Use the following url to activate you custom script: url-to-accview.pl?cmd=loadtmpl&template=subscribe.html (we assume, that subscribe.html is the name of your template file)
Security considerations:
It is possible to call custom script (as per "confirmurl" field) directly by typing its url with parameters
necessary right into address string of web browser. In order to prevent you site from such an abuse there is additional
parameter "pincode" which generated by Accounts Online and passed to your custom script. The value of pincode produced
by applying crypt Perl function to concatenation of accid and pin, as set by your system administrator using Admin Panel
(System Setup menu). You need to hardcode this pin value into your custom script and each time it is invoked generate
pincode and compare it against the one, you received as an input.
Please review the following sample files in your package for more details:
subscribe.html - sample custom form for subscription of existing user
regsubscribe.html - sample custom form for subscription of new user
welcome.pl - sample custom script
|