Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

vend::counterfile(3pm) [debian man page]

Vend::CounterFile(3pm)					User Contributed Perl Documentation				    Vend::CounterFile(3pm)

NAME
Vend::CounterFile - Persistent counter class SYNOPSIS
use Vend::CounterFile; $c = new Vend::CounterFile "COUNTER", "aa00"; $id = $c->inc; open(F, ">F$id"); DESCRIPTION
(This module is modified from Gisle Aas File::CounterFile to use Interchange's locking protocols -- lack of fcntl locking was causing counter problems.) This module implements a persistent counter class. Each counter is represented by a separate file in the file system. File locking is applied, so multiple processes might try to access the same counters at the same time without risk of counter destruction. You give the file name as the first parameter to the object constructor ("new"). The file is created if it does not exist. If the file name does not start with "/" or ".", then it is interpreted as a file relative to $Vend::CounterFile::DEFAULT_DIR. The default value for this variable is initialized from the environment variable "TMPDIR", or /usr/tmp is no environment variable is defined. You may want to assign a different value to this variable before creating counters. If you pass a second parameter to the constructor, that sets the initial value for a new counter. This parameter only takes effect when the file is created (i.e. it does not exist before the call). When you call the "inc()" method, you increment the counter value by one. When you call "dec()" the counter value is decrementd. In both cases the new value is returned. The "dec()" method only works for numerical counters (digits only). You can peek at the value of the counter (without incrementing it) by using the "value()" method. The counter can be locked and unlocked with the "lock()" and "unlock()" methods. Incrementing and value retrieval is faster when the counter is locked, because we do not have to update the counter file all the time. You can query whether the counter is locked with the "locked()" method. There is also an operator overloading interface to the Vend::CounterFile object. This means that you might use the "++" operator for incrementing the counter, "--" operator for decrementing and you can interpolate counters diretly into strings. BUGS
(This problem alleviated by this modified module) It uses flock(2) to lock the counter file. This does not work on all systems. Perhaps we should use the File::Lock module? COPYRIGHT
Copyright (c) 1995-1998 Gisle Aas. All rights reserved. Modifications made by and copyright (C) 2002 Red Hat, Inc. and (c) 2002-2007 Interchange Development Group This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Gisle Aas <aas@sn.no> perl v5.14.2 2010-03-25 Vend::CounterFile(3pm)

Check Out this Related Man Page

Vend::Payment::TestPayment(3pm) 			User Contributed Perl Documentation			   Vend::Payment::TestPayment(3pm)

NAME
Vend::Payment::TestPayment - Interchange payment test module SYNOPSIS
&charge=testpayment or [charge mode=testpayment param1=value1 param2=value2] PREREQUISITES
None. DESCRIPTION
The Vend::Payment::TestPayment module implements the testpayment() routine 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: o If the card number is 4111111111111111 then the transaction will be approved. o If the card number is 4111111111111129 then the transaction will be declined. o 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 "catalog.cfg": 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] or Route testpayment id testid or Variable MV_PAYMENT_ID testid The active settings are: id A test account ID, which can be any value you like. Global parameter is MV_PAYMENT_ID. secret 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. transaction The type of transaction to be run. Valid values are: auth return reverse sale settle void Actually, the transaction type is ignored in this version, but you may as well set it anyway. remap This remaps the form variable names to the ones needed by TestPayment. See the "Payment Settings" heading in the Interchange documentation for use. Troubleshooting o Make sure you "Require"d the module in interchange.cfg: Require module Vend::Payment::TestPayment o Check the error logs, both catalog and global. o Make sure you set your payment parameters properly. o Try an order, then put this code in a page: <XMP> [calc] my $string = $Tag->uneval( { ref => $Session->{payment_result} }); $string =~ s/{/{ /; $string =~ s/,/, /g; return $string; [/calc] </XMP> That should show what happened. o If all else fails, Cursor Software and other consultants are available to help with integration for a fee. BUGS
There is actually nothing *in* Vend::Payment::TestPayment. It changes packages to Vend::Payment and places things there. AUTHORS
Kevin Walsh <kevin@cursor.biz> Based on original code by Mike Heins <mheins@perusion.com> perl v5.14.2 2010-03-25 Vend::Payment::TestPayment(3pm)
Man Page