PHP code example of webgriffe / payum-lock-request-extension

1. Go to this page and download the library: Download webgriffe/payum-lock-request-extension 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/ */

    

webgriffe / payum-lock-request-extension example snippets




// Use your preferred \Symfony\Component\Lock\PersistingStoreInterface implementation
$persistingStore = new Symfony\Component\Lock\Store\SemaphoreStore();

$lockFactory = new \Symfony\Component\Lock\LockFactory($persistingStore);

$lockRequestExtension = new \Webgriffe\PayumLockRequestExtension\LockRequestExtension(
    $lockFactory,
    'my_lock_prefix', // Optional, default value is 'webgriffe_payum_lock_request_extension'
    30.0, // Optional, default value is 30.0
    true // Optional, default value is true
);

/** @var \Payum\Core\Gateway $gateway */
$gateway->addExtension($lockRequestExtension);

// here the extension will be called to wrap the execute acton in a lock
$gateway->execute(new FooRequest);