VirtueMart - 1.1 Developer's Guide

Page of 44
19
Chapter 4. Creating or modifying
Extensions
Besides  core  modules,  you  can  also  add  shipping  and  payment  modules  into  VM.  The  concept  of
both - shipping and payment modules is to provide an API with a defined specification (similar to an
interface), where the modules can plug themselves in. The modules implement the required functions
and thus can communicate with the Shop and give their services.
4.1. Payment Modules
VirtueMart has a lot of predefined payment methods. Some of these payment methods are controlled
by payment modules.
Example:
• Payment Method: “Credit Card”, Payment Module: ps_authorize
Handles credit card authentication with the authrize.net server.
• Payment Method “Cash on delivery”, Payment Module: none (ps_payment is an empty payment
module)
No business logic needed for this kind of payment.
4.1.1. Basics
Virtuemart knows the following general payment method types:
Payment Processor
Asks the Customer for Credit Card Details and processes the
payment  before  the  order  is  placed.  Automatic  Credit  Card
Processors  do  a  server-to-server  communication  before  the
order is placed (e.g. authorize.net AIM)
Credit Card
Just asks the customer for the credit card details. The details
are securely stored in the database for capturing the payment
manually afterwards.
Bank Debit
Asks the customer for his/her bank account details, so you can
get the money from the customer’s bank account afterwards.
Address only/Cash on delivery
No payment processing by the module.
HTML form-based
Transfers the customer to another server where he/she can pay.
This is done after the order has been placed (examples: PayPal,
Worldpay, 2Checkout)
4.1.2. Quick-Create a new payment method
If you have form code for a form-based payment method (most payment providers use this way), you
just need to select "Store" # "Add Payment Method" from the VirtueMart admin drop-down menu.
An empty payment method form opens. Now fill in the details of your payment method like this: