PHP code example of laraditz / payex

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

    

laraditz / payex example snippets


// Create a payment

// Using service container
$payex = app('payex')->createPayment([
            'amount' => '100', //in cents
            'customer_name' => 'Farhan',
            'description' => 'some description here',
            'return_url' => 'https://yourreturn.url'
        ]);

// Using facade
$payment = \Payex::createPayment([
            'amount' => '100', //in cents
            'customer_name' => 'Farhan',
            'description' => 'some description here',
            'return_url' => 'https://yourreturn.url'
        ]);

[
    "status" => true,
    "id" => "991f24s0-5470-41c5-9b3c-9841d72d32e5",
    "ref_no" => "Xvs9k43y",
    "currency_code" => "MYR",
    "key" => "f5e3168fef3b5ed7826c689a37dce58e",
    "payment_url" => "https://api.payex.io/Payment/Form/f5e3168fef3b5ed7826c689a37dce58e"
]
bash
php artisan vendor:publish --provider="Laraditz\Payex\PayexServiceProvider" --tag="config"
bash
php artisan migrate