Business::OnlinePayment::Protx - Perl Class for making Online Payments via Protx VPS
use Business::OnlinePayment::Protx; Business::OnlinePayment::Protx->Vendor($your_vps_gateway_username); my $request = Business::OnlinePayment::Protx->new(); my $payment_status = $request->make_direct_payment( VendorTxCode => 1131, Amount => 23.5, Description => 'a test purchase' , CardHolder => 'mr fred elliot', CardNumber => '4444333322221111', ExpiryMonth => "07", ExpiryYear => "05", IssueNumber => 3, CV2 => 555, CardType => 'MC',); my $payment_status = $request->Status; my $repeat_request = $request->new(); my $repeat_status = $repeat_request->make_repeat_payment( VendorTxCode => '2011', Description => 'a repeat payment', RelatedVPSTxId => $vpstxid, RelatedVendorTxCode => '1011', RelatedSecurityKey => $seckey, RelatedTxAuthNo => $authno, Amount => 250, ); my $repeat_VPSRef = $repeat_request->VPSTxId; my $repeat_VendorRef = $repeat_request->VendorTxCode; my $status = $request->make_preauth_payment( VendorTxCode => '1231', Amount => ... ); my $preauth_VPSRef = $repeat_request->VPSTxId; my $preauth_VendorRef = $repeat_request->VendorTxCode;
Business::OnlinePayment::Protx is a module that allows you to easily make payments via the Protx VPS DirectPay system.
This module provides a Flexible powerful class with attributes matching the fields used in VPS request and response messages. It uses LWP to send HTTPS POST requests to the gateway and processes the response.
This class method specifies the vendor username to be used in payment requests.
Business::OnlinePayment::Protx->Vendor($your_vps_gateway_username);
This needs to be set before creating or using any objects.
This class method specifies the VPS protocol to be used in payment requests.
Business::OnlinePayment::Protx->VPSProtocol('2.22');
The default is 2.2, if you need to change the value, do so before calling an object method that uses it such as make_direct_payment
This class method specifies the mode to be used for payment requests.
Business::OnlinePayment::Protx->mode('live');
The default mode value is 'simulator', other modes are 'test' and 'live'.
This creates and populates the Business::OnlinePayment::Protx with parameters provided.
my $request = Business::OnlinePayment::Protx->new();
Parameters you can provide are Vendor
This method sends a payment request to the VPS Payment Gateway and checks the result.
This method takes the following named arguments : VendorTxCode, Amount, Description, CardHolder, CardNumber, StartMonth, StartYear, ExpiryMonth, ExpiryYear, IssueNumber, CV2, CardType and returns true (the Status provided by the gateway) on success and dies on failure.
This method is called on the object and will update the object based on the results, these results can then be accessed via the normal accessors as show below
my $status = $request->make_direct_payment( VendorTxCode => '1231', Amount => ... );
my $VPS_tx_id = $request->VPSTxId;
This method sends a repeat payment request to the VPS Payment Gateway and checks the result.
This method takes the following arguments : VendorTxCode, Description, Amount, RelatedVPSTxId, RelatedVendorTxCode, RelatedSecurityKey, RelatedTxAuthNo and returns true (the Status provided by the gateway) on success and dies on failure.
my $status = $request->make_repeat_payment(VendorTxCode=>...);
This method sends a preauthorise payment request to the VPS Payment Gateway and checks the result.
my $status = $request->make_preauth_payment( VendorTxCode => '1231', Amount => ... );
This method sends a deferred payment request to the VPS Payment Gateway and checks the result.
Type of card used on order
VISA, MC (mastercard), DELTA, SOLO, SWITCH, UKE (electron), AMEX, DC or JCB
alphanumeric
Total Value of Order
floating point to 2 decimal places.
alias to get_StartDate
alias to get_ExpiryDate
None by default.
www.protx.com
Foresite Developers, <dev@fsite.com>
Copyright (C) 2005 Foresite Business Solutions www.fsite.com
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.
To install Business::OnlinePayment::Protx, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::OnlinePayment::Protx
CPAN shell
perl -MCPAN -e shell install Business::OnlinePayment::Protx
For more information on module installation, please visit the detailed CPAN module installation guide.