PHP code example of mhunesi / yii2-iys

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

    

mhunesi / yii2-iys example snippets


'components' => [
    ...
    
    'iys' => [
        'class' => \mhunesi\iys\Iys::className(),
        'url' => 'IYS_URL', // Varsayılan Değer https://api.iys.org.tr
        'username' => 'IYS_USERNAME',
        'password' => 'IYS_PASSWORD',
        'iys_code' => 'IYS_CODE',
        'brand_code' => 'IYS_BRAND_CODE', // Ana Marka. Birden fazla marka ile çalışıyorsanız boş geçebilirsiniz.
    ],
    
    ...
],


/** @var Iys $iys */
$iys = Yii::$app->iys;

$iys->setBrandCode('A Marka Kodu')->consents(); // A Markası İzin İşlemleri
$iys->setBrandCode('B Marka Kodu')->consents(); // B Markası İzin İşlemleri

$iys

/** @var Iys $iys */
$iys = Yii::$app->iys;

$response = $iys->consents()->add([
                'consentDate'    => '2018-02-10 09:30:00',
                'source'         => 'HS_CAGRI_MERKEZI',
                'recipient'      => '+905813334455',
                'recipientType'  => 'BIREYSEL',
                'status'         => 'ONAY',
                'type'           => 'ARAMA',
                'retailerCode '  => 11223344,
                'retailerAccess' => [
                     22233344,
                     44222419,
                     13239987
                ]
            ]);

$response = $iys->consents()->detail(([
                  'recipient'     => '+905813334455',
                  'recipientType' => 'BIREYSEL',
                  'type'          => 'MESAJ',
              ]);

$response = $iys->consents()->addBatch([
             [
                 'consentDate'    => '2018-02-10 09:30:00',
                 'source'         => 'HS_MESAJ',
                 'recipient'      => '+905813334455',
                 'recipientType'  => 'BIREYSEL',
                 'status'         => 'RET',
                 'type'           => 'ARAMA',
                 'retailerCode '  => 11223344,
                 'retailerAccess' => [
                     22233344,
                     44222419,
                     13239987
                 ]
             ],
             [
                 'consentDate'    => '2018-02-10 09:40:00',
                 'source'         => 'HS_WEB',
                 'recipient'      => '[email protected]',
                 'recipientType'  => 'BIREYSEL',
                 'status'         => 'ONAY',
                 'type'           => 'EPOSTA',
                 'retailerCode '  => 11223344,
                 'retailerAccess' => [
                     22233344,
                     44222419,
                     13239987
                 ]
             ],
         ]);

$response = $iys->consents()->requestDetails('73b75030-3a92-4f1e-b247-b0509dbadbfc');

$response = $iys->consents()->changes();

$response = $iys->brands()->all();

$response = $iys->brands()->allIntegratorBrands();

$response = $iys->brands()->oneIntegratorBrand('1111111');

$response = $iys->consents()->overIys([
            'recipient' => '[email protected]',
            'recipientType' => 'BIREYSEL',
            'type' => [
                "EPOSTA"
            ],
            'source' => 'IYS_EPOSTA'
        ]);

$response = $iys->consents()->verificationCode([
            'requestId' => '111ad006-6210-6axx-oa7c-y672f66e2536',
            'verificationCode' => '5AW5XX'
        ]);

$response = $iys->info()->cities();

$response = $iys->info()->cityDetails(34);

$response = $iys->info()->towns();

$response = $iys->info()->townDetails(514);