Using Payment Form extension
- Details
- Category: Using Extensions
- Published on 02 June 2010
- Written by Tuan Pham Ngoc
- Hits: 13242
Configuration
When you first install Payment Form, the extension auto populate default configuration data. Please go to Payment Form -> Configuration to review and change config parameters if needed . Here are some important config parameters :
- Integration (General tab) : If user logged in when accessing to the form, some basic data (first name, last name, address....) can be get from his profile and auto populate on the form so that they don't have to type it again . So If you are using Community Builder on your site, set this config option to Community Builder . If you are using JomSocial, set it to JomSocial . Otherwise , set this config option to None .
- Notification emails (General tab) : The emails which receive notification when someone make payment on your site. You can use multiple emails, each email need to be seperated by comma character , for example : This email address is being protected from spambots. You need JavaScript enabled to view it. , This email address is being protected from spambots. You need JavaScript enabled to view it. .
- Payment methods (General tab) : Choose the payment methods you want to use on your site . If there are more than one methods selected, users can choose the payment method they want to use when processing payment through the form.
- Payment tab : Allow you to change merchant account of the payment gateway you want to use : Paypal ID (Paypal), API Login and Transaction key (Authorize.net) .....
- Fields tab : Allows you to choose to Show / Hide , Require / Not require any fields (First name, last name, address,...) on the form .
- Fields mapping tab : You only need to change config options on this tab if you are using CB or JomSocial on your site. You will need to enter Field name (in CB) or Field Code (in JomSocial) which are mapped to these fields. For example, If you enter cb_firstname into First name textbox , when a user logged in and access to the form, the data stored in his profile from field cb_firstname will be auto filled in to First name field on the form so that he doesn't have to enter it again . The same for other fields (last name, address, city....) .
Creating and managing forms
To create a new form, go to Payment Form -> Forms managment, press New button on the toolbar . Below are some fields which you should understand when creating a new form :
- Amount : That is the amount users need to pay when processing payment via the form .
- Enable enter payment amount : If you set this to Yes , users will be able to enter the amount they want to pay when processing payment. Please note that If you set this to Yes , the amount you set on Amount field will have no effect at all.
Creating and managing custom fields
By default, when you create new form, the form will only contains basic fields : first name, last name, address...... If you want to add more fields to the form, you will have to create custom fields. The extension support following custom fields type : Textbox , Textarea, Dropdown, Checkbox list, Radio List, Date Time, Heading, Message , MultiSelect. To create a new custom field, go to Payment Form-> Fields management and press New button. Below are some important parameters when creating new custom field. The most difficult thing in fields management is Fee Field , so we will go to next part of document .
How to insert a form into Joomla(TM) article
To insert a form into Joomla(TM) article , you need to do the following steps :
- Make sure you have installed and published the Payment Form Plugin . Please look at this article for more information .
- Open the article you want to insert the form, enter this syntaxt {pmform FORM_ID}, FORM_ID is id of the form you want to display in the article . For example, {pmform 2} will display form with ID = 2 in the article .
How to use Fee Field feature in Payment Form
Fee field is one of great feature in Payment Form. It allows you to change payment amount which users have to pay for when processing the form base on what they choose / enter on the form. The fee field feature only works with the following custom fields types : Dropdown, Checkbox List, Radio List and MultiSelect and Textbox . I will give few examples to explain how it works, so you will understand .
Radio List Custom Field Type
- Let says you are creating a form which allow members to choose membership type on your site. So you create a custom field with following parameters : (See screenshot)
- Values : Basic Member (Free), Silver Member (+10$), Gold Member (+20$) . Each item in one line .
- Default Values : Silver Member (+10$) .
- Fee Values : 0, 10, 20 . Each item in one line .
- Type : Radio List .
- Fee Field: must be set to Yes.
- In the front-end , the system will display a radio custom field with 3 options : Basic Member (Free), Silver Member (+10$), Gold Member (+20$) . (See screenshoot)
- If users choose Basic Member , they won't have to pay any additional fee . If they choose Silver Member option, they will have to pay additional 10$ . If they choose Gold Member option, they will have to pay additional 20$.
- Please note the corresponding between Values options and Fee Values option . Basic Member (Free) mapped To 0 . Silver Member (+10$) mapped to 10. Gold Member mapped to 20.
Checkbox List Custom Field Type
- Let says you are creating a form which allow members to attend to a Joomla(TM) Day event. Users can choose to have lunch, get a Joomla(TM) T-shirt at the end of event (they will have to pay for what they choose) . So you create a custom field with following parameters : (See screenshot)
- Values : Have Lunch(+50$), Get T-shirt (+10$) . Each item in one line .
- Default Values : Leave it empty .
- Fee Values : 50, 10 . Each item in one line .
- Type : Checkbox list
- Fee Field : must be set to Yes .
- In the front-end , the system will display a checkbox custom field with 2 options : Have Lunch(+50$), Get T-shirt (+10$). See screenshoot
- If users check on Have Lunch (+50$) checkbox , they will have to pay additional 50$ . If they check on Get T-shirt (+10$) checkbox, they will have to pay additional 10$. If they check on both the checkboxes, they will have to pay additional 60$ (50$ + 10$) .
- Please note the corresponding between Values options and Fee Values option . Have Lunch(+50$) mapped To 50 . mapped to 10. Get T-shirt (+10$) mapped to 10.
MultiSelect list Custom Field Type :
This custom field works in the same way with Checkbox List Custom Field . So I won't explain it again .
Textbox Custom Field Type :
- Let says you are creating a form which allow members to purchase product on your site. Price for product is 10$ .So you create a custom field called quality with following parameters: (See screenshot)
- Type : Textbox .
- Fee Field: must be set to Yes .
- Fee Formula : [FORM_AMOUNT]*[FIELD_VALUE]
- You can use math operators : +, - , *, / to form the formula .
- In the front-end , the system will display a textbox which allows users to enter quality they want to purchase. (See screenshoot)
- If they enter 2 into quality textbox, the fee they will have to pay is 2*10 = 20$ . If they enter 3, they will have to 3*10 = 30$ and so-on.
- You can use other custom fields in the form in Fee Formula. The syntax of using a custom field in fee formula is [PF_NAME_OF_CUSTOM_FIELD] (the name of custom field in upper case, surround by [ and ] character. When you use [PF_NAME_OF_CUSTOM_FIELD] in the formula, it will have different value depend on the field type :
- If pf_name_of_custom_field is a textbox custom field, [PF_NAME_OF_CUSTOM_FIELD] will have the value of the value users entered in the textbox.
- If pf_name_of_custom_field is a radio list custom field, [PF_NAME_OF_CUSTOM_FIELD] will have the value of the fee value associated with the option users selected.
- If pf_name_of_custom_field is a checkbox list custom field, [PF_NAME_OF_CUSTOM_FIELD] will have the value of total fee values associated with the options user selected.
Note : TOTAL AMOUNT USER HAVE TO PAY = FORM AMOUNT (the amount you set it Amount attribute or the amount users enter on amount textbox - if you set enable enter amount to Yes) + SUM OF ALL FEE FIELDS. Also, the fee associated with the fee field only be added to Total Amount if Fee Field attribute of that field set it Yes.