Skip to content

This is a Laravel 4.2 pesapal package.

License

Notifications You must be signed in to change notification settings

RingierIMU/pesapal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pesapal package for Laravel

Introduction

This is a Laravel 5 pesapal package. I provided this package as to help since pesapal do not have a package for Laravel. Pesapal do not have a way to test this so I guess you will have to send money payments to test

Installation

add
"ericmuigai/pesapal": "2.*@dev"
to your composer.json and then
composer update
this will install the package Once the package is installed add
'Ericmuigai\Pesapal\PesapalServiceProvider',
to the providers. after this publish the config file by
php artisan config:publish ericmuigai/pesapal
then migrate the package table by using
php artisan migrate --package=ericmuigai/pesapal
Go to your pesapal account and in the ipn url enter
yoursite.com/listenipn
or or the url to your public path/listenipn
You should now find the config.php in the
app/packages/ericmuigai/pesapal 

How to use

Now you should be able to call the
Pesapal::Iframe($array)
from any view you would like the iframe to appear. The array should have this info in the
$array
/**
     * generates the iframe from the given details
     * @param array $values this array should contain the fields required by pesapal
     * description - description of the item or service
     * currency - if set will override the config settings you have of currency
     * user -which should be your client user id if you have a system of users
     * first_name- the first name of the user that is paying
     * last_name - the last name of the user that is paying
     * email - this should be a valid email or pesapal will throw an error
     * phone_number -which is optional if you have the email
     * amount - the total amount to be posted to pesapal
     * reference Please Make sure this is a unique key to the transaction. An example is the id of the item or something
     * type - default is MERCHANT
     * frame_height- this is the height of the iframe please provide integers as in 900 without the px
     *
     */'