Giter VIP home page Giter VIP logo

buckaroo's Introduction

Buckaroo

A bridge between laravel 4 and the Buckaroo Payment engine.

Installation

Add johnhout/buckaroo as a requirement to composer.json:

{
    "require": {
       "johnhout/buckaroo" : "dev-master"
    }
}

Update your packages with composer update or install with composer install.

Once Composer has installed or updated your packages you need to register Buckaroo with Laravel itself. Open up app/config/app.php and find the providers key towards the bottom and add:

'johnhout\Buckaroo\BuckarooServiceProvider'

Configuration

You should publish a configuration file to enter your settings of your buckaroo account by running the following Artisan command.

$ php artisan config:publish johnhout/buckaroo

Add the serviceprovider

We made it easy for you to access the class using the facade method. Add the following in your config/app.php in the 'aliases' array.

'Buckaroo'    => 'johnhout\Buckaroo\Facades\Buckaroo',

Usage

Before you will be transfered to a bank EU-Law requires the user to perform an action wich in our case will be a button. The following code will generate a FORM with hidden inputs with everything set to be posted.

Buckaroo::createForm(array(
	'brq_amount'  		=> '10.00',
	'brq_invoicenumber' => 'Invoice0001'
));

Adding a picked bank to the form for the iDeal portal.

Buckaroo::createForm(array(
	'brq_amount'  				=> '10.00',
	'brq_invoicenumber' 		=> 'Invoice0001',
	'brq_payment_method' 		=> 'ideal',
	'brq_service_ideal_issuer' 	=> 'ABNANL2A'
));

Using PayPal.

Buckaroo::createForm(array(
	'brq_amount'  		=> '10.00',
	'brq_invoicenumber' => 'Invoice0001',
	'brq_payment_method' => 'paypal',
	'brq_service_paypal_buyeremail' => '[email protected]'
));

A complete list of possible banks to select from when using ideal

<select>
	<option value="ABNANL2A">ABN AMRO</option>
	<option value="ASNBNL21">ASN Bank</option>
	<option value="INGBNL2A">ING</option>
	<option value="RABONL2U">Rabobank</option>
	<option value="SNSBNL2A">SNS Bank</option>
	<option value="RBRBNL21">RegioBank</option>
	<option value="TRIONL2U">Triodos Bank</option>
	<option value="FVLBNL22">Van Lanschot</option>
	<option value="KNABNL2H">KNAB bank</option>
</select>

Refunding

Refunding is really simple just add an order number and a price (int rounded to 1).

	Buckaroo::refund('Invoice00100', 0.5); // Refund 50 cents to the user of order Invoice00100

Transaction information

Retrieving transaction Information of a previously made payment with the order number.

Buckaroo::transactionInfo('Invoice00100');

This will return the the whole object of a the transaction including multiple attempts dump the object to view more information.

	$transactionData = Buckaroo::transactionInfo('Invoice00100');
	print_r($transactionData);

Helpers

However if your simply want to resolve if a transaction was payed than you could use the following it returns a bool.

Buckaroo::checkInvoiceForSuccess('Invoice00100');
// Returns true / false

Checking for success

$transactionData = Buckaroo::transactionInfo('Invoice00100');
if(Buckaroo::success())
{
	var_dump($transactionData);
}
else
{
	var_dump(Buckaroo::errors());
}

buckaroo's People

Contributors

bartjuh4 avatar inov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.