Paywith makes it easy to use multiple payment gateways in your PHP application.
You can install the package via composer:
composer require processwith/paywith-php
use ProcessWith\PayWith;
$paywith = new PayWith('Paystack', 'Your Paystack Secret');
$transaction->initialize([
'amount' => 5000,
'email' => 'jeremiahsucceed@gmail.com',
'callback_url' => 'http://localhost:3000/tests/verify',
'currency' => 'NGN'
]);
$transaction->checkout(); // redirect to checkout page
Love more examples, see the example page.
// Paywith must have be initialize with Paystack or Flutterwave
$transaction = $paywith->transaction();
$transaction->verify( $_GET['reference'] );
if( $transaction->status() )
{
// check the email and the amount
// before giving value
$amount = 5000;
$email = 'jeremiah@gmail.com';
if ( $amount == $transaction->getAmount() && $email == $transaction->getEmail() )
{
// give value
// echo 'thanks for making payment';
}
}
// Paywith must have be initialize with Paystack or Flutterwave
$transaction = $paywith->transaction();
$transaction->webhook();
if( $transaction->status() )
{
// check the email and the amount
// before giving value
$amount = 5000;
$email = 'jeremiah@gmail.com';
if ( $amount == $transaction->getAmount() && $email == $transaction->getEmail() )
{
// give value
// echo 'thanks for making payment';
}
}
We are making some plug and play tutorials. If you like to recieve one when it still HOT, click here.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email jeremiah@processwith.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.