PHP code example of fei / payment-package

1. Go to this page and download the library: Download fei/payment-package 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/ */

    

fei / payment-package example snippets




use ObjectivePHP\Application\AbstractApplication;
use Fei\Service\Payment\Package\PaymentPackage;

class Application extends AbstractApplication
{
    public function init()
    {
        // Define some application steps
        $this->addSteps('bootstrap', 'init', 'auth', 'route', 'rendering');
        
        // Initializations...

        // Plugging the Payment Package in the bootstrap step
        $this->getStep('bootstrap')
        ->plug(PaymentPackage::class);

        // Another initializations...
    }
}


use Fei\ApiClient\Transport\BasicTransport;
use Fei\Service\Payment\Package\Config\PaymentParam;

return [
    (new PaymentParam())
        ->setBaseUrl('http://payment.dev')
        ->setTransport(new BasicTransport())
];

			// Plugging the Payment Package in the bootstrap step
			$this->getStep('bootstrap')
			->plug(new PaymentPackage('my_service'));