#################### main pod documentation begin ################### =head1 NAME Zymonic::PaymentGateway - Zymonic Workflow System PaymentGateway module =head1 SYNOPSIS Stub object which will be subclassed by differentpayment gateway implementations. =head1 DESCRIPTION Contains common functionality of all Payment Gateways. =head1 USAGE Not top be used directly, use one of its subclasses. =head1 BUGS NONE =head1 SUPPORT As in the license, Zymonic is provided without warranty or support unless purchased separately, however... If you email zymonic-support@zednax.com your issue will be noted and may receive a response. For security issues, please contact zymonic-security@zednax.com and someone will respond within 8 working hours. =head1 AUTHOR Alex Masidlover et al.a CPAN ID: MODAUTHOR Zednax Limited alex.masidlover@zednax.com http://www.zednax.com =head1 COPYRIGHT This program is free software licensed under the... Alfresco Public License 1.0 The full text of the license can be found in the LICENSE file included with this module. Other licenses may be acceptable if including parts of Zymonic in larger projects, please contact Zednax for details. =head1 SEE ALSO Zymonic::Field Zymonic perl(1). =cut #################### main pod documentation end ################### package Zymonic::PaymentGateway; use strict; BEGIN { use Exporter (); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = '0.01'; @ISA = qw(Exporter); #Give a hoot don't pollute, do not export more than needed by default @EXPORT = qw(); @EXPORT_OK = qw(); %EXPORT_TAGS = (); } use base "Zymonic::Base"; use Zymonic::Table; use Zymonic::Utils qw(get_array); #################### subroutine header begin #################### =head2 init Usage : N/A Purpose : The init method is called by the object constructor to initialise the object fields. Returns : nothing Argument : nothing Throws : nothing Comment : See Also : =cut #################### subroutine header end #################### sub init { my $self = shift; # cache for stored looked up payment gateway options and transactions $self->{options} = {}; $self->{transactions} = {}; } #################### subroutine header begin #################### =head2 authorise Usage : $pg->authorise($trans) Purpose : Authorises the incoming transaction. Returns : The result of the authorisation. Argument : A hashref containg transaction details Throws : Zymonic::Exception::PaymentGateway Comment : Throws exception as each subclasses should implement this function themselves. See Also : =cut #################### subroutine header end #################### sub authorise { my $self = shift; Zymonic::Exception::PaymentGateway->throw( error => 'Authorise method on PaymentGateway must be overridden by subclass.' ); } #################### subroutine header begin #################### =head2 options Usage : $pg->options($pg_id) Purpose : Returns the settings from DB for the given payment gateway id. Returns : A hashref of settings for the specified payment gateway. Argument : A payment gateway id. Throws : Zymonic::Exception::PaymentGateway::Parameter Comment : See Also : =cut #################### subroutine header end #################### sub options { my $self = shift; my $pg_id = shift; Zymonic::Exception::PaymentGateway->throw( error => 'Options method on PaymentGateway must be overridden by subclass.' ); } #################### subroutine header begin #################### =head2 transaction_details Usage : $pg->transaction_details($trans_id) Purpose : Returns all the values for the given transaction id. Returns : A hashref of settings for the specified transaction. Argument : A transaction id. Throws : Zymonic::Exception::PaymentGateway::Parameter Comment : Uses direct DB access so can easily join tables. See Also : =cut #################### subroutine header end #################### sub transaction_details { my $self = shift; my $trans_id = shift; Zymonic::Exception::PaymentGateway->throw( error => 'Transaction Details method on PaymentGateway must be overridden by subclass.' ); } 1;