PHP code example of elleracompany / commerce-klarna-checkout

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

    

elleracompany / commerce-klarna-checkout example snippets


    use ellera\commerce\klarna\gateways\Base as KlarnaGateway;
    
    Event::on(
        KlarnaGateway::class,
        KlarnaGateway::EVENT_FORMAT_ADDRESS,
        function(FormatAddressEvent $event) {
            $event->address['street_address'] = "{$event->sourceAddress->address1} {$event->sourceAddress->address3}";
        }
    );