[ic] Dummy Charge Module

Mike Heins mike at perusion.com
Mon Oct 13 04:13:23 UTC 2008

Quoting tom at readyink.com (tom at readyink.com):
> Does anyone have a stub/dummy charge module that always returned success? 
> This would be a great addition to the project.

Comes with IC. Uncomment

    Require module Vend::Payment::TestPayment

in interchange.cfg. Then set your MV_PAYMENT_MODE variable to
"testpayment". Restart, and there you are.

       Vend::Payment::TestPayment - Interchange payment test module



	   [charge mode=testpayment param1=value1 param2=value2]


       The Vend::Payment::TestPayment module implements the testpayment() rou-
       tine for use with Interchange.  It's compatible on a call level with
       the other Interchange payment modules -- in theory (and even usually in
       practice) you could switch from TestPayment to another payment module
       with a few configuration file changes.

       The module will perform one of three actions:

       ?   If the card number is 4111111111111111 then the transaction will be

       ?   If the card number is 4111111111111129 then the transaction will be

       ?   Any other card number will raise an error and the transaction will
	   be declined.

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

	   Require module Vend::Payment::TestPayment

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

       Make sure CreditCardAuto is off (default in Interchange demos).

       The mode can be named anything, but the "gateway" parameter must be set
       to "testpayment".  To make it the default payment gateway for all
       credit card transactions in a specific catalog, you can set in "cata-

	   Variable   MV_PAYMENT_MODE  testpayment

       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 for the
       mode, then finally a default global payment variable, For example, the
       "id" parameter would be specified by:

	   [charge mode=testpayment id=testid]


	   Route testpayment id testid


	   Variable MV_PAYMENT_ID      testid

       The active settings are:

       id  A test account ID, which can be any value you like.	Global parame-
	   ter is MV_PAYMENT_ID.

	   A test account password, which can be any value you like.  Global
	   parameter is MV_PAYMENT_SECRET.  This is not needed for test
	   charges, using this module, but you may as well set it up anyway.

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


	   Actually, the transaction type is ignored in this version, but you
	   may as well set it anyway.

	   This remaps the form variable names to the ones needed by TestPay-
	   ment.  See the "Payment Settings" heading in the Interchange docu-
	   mentation for use.


       ?   Make sure you "Require"d the module in interchange.cfg:

	       Require module Vend::Payment::TestPayment

       ?   Check the error logs, both catalog and global.

       ?   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, Cursor Software and other consultants are avail-
	   able to help with integration for a fee.

       There is actually nothing *in* Vend::Payment::TestPayment.  It changes
       packages to Vend::Payment and places things there.

       Kevin Walsh <kevin at cursor.biz> Based on original code by Mike Heins
       <mheins at perusion.com>

perl v5.8.8			  2007-0dt::lib::Vend::Payment::TestPayment(3)

Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.328.4479  tollfree 800-949-1889 <mike at perusion.com>

My wife is great.  She doesn't care where I go, just as long as I don't
have any fun.  -- Lee Trevino

More information about the interchange-users mailing list