PHP code example of putianxin / paystack-php

1. Go to this page and download the library: Download putianxin/paystack-php 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/ */

    

putianxin / paystack-php example snippets


\Paystack\Paystack::init('__secret_key_here__');

    $payment = \Paystack\Transaction::initialize([
        'email' => '[email protected]',
        'amount' => '3000'
    ]);

    $customer = \Paystack\Customer::create([
        'email' => '[email protected]',
        'first_name' => 'Perfect',
        'last_name' => 'Makanju',
        'phone' => 'xxxxxxx'
    ]);

    echo 'Customer\'s first name is: '.$customer->first_name;

composer install putianxin/paystack-php