New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

adamb/sagepayform-php

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adamb/sagepayform-php

A simple PHP class to integrate sagepayForm v3.00 into your website.

Source
Packagist
Version
v1.0.5
Version published
Total downloads
94
Maintainers
0
Created
Source

sagepayForm-php

A simple class to integrate sagepayForm v3.00 into your website. Since there is now sage php integration kit out yet - may be useful for someone.

To get started change the protected field $encryptPassword and look into index.php for example form, success.php for example response parsing.`

#Integration is easy

<?php
require_once('lib/SagePay.php');

$sagePay = new SagePay();
$sagePay->setCurrency('EUR');
$sagePay->setAmount('100');
$sagePay->setDescription('Lorem ipsum');
$sagePay->setBillingSurname('Mustermann');
$sagePay->setBillingFirstnames('Max');
$sagePay->setBillingCity('Cologne');
$sagePay->setBillingPostCode('50650');
$sagePay->setBillingAddress1('Bahnhofstr. 1');
$sagePay->setBillingCountry('de');
$sagePay->setDeliverySameAsBilling();
$sagePay->setSuccessURL('https://www.yoururl.com/success.php');
$sagePay->setFailureURL('https://www.yoururl.org/fail.php');
?>

<form method="POST" id="SagePayForm" action="*https://live.opayo.eu.elavon.com/gateway/service/vspform-register.vsp*">
	<input type="hidden" name="VPSProtocol" value= "3.00">
	<input type="hidden" name="TxType" value= "PAYMENT">
	<input type="hidden" name="Vendor" value= "*YOURVERNODID*">
	<input type="hidden" name="Crypt" value= "<?php echo $sagePay->getCrypt(); ?>">
	<input type="submit" value="continue to SagePay">
</form>

Or use chaining:

$sagePay = new SagePay();
$sagePay
  ->setCurrenty('EUR')
  ->setAmount('100')
  ->setDescription('Lorem ipsum')
  ....

For more examples see index.php

FAQs

Package last updated on 28 Nov 2023

Related posts