PHP code example of azaharizaman / nexus-payment-wallet

1. Go to this page and download the library: Download azaharizaman/nexus-payment-wallet 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/ */

    

azaharizaman / nexus-payment-wallet example snippets


use Nexus\PaymentWallet\Contracts\WalletManagerInterface;

final readonly class WalletPaymentService
{
    public function __construct(
        private WalletManagerInterface $walletManager,
    ) {}

    public function processWalletPayment(string $walletType, WalletPaymentRequest $request): PaymentResult
    {
        $wallet = $this->walletManager->getWallet($walletType);
        return $wallet->charge($request);
    }
}