1. Go to this page and download the library: Download dalpras/payment-core 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/ */
use DalPraS\Payment\Idempotency\InMemoryIdempotencyStore;
use DalPraS\Payment\Manager\PaymentManager;
use DalPraS\Payment\Registry\ProviderRegistry;
use DalPraS\Payment\Repository\InMemoryPaymentRepository;
use DalPraS\Payment\Repository\RedisPaymentRepository;
$registry = new ProviderRegistry();
$registry->register($paypalProvider);
$registry->register($nexiProvider);
$manager = new PaymentManager(
providers: $registry,
payments: new InMemoryPaymentRepository(), // Replace with RedisPaymentRepository or a DB repository in production.
idempotency: new InMemoryIdempotencyStore(),
);
$manager = new PaymentManager(
providers: $registry,
payments: new RedisPaymentRepository($redis, 'payment:repository:', 86400),
idempotency: new InMemoryIdempotencyStore(),
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.