PHP code example of iamolayemi / laravel-paystack

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

    

iamolayemi / laravel-paystack example snippets


/**
 * Initialize a new payment, and return the response from the api call
 */
Paystack::transaction()->initialize($paymentData)->response();

/**
 * Using the helper function
 */
paystack()->transaction()->initialize($paymentData)->response();

/**
 * Initialize a new payment, and return only the authorization url
 */
Paystack::transaction()->initialize($paymentData)->response('data.authorization_url');

/**
 * Using the helper function
 */
paystack()->transaction()->initialize($paymentData)->response('data.authorization_url');

/**
 * Initialize a new payment, and return the authorization url
 */
Paystack::transaction()->initialize($paymentData)->authorizationURL();

/**
 * Using the helper function
 */
paystack()->transaction()->initialize($paymentData)->authorizationURL();