PHP code example of jmauzyk / commerce-cardconnect

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

    

jmauzyk / commerce-cardconnect example snippets


use jmauzyk\commerce\cardconnect\events\UserFieldsEvent;
use jmauzyk\commerce\cardconnect\gateways\Gateway;
use yii\base\Event;

Event::on(
    Gateway::class,
    Gateway::USER_FIELDS_EVENT,
    function (UserFieldsEvent $e) {
        $order = $e->order;

        $e->userFields = [
            'note' => $order->note ?? '',
            // ...
        ];
    }
);