PHP code example of josan-br / laravel-galax-pay

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

    

josan-br / laravel-galax-pay example snippets


    'providers' => [
        // ...
        \JosanBr\GalaxPay\Providers\GalaxPayServiceProvider::class,
    ];
    

    $app->register(\JosanBr\GalaxPay\Providers\GalaxPayServiceProvider::class);
    

php artisan galax-pay:publish

// ...
'galax_pay_clients' => [
    'ref'          => \JosanBr\GalaxPay\Models\GalaxPayClient::class,
    // Columns
    'model_type'   => 'model_type',
    'model_id'     => 'model_id',
    'galax_id'     => 'galax_id',
    'galax_hash'   => 'galax_hash',
    'webhook_hash' => 'webhook_hash',
],

'galax_pay_sessions' => [
    'ref'          => \JosanBr\GalaxPay\Models\GalaxPaySession::class,
    // Columns
    'scope'        => 'scope',
    'expires_in'   => 'expires_in',
    'token_type'   => 'token_type',
    'access_token' => 'access_token',
    'client_id'    => 'galax_pay_client_id',
]

use JosanBr\GalaxPay\Facades\GalaxPay;

$data = GalaxPay::listCustomers();

$data = GalaxPay::listCustomers([], ['client_galax_id' => $clientGalaxId]);

/**
 * GET example
 * 
 * @var array|\JosanBr\GalaxPay\QueryParams $queryParams
 * @var array|\JosanBr\GalaxPay\Http\Options $options
 */

$res = GalaxPay::listCustomers($queryParams, $options);

/**
 * POST example
 * 
 * @var array|\JosanBr\GalaxPay\Abstracts\Model $data
 * @var array|\JosanBr\GalaxPay\Http\Options $options
 */

$res = GalaxPay::createCustomer($data, $options);

/**
 * PUT example
 * 
 * @var int|string $id
 * @var array|\JosanBr\GalaxPay\Abstracts\Model $data
 * @var array|\JosanBr\GalaxPay\Http\Options $options
 */

$res = GalaxPay::editCustomer($id, $data, $options);

/**
 * DELETE example
 * 
 * @var int|string $id
 * @var array|\JosanBr\GalaxPay\Http\Options $options
 */

$res = GalaxPay::deleteCustomer($id, $options);

php artisan galax-pay:publish