PHP code example of techlup / flutterwave
1. Go to this page and download the library: Download techlup/flutterwave 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/ */
techlup / flutterwave example snippets
// Define customer details
$email = '[email protected] ';
$firstName = 'John';
$lastName = 'Doe';
// Create a new customer
$customer = new \Techlup\FlutterWave\Customer();
$customer->email = $email;
$customer->first_name = $firstName;
$customer->last_name= $lastName;
$subscription = new \Techlup\FlutterWave\Subscription($secrete_key);
$response = $subscription->setRedirectUrl($redirect_url)
->setCustomer($customer)
->setPlanId('117407')
->setRef('test')
->setAmount(10)
->setCurrency('KES')
->checkout();
print_r($response);
$subscription = new \Techlup\FlutterWave\Subscription($secrete_key);
$response = $subscription->deactivate('127064');
print_r($response);
$payment = new \Techlup\FlutterWave\Payment($secrete_key);
$response = $payment->setAmount(10)
->setRef('test')
->setCurrency('KES')
->setOptions('card')
->setRedirectUrl($redirect_url)
->setCustomer($customer)
->checkout();
print_r($response);