PHP code example of altynbek07 / laravel-uds

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

    

altynbek07 / laravel-uds example snippets




return [
    /**
     * Your company ID from UDS
     */
    'id' => env('UDS_ID'),
    /**
     * Your API Key from UDS
     */
    'key' => env('UDS_KEY'),
    /**
     * This is the API URI path where Uds will be accessible from. Feel free
     * to change this path to anything you like.
     */
    'path' => env('UDS_PATH', 'api/uds'),
    /**
     * These middleware will be assigned to every Uds route, giving you
     * the chance to add your own middleware to this list or change any of
     * the existing middleware. Or, you can simply stick with this list.
     */
    'middleware' => [
        'api',
        // 'auth:api'
    ],
];



namespace Altynbek07\Uds\Facades\Uds;

$settings = Uds::settings();



namespace Altynbek07\Uds\Facades\Uds;

$data = [
    'code' => '3485bf3c-5f9b-42a7-9f25-f102fe464256',
    'receipt' => [
        'total' => 900,
        'cash' => 600,
        'points' => 300
    ]
];

$transaction = Uds::createTransaction($data);



namespace Altynbek07\Uds\Facades\Uds;

$id = 113327216;

$transaction = Uds::refundTransaction($id);



namespace Altynbek07\Uds\Facades\Uds;

$data = [
    'code' => '123456',
    'receipt' => [
        'total' => 900,
        'points' => 0
    ]
];

$transaction = Uds::getTransactionInformation($data);



namespace Altynbek07\Uds\Facades\Uds;

$data = [
    'code' => '123456',
    'exchangeCode' => true
    'total' => 900
];

$customer = Uds::customersFind($data);



namespace Altynbek07\Uds\Facades\Uds;

$id = 9099536206450;

$customer = Uds::customers($id);
bash
php artisan vendor:publish --provider="Altynbek07\Uds\UdsServiceProvider" --tag="config"