PHP code example of riskio / idempotency-module

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

    

riskio / idempotency-module example snippets



use Riskio\IdempotencyModule\IdempotencyMiddleware;

$app->pipe(IdempotencyMiddleware::class);


use Zend\Validator\Uuid as UuidValidator;

return [
    'riskio_idempotency' => [
        'idempotency_key_validator' => UuidValidator::class,
    ],
];


use Symfony\Component\Cache\Adapter\NullAdapter as NullCacheAdapter;

return [
    'riskio_idempotency' => [
        'cache' => NullCacheAdapter::class,
    ],
];


use Riskio\IdempotencyModule\Serializer\Serializer;

return [
    'riskio_idempotency' => [
        'serializer' => Serializer::class,
    ],
];


return [
    'riskio_idempotency' => [
        'http_methods' => ['PATCH', 'POST'],
    ],
];


return [
    'riskio_idempotency' => [
        'idempotency_key_header' => 'Idempotency-Key',
    ],
];