PHP code example of 3neti / merchant

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

    

3neti / merchant example snippets


$alias = $service->normalize(' shop1 ');
// SHOP1

$service->validate('SHOP1'); // true
$service->validate('shop');  // false

$service->isAvailable('SHOP1');

use LBHurtado\Merchant\Rules\ValidVendorAlias;

$request->validate([
    'alias' => ['

// config/merchant.php

'alias' => [
    'min_length' => 3,
    'max_length' => 8,
    'pattern' => '^[A-Z][A-Z0-9]{2,7}$',
],

'qr_profile' => [
    'default_city' => env('MERCHANT_QR_DEFAULT_CITY', 'Manila'),
    'default_category_code' => env('MERCHANT_QR_DEFAULT_CATEGORY_CODE', '0000'),
    'default_name_template' => env('MERCHANT_QR_DEFAULT_NAME_TEMPLATE', '{name} - {city}'),
    'fallback_name' => env('MERCHANT_QR_FALLBACK_NAME', 'Account Holder'),
    'uppercase' => env('MERCHANT_QR_UPPERCASE', false),
],

$service = new VendorAliasService;

if ($service->isAvailable('SHOP1')) {
    // assign alias
}

$request->validate([
    'alias' => ['