PHP code example of checkout-bundle / checkout

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

    

checkout-bundle / checkout example snippets

html
 public function registerBundles()
    {
        $bundles = [
            .........
            ........
           .........
            new Checkout\PaymentBundle\CheckoutPaymentBundle(),
        ];
html

    /**
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     * @\Sensio\Bundle\FrameworkExtraBundle\Configuration\Route("payment")
     */
    public function create_payment(Request $request){

        return $this->forward('CheckoutPaymentBundle:Checkout:show', [
        'currency' => 'USD',
        'amount' => 10,
        'customer_name' => 'Omair Afzal',
        'cartObject' =>  null,
        'country_code' => 'US',
        'callback_url' => 'http://iam_callback_url.com',
        'timeout' => 300,
        'public_key' => 'XXXXXXXXXXX',
        'env' => 'sandbox'   //live
        ]);
    }