Download the PHP package kofikwarteng/laravel-sagepay without Composer

On this page you can find all versions of the php package kofikwarteng/laravel-sagepay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-sagepay

Laravel 5.x Integration with SagePay

To my knowledge, Laravel lacks any SagePay Integration package. This was why I decided to write this package. The package integrates with the SagePay forms.

This Package is based on tolzhabayev's SagePay library. Credits goes to him for the development of such an awesome library for SagePay.

Requirements

PHP 5.4 and higher. PHP7/HHVM is fully supported too.

Laravel 5 (I have not tested it on Laravel 4 but it might work)

Installation

To install just use composer and run the command:

Alternatively, you can add ` to the require block in your file and run or

After, locate app.php file which can be found in the config folder of your Laravel installation. Add these two lines:

Add to the list of providers

Add to the list of aliases

After you are done, run this command in your root Laravel directory:

Now locate the file which can now be found in your config folder after running the command above. Edit the currency value and the Encryption password to your values. Make sure the Currency you enter is supported by SagePay.

SagePay has two types of Encryption Keys, the test keys and the live keys. For development, the test keys are used. The test keys, together with the Test URL, provides a sandbox where you can test their payment system with your application by using fake credit card numbers.

Here is a link to their test credit card numbers:

http://www.sagepay.co.uk/support/12/36/test-card-details-for-your-test-transactions

NB: The link may change without notice

Usage

To use this package in your controller, simply declare the SagePay class like this:

`

You can also simply use it in the ` file without declaring it.

You can then use the example below to create a simple payment:

I believe this is very straight forward and easy to use. What the library does is to get the information of your payment and encrypt it into a string that only SagePay can understand and decrypt.

To output the encrypted string simply call this method:

To submit the encryption code to SagePay, you can do something like this using blade:

return view ('pages.checkout', compact('encrypted_code' ));

On your view, you can use this form to place a booking:

Another way to use it is to return the encryption code as JSON, this way you can build a RestFul application based on the package. I personally used it to create a RestFul Application using AngularJS.

To check for success, sagepay attaches a url parameter called to the success and failure url which is an encrypted string which can be decrypted to provide a success response. With this success response, you can mark a payment as paid in your database, send an email, etc.

The method I personally use is to create a route with a order token parameter (the order token is just a token string I generate per order and store in the database). An example will be:

`

Mind you, this example is created with the intention that ` is your laravel installation folder. As you can see I set the success and failure URL to be the same url. There is no need creating separate routes. We then declare our routes like this:

`

For more advanced usage, please visit tolzhabayev's GitHub page as he is the original developer of the library. You can also contact me HERE.

I am working on various tests. They will be available soon once I'm done.

Thanks and happy coding.


All versions of laravel-sagepay with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kofikwarteng/laravel-sagepay contains the following files

Loading the files please wait ....