1. Go to this page and download the library: Download sonawap/paystack 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/ */
sonawap / paystack example snippets
use Sonawap\Paystack\Transaction\Transaction;
use Sonawap\Paystack\Transaction\Plan;
use Sonawap\Paystack\Transaction\Product;
use Sonawap\Paystack\Transaction\Invoice;
use Sonawap\Paystack\Customer\Customer;
$transaction = new Transaction();
$customer = new Customer();
$plan = new Plan();
$product = new Product();
$invoice = new Invoice();
/// initialize a transaction
$transaction->initializeTransaction($fields); //$fields as to be array
<!-- Example -->
$transaction->initializeTransaction(
$fields = [
'email' => "[email protected]",
'amount' => "20000",
]
);
/// Charge Authorization
$transaction->chargeAuthorization(array); //$field as to be array
/// Check Authorization
$transaction->checkAuthorization(array); //$field as to be array
/// Partial_debits
$transaction->partial_debit(array); //$field as to be array
$transaction->transactionTotal([
'perPage' => 5,
'page' => 1
]);
// List transactions carried out on your integration
$transaction->transactionTotal(array); //$field as to be array
// Get details of a transaction carried out on your integration.
$transaction->transactionTotal(array); //$field as to be array
/// Verify Transaction
$transaction->verifyTransaction(reference); // passing the reference gotten from the initialization of the transaction