JoomlaVM

  • Increase font size
  • Default font size
  • Decrease font size
Home Virtuemart development How to develop a payment module for virtuemart

How to develop a payment module for virtuemart

   The following is a list of all methods that must be implemented in a payment module's class file.

string show_configuration( void )
Shows the configuration form for this payment module in the payment method form.
boolean has_configuration( void )
returns true if the payment module can be configured, false if not
boolean configfile_writeable( void )
returns true if the configuration file for that payment module is writeable, false if not
boolean configfile_readable( void )
returns true if the configuration file for that payment module is readable, false if not
void write_configuration( Array )
stores all configuration values for this payment module in the configuration file.
boolean process_payment(String $order_number, Float $order_total, Array &$d)
This is the main function for all payment modules that use direct connections to a payment gateway (like authorize.net or eWay XML). This is the place, where the payment details are validated and captured on success. Returns true on sucess, false on failure.
float get_payment_rate(Float $subtotal)
This is the function to calculate the fee / discount for this special payment module (so you can calculate a fee, depending on the order total amount).

If you are about to change the Name of Configuration Variables: don't forget to change it in both functions: show_configuration and write_configuration!

Examples
Credit Card Processor: Authorize.net
This example shows the payment processing class for authorize.net. It demonstrates how to show a configuration form, save the configuration and process the payment over the internet.

Authorize.net Payment Class

HTML Form-based: PayPal
This example shows the payment class for PayPal. PayPal processes the transaction on its own sites and sends a notification to the shop about the status of the payment.


That’s why an additional file is needed to receive this notification: Invalid link [notifiy.php]. It’s an implementation for PayPal’s IPN (Instant Payment Notification).

Here's a link to the latest version of the Invalid link [PayPal Payment Class].

 

VirtueMart Shopping Cart

VirtueMart
Your Cart is currently empty.

Newsletter


Newsflash

Virtuemart Upload Component

Upload Images and Files with your order in Virtuemart - VMUpload is a versatile plugin to the core application Virtuemart that allows for a customer to upload files to their order based on parameters established by the site administrator. it include a Joomla component and a Virtuemart patch.

Feature Summary

Font-end:

  • Upload and bind the files to a order
  • Ability to add more upload fields as needed
  • Secure client folder created as upload destination (folder name defined by username)
  • Create the thumbnail image automatically if the uploaded file is picture
  • Integrate with an image gallery for photos, show upload picture with lightbox
  • CSS friendly coding; Multi-language compatible (English native)

Back-end:

  • Check the uploaded files based on client orders
  • Download uploaded files from orders
  • Config number of maximum Files to upload
  • Config Maximum files size
  • Config upload file folder
  • Choice of acceptable file types
  • Creation of thumbnail image to defined size
  • Manage the uploaded files