PHP code example of amedev / smart-payment

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

    

amedev / smart-payment example snippets


return [
    'default' => 'zarinpal', // Default payment gateway

    'gateways' => [
        'zarinpal' => \SmartPayment\Gateways\ZarinpalGateway::class,
        // You can register your own gateway classes like:
        // 'idpay' => \App\Gateways\CustomIDPayGateway::class,
    ],

    'models' => [
        'order' => \App\Models\Order::class,           // Your custom Order model
        'transaction' => \App\Models\Transaction::class, // Your custom Transaction model
    ],
];
bash
php artisan vendor:publish --tag=smart-payment-config         # Configuration file
php artisan vendor:publish --tag=smart-payment-migrations     # Database migrations
php artisan vendor:publish --tag=smart-payment-models         # Default models
php artisan vendor:publish --tag=smart-payment-translations   # Translations (e.g. Farsi)
bash
php artisan migrate
bash
php artisan smart-payment:fix-model-namespace

resources/lang/vendor/smart-payment/fa/messages.php