PHP code example of mysho / comgate-bundle
1. Go to this page and download the library: Download mysho/comgate-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/ */
mysho / comgate-bundle example snippets
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Mysho\ComgateBundle\MyshoComgateBundle(),
// ...
);
}
# CartController
/**
* @Route("/cart/payment", name="cart_payment")
* @param ComgateConnector $comgate
* @param Request
* @return Response
*/
public function payment(ComgateConnector $comgate): Response
{
$payment = new CreatePayment('PRICE', 'Your order ID', $this->getUser()->getEmail(), 'Some product');
// to create payment on background according to API