dominicwatts/sagepay-sdk-php

There is no license information available for the latest version (1.0.5) of this package.

Sagepay wrapper and mordernization for SDK that supports server, form and direct payments

1.0.5 2021-03-15 22:36 UTC

This package is auto-updated.

Last update: 2024-12-16 06:28:30 UTC


README

phpcs

PHPCompatibility

PHPStan

Coverage Status

PHPUnit

Coveralls Status

Sage Pay PHP SDK for server, frame and direct integrations based on the official Sage Pay SDK. This is a composer compatible Sage Pay V3 PHP SDK. This is not an official Sage Pay package.

Install Instructions

composer require dominicwatts/sagepay-sdk-php

There is a composer archive at:

https://packagist.org/packages/dominicwatts/sagepay-sdk-php

Usage

require 'vendor/autoload.php';

use Xigen\Library\Sagepay\Payment;
use Xigen\Library\Sagepay\Classes\SagepayCustomer;
use Xigen\Library\Sagepay\Classes\SagepayCustomerDetails;

$config = [
    'vendorName' => 'testing'
];

$payment = new Payment(
    Payment::FORM,
    $config
);

$customer = new SagepayCustomer();
$customerDetails = new SagepayCustomerDetails();
$customerDetails->__set('firstname', 'Dave');
$customerDetails->setLastname('Smith');

$api = $payment->getApi();

$api->setCustomer($customer);
$api->setCustomerDetails($customerDetails);

var_dump($api);

$api->createRequest();

Update

Check ./tests for more comprehensive usage

Copyright

The original SDK belongs to SagePay and is their intellectual property. No license information is available but this is based on their publicly accessible source code.