PHP code example of polidog / payjp-bundle
1. Go to this page and download the library: Download polidog/payjp-bundle 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/ */
polidog / payjp-bundle example snippets
// AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Polidog\PayjpBundle\PolidogPayjpBundle(),
// ...
);
}
namespace App\Command;
use Polidog\PayjpBundle\Payjp;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class CustomerShowCommand extends Command
{
/**
* @var Payjp
*/
private $payjp;
public function __construct(Payjp $payjp)
{
$this->payjp = $payjp;
parent::__construct(null);
}
protected function configure()
{
$this->setName('app:customer:retrieve');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$result = $this->payjp->customer->retrieve('cus_141a8ff031230845375b8181293f');
var_dump($result);
}
}