PHP code example of cannonb4ll / larapay

1. Go to this page and download the library: Download cannonb4ll/larapay library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cannonb4ll / larapay example snippets


$larapay = new LaraPay;

$larapay->methods(); // Returns list of payment methods

$larapay->banks(); // Returns list of banks (iDEAL)

// Starts a transaction, you can apply more data here according to the pay's API documentation.
$larapay->startTransaction([
   'amount' => $total,		
   'returnUrl' => 'http://www.example.com/thanks',		
	
   'exchangeUrl' => 'http://www.example.com/webhook',		
   'paymentMethod' => 138,
   'description' => 'ORder',		
   'testmode' => 1
]);

$larapay->getTransaction($id); // Returns a transaction