For more information... RTFM!

You are not logged in

Powered by Interchange version 5.7.0


Interchange's support for the NetBilling Link to an external page Payment Services Provider.


&charge = netbilling


[charge route="netbilling" param1="value1" param2="value2"]


  • LWP::UserAgent
  • LWP::Protocol::https
  • Digest::MD5


The Vend::Payment::NetBilling module implements the netbilling() subroutine for use with Interchange.  It is compatible on a call level with the other Interchange payment modules.  In theory (and even usually in practise) you could switch from another payment module to NetBilling with a few configuration file changes.

To enable this module, place this directive in your "interchange.cfg" file:

Require  module  Vend::Payment::NetBilling

This must be in interchange.cfg or a file included from it.

Make sure CreditCardAuto is off, which is the default in the Standard ecommerce demo.

The "mode" can be named anything, but the "gateway" parameter must be set to "netbilling".  To make it the default payment gateway for all credit card transactions in a specific website, you can set the following in catalog.cfg:

Variable  MV_PAYMENT_MODE  netbilling

It uses several of the standard settings from Interchange payment.  Any time we speak of a setting, it is obtained either first from the tag/call options, then from an Interchange order Route named after the mode, then finally a default global payment Variable.  For example, the "id" parameter would be specified by:

[charge route=netbilling id=YourNetBillingID]


Route  netbilling  id  YourNetBillingID


Variable  MV_PAYMENT_ID  YourNetBillingID

You also need to change the "check_num" <form> variable to "check_number" in the following files: 

  • include/checkout/old_browser_payment
  • include/checkout/new_browser_payment
  • etc/profiles.order


Name Description
id This is your account number and sitetag separated with a colon (i.e. ACCOUNT:SITETAG).  ACCOUNT is the number of your NetBilling merchant or agent account, as a 12-character string, and is required for all transactions.  SITETAG is the site tag assigned to your website, as configured in the NetBilling system.  SITETAG is required for membership transactions, and is optional for others.  The variable is MV_PAYMENT_ID.
secret Your NetBilling Order Integrity Key, set in the NetBilling admin interface in step 11 of "Fraud Defence".  The variable is MV_PAYMENT_SECRET.

The type of transaction to be run.  Valid values are:

Interchange NetBilling Notes
auth AUTH Pre-Auth a charge card for later capture.
return CREDIT Credit the charge/ACH account instead of charging it.
sale SALE Standard charge/ACH transaction.
avs AVS Address verification only.  No charges.
settle CAPTURE Capture a Pre-Authed (auth) charge.
reverse REFUND Will attempt a void or a refund of a previous sale.
void REFUND Will attempt a void or a refund of a previous sale.
abort ABORT Will abort a pending capture (settle) transaction.

The "reverse" and "void" transactions are both sent as a "REFUND" because NetBilling determines internally whether to "VOID" or "REFUND", based upon whether the original transaction is yet to be batched out.

The default transaction parameter value is "sale"

type The payment type.  Set to "K" or any string with the word "check" in it for online cheques, or any other value for charge.  If left unset or blank then it will default to the "mv_order_profile" <form> value or CGI variable. 

If everything is blank then this parameter defaults to "charge".
host The domain name of the NetBilling secure server.  Defaults to "".
port The port to connect to on the NetBilling secure server.  Defaults to the standard HTTPS port (443).
script The path to the NetBilling direct mode 2.1 script on the NetBilling secure server.  Defaults to "/gw/native/direct2.1".
poll The path to the poll script on the NetBilling secure server.  Defaults to "/gw/native/poll1.0".
retries Number of times to attempt a connection to the NetBilling secure server before giving up.  Defaults to 3.
amount The monetary value of the transaction.  Defaults to the checkout total after all shipping, taxes discounts and other levies have been applied.
trans_id The Netbilling Transaction ID returned from a previous transaction.  This is used for "refund" type transactions.  The amount of the refund/void, and other relevant data, will be taken from the original transaction data.
getid The path to the "getid script on the NetBilling secure server.  Defaults to "/gw/native/getid1.0".
remote_host The customer's hostname for NetBilling to record along with this transaction.
remote_ip The customer's IP address for NetBilling to record along with this transaction.
remap This remaps the form variable names to the ones needed by NetBilling.


In order to run a test transaction in NetBilling, use the testing credit card number set in the Setup/Account Config/Credit Cards section of the NetBilling admin interface.

If nothing works:

  • Make sure you Required the module in interchange.cfg:

    Require module Vend::Payment::NetBilling

  • Make sure that LWP::UserAgent, LWP::Protocol::https and Digest::MD5 are all installed and working.  You can test to see whether your Perl thinks they are, like this:

    perl -MLWP::UserAgent -MLWP::Protocol::https -MDigest::MD5 -le 'print "Available"'

    If the above prints "Available", and returns to the shell prompt, then you should be OK (presuming they are in working order otherwise).

  • Check the local and global error log files.

  • Make sure you set your payment parameters properly.

  • Try an order, then put this code in a page:

        my $string = $Tag->uneval({ ref => $Session->{payment_result} });

        $string =~ s/{/{\n/;
        $string =~ s/,/,\n/g;

        return $string;

    That should show what happened.

  • If all else fails, consultants are available to help with integration for a fee.


There is actually nothing in Vend::Payment::NetBilling;  This module changes its package name to Vend::Payment and places things there.

You cannot randomly pick a transaction ID for NetBilling's Direct Mode.  The ID must be assigned from NetBilling.  It should either be left blank or a guaranteed unused ID can be retrieved from NetBilling prior to issuing the transaction.  This module will overwrite any transaction ID supplied it with the one assigned by NetBilling.

This module provides protection against dropped connections by prefetching a transaction ID from NetBilling and using that ID in the event of a dropped connection to see if the transaction was successful.  For more details see the NetBilling Direct Mode 2.1 documentation Link to an external page.

We need to support a lot more fraud screening for ACH transactions.



Category:  Interchange payment modules
Last modified by: Peter Ajamian
Modification date: Friday 22 June 2007 at 10:25 AM (EDT)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us