PayStack

  1. Add the following variables to your .env file:

PAYSTACK_SECRET_KEY=your-secret-key
PAYSTACK_PUBLIC_KEY=your-public-key
PAYSTACK_BASE_URL=https://api.paystack.co
  1. The configuration is loaded from config/momo-suite.php:

'paystack' => [
    'secret_key' => env('PAYSTACK_SECRET_KEY'),
    'public_key' => env('PAYSTACK_PUBLIC_KEY'),
    'base_url' => env('PAYSTACK_BASE_URL', 'https://api.paystack.co'),
],

Receiving Money

To receive money using Paystack:

use Rais\MomoSuite\Facades\Momo;

// Using Facade
$result = Momo::setProvider('paystack')
    ->receive([
        'phone' => '0551234987',
        'amount' => 3.00,  // Note: Paystack has minimum amount requirements
        'email' => 'customer@example.com',  // Required for Paystack
        'network' => 'MTN',
        'reference' => 'Test Payment',
    ]);

// Using Service Container
$momo = app('momo-suite');
$momo->setProvider('paystack');
$result = $momo->receive([
    'phone' => '0551234987',
    'amount' => 3.00,
    'email' => 'customer@example.com',
    'network' => 'MTN',
    'reference' => 'Test Payment',
]);


// for otp verifcaition
$momo = app('momo-suite');
$momo->setProvider('paystack');

// Test sending money with Paystack
$otp = $momo->verifyOtp([
    'otp' => $otp, // Recipient's phone number
    'reference' => $reference,
]);

// Required Parameters:
// - phone: Customer's phone number
// - amount: Transaction amount (minimum amount applies)
// - email: Customer's email address (Paystack specific requirement)
// - network: Mobile network (MTN, VODAFONE, AIRTELTIGO)
// - reference: Your transaction reference

Sending Money

To send money using Paystack:

Webhook Handling

POST /momo/webhooks/paystack

Example webhook payload:

Important Notes

Last updated