# Vend::Payment::SagePay - Interchange Sagepay support # # SagePay.pm, v 0.8.7, May 2009 # # Copyright (C) 2009 Zolotek Resources Ltd. All rights reserved. # # Author: Lyn St George # Based on original code by Mike Heins and others. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Licence as published by # the Free Software Foundation; either version 2 of the Licence, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public Licence for more details. # # You should have received a copy of the GNU General Public # Licence along with this program; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA. package Vend::Payment::SagePay; =head1 Interchange Sagepay Support Vend::Payment::SagePay http://kiwi.zolotek.net is the home page with the latest version. =head1 This package is for the 'SagePay Direct' payment system. Note that their 'Direct' system is the only one which leaves the customer on your own site and takes payment in real time. Their other systems, eg Terminal or Server, do not require this module. =head1 Quick Start Summary 1 Place this module in /lib/Vend/Payment/SagePay.pm 2 Call it in interchange.cfg with: Require module Vend::Payment::SagePay 3 Add into variable.txt (tab separated): MV_PAYMENT_MODE sagepay Add a new route into catalog.cfg (options for the last entry in parentheses): Route sagepay id YourSagePayID Route sagepay host live.sagepay.com (test.sagepay.com) Route sagepay currency GBP (USD, EUR, others, defaults to GBP) Route sagepay txtype PAYMENT (AUTHENTICATE, DEFERRED) Route sagepay available yes (no, empty) Route sagepay logzero yes (no, empty) Route sagepay logorder yes (no, empty) Route sagepay logsagepay yes (no, empty) Route sagepay applyavscv2 '0': if enabled then check, and if rules apply use. '1': force checks even if not enabled; if rules apply use. '2': force NO checks even if enabled on account. '3': force checks even if not enabled; do NOT apply rules. Route sagepay giftaidpayment 0 (1 to donate tax to Gift Aid) 4 Create a new locale setting for en_GB as noted in "item currency" below, and copy the public space interchange/en_US/ directory to a new interchange/en_GB/ one. Ensure that any other locales you might use have a correctly named directory as well. Ensure that this locale is found in your version of locale.txt (and set up GB as opposed to US language strings to taste). 5 Create entry boxes on your checkout page for: 'mv_credit_card_issue_number', 'mv_credit_card_start_month', 'mv_credit_card_start_year', 'mv_credit_card_type' and 'mv_credit_card_cvv2'. 6 The new fields in API 2.23 are: BillingAddress, BillingPostCode, DeliveryAddress, DeliveryPostCode, BillingFirstnames, BillingSurname, DeliveryFirstnames, DeliverySurname, ContactNumber,ContactFax,CustomerEmail. CustomerName has been removed. Billing and Delivery State must be sent if the destination country is the US, otherwise they are not required. State must be only 2 letters if sent. Other fields may default to a space if there is no proper value to send, though this may conflict with your AVS checking rules. SagePay currently accept a space as of time of writing - if they change this without changing the API version then send either a series of '0' or '-' characters to stop their error messages. 7. Add a page in pages/ord/, tdsfinal.html, being a minimal page with only the header and side bar, and in the middle of the page put: [if scratch acsurl] [/if] Add a page in pages/ord/, tdsauth.html, consisting of this:
along with whatever