Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
systems:yii2:third_party_components [2018/03/29 10:52] smayr removed |
systems:yii2:third_party_components [2018/08/14 17:00] (current) smayr [yii2-phpspreadsheet PhpSpreadsheet] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | = Yii 2 Basic Application Template | + | = Yii 2.0 Third Party Components |
- | == Improved Password Security == | + | To manage extension using composer, use these commands. |
- | By default, the basic template comes with plain text password support in file '' | + | Add: |
+ | $ composer require " | ||
+ | $ composer update | ||
+ | Remove: | ||
+ | $ composer remove " | ||
+ | $ composer update | ||
+ | Then, remove references | ||
- | Model file '' | + | == Fixing Composer Issues (composer.json ) == |
- | <code php> | + | |
- | class User extends \yii\base\Object implements \yii\web\IdentityInterface | + | |
- | { | + | |
- | public $id; | + | |
- | public $username; | + | |
- | //public $password; | + | |
- | public $authKey; | + | |
- | public $accessToken; | + | |
- | public $passwordHash; | + | |
- | private static | + | Issue: When issuing a '' |
- | '100' => [ | + | |
- | 'id' => '100', | + | Solution: |
- | 'username' => 'admin', | + | <code javascript> |
- | 'authKey' => 'test100key', | + | " |
- | 'accessToken' => '100-token', | + | //... |
- | 'passwordHash' => '$2y$10$/lVWm8iL07.zoBE.7nM8ueDSPiR8XwxyoAuZPfCclPZ3PscOXM.KK' | + | " |
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Add: | ||
+ | <code javascript> | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | </ | ||
+ | == JQuery UI == | ||
+ | |||
+ | To install the JUI extension for Yii2, perform the following steps: | ||
+ | < | ||
+ | $ composer self-update | ||
+ | $ composer require " | ||
+ | $ composer update | ||
+ | $ composer require --prefer-dist yiisoft/ | ||
+ | </ | ||
+ | |||
+ | Usage: | ||
+ | <code php> | ||
+ | <?= $form-> | ||
+ | 'dateFormat' | ||
+ | ' | ||
+ | ' | ||
+ | 'defaultDate' => '+7', //' | ||
+ | 'currentText' => 'Today', | ||
+ | | ||
+ | 'language' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | 'changeMonth' | ||
+ | | ||
+ | ' | ||
+ | ' | ||
+ | | ||
+ | //' | ||
+ | //'htmlOptions' | ||
+ | | ||
+ | // ' | ||
], | ], | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ]) ?> | ||
+ | </ | ||
+ | |||
+ | Note that and empty string and null will result in an empty text field while 0 will be interpreted as a UNIX timestamp and result in a date displayed as 1970-01-01. It is recommended to add a validation filter in your model that sets the value to null in case when no date has been entered: | ||
+ | <code php> | ||
+ | public function rules() | ||
+ | { | ||
+ | return [ | ||
... | ... | ||
+ | [[' | ||
+ | [[' | ||
]; | ]; | ||
- | | + | } |
- | /** | + | </code> |
- | * Find username for specified userid. | + | |
- | * | + | You can format date in your controller, then render the view. In controller: |
- | * @id integer | + | |
- | | + | |
- | | + | See more: |
- | public static function findUsername($id) | + | |
- | { | + | * [[http://www.yiiframework.com/ |
- | $usr = isset(self:: | + | * [[http:// |
- | if (count($usr) | + | |
- | | + | |
- | } else { | + | == ConsoleRunner == |
- | | + | |
- | } | + | To install the ConsoleRunner extension for Yii2, perform the following steps: |
- | } | + | <code> |
- | + | $ composer self-update | |
+ | $ composer require " | ||
+ | </code> | ||
+ | |||
+ | Usage: | ||
+ | Option 1: As Imported class: | ||
+ | |||
+ | <code php> | ||
+ | use vova07\console\ConsoleRunner; | ||
+ | ... | ||
+ | class SiteController extends Controller | ||
+ | { | ||
... | ... | ||
- | | + | public function |
- | /** | + | |
- | * Validates password | + | |
- | * | + | |
- | * @param | + | |
- | * @return boolean if password provided is valid for current user | + | |
- | */ | + | |
- | | + | |
{ | { | ||
- | //return | + | // Usage: |
- | | + | // $cr = new ConsoleRunner([' |
+ | | ||
+ | | ||
+ | $cr-> | ||
} | } | ||
- | } | + | } |
+ | </ | ||
+ | |||
+ | Options 2: As Application component: | ||
+ | <code php> | ||
+ | // config.php | ||
+ | ... | ||
+ | components [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ] | ||
+ | ... | ||
+ | </ | ||
+ | <code php> | ||
+ | // some-file.php | ||
+ | Yii:: | ||
+ | </ | ||
+ | |||
+ | See more: | ||
+ | * [[https:// | ||
+ | |||
+ | == Krajee Kartik' | ||
+ | To install the JUI extension for Yii2, perform the following steps: | ||
+ | < | ||
+ | $ composer self-update | ||
+ | $ composer require " | ||
+ | $ composer update | ||
+ | $ composer require kartik-v/ | ||
+ | </ | ||
+ | |||
+ | See also: | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | |||
+ | == Google Charts == | ||
+ | |||
+ | * Get component from [[https:// | ||
+ | * Install it: | ||
+ | * Automatically: | ||
+ | * Manually: Add reference in '' | ||
+ | < | ||
+ | return array ( | ||
+ | ... | ||
+ | ' | ||
+ | array ( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | array ( | ||
+ | ' | ||
+ | ), | ||
+ | ), | ||
+ | ... | ||
+ | ); | ||
</ | </ | ||
- | Model file '' | + | Pie Chart |
<code php> | <code php> | ||
<?php | <?php | ||
+ | use \fruppel\googlecharts\GoogleCharts; | ||
+ | ... | ||
+ | ?> | ||
- | namespace app\models; | + | <?= GoogleCharts:: |
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ], | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | [' | ||
+ | [' | ||
+ | ], | ||
+ | ], | ||
+ | [ | ||
+ | ' | ||
+ | [' | ||
+ | [' | ||
+ | ] | ||
+ | ], | ||
+ | [ | ||
+ | ' | ||
+ | [' | ||
+ | [' | ||
+ | ] | ||
+ | ], | ||
+ | [ | ||
+ | ' | ||
+ | [' | ||
+ | [' | ||
+ | ] | ||
+ | ], | ||
+ | [ | ||
+ | ' | ||
+ | [' | ||
+ | [' | ||
+ | ] | ||
+ | ], | ||
+ | ] | ||
+ | ], | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ' | ||
+ | ]) ?> | ||
+ | </ | ||
- | use Yii; | + | Area Chart |
- | use yii\base\Model; | + | <code php> |
+ | <?php | ||
+ | use \fruppel\googlecharts\GoogleCharts; | ||
+ | ... | ||
+ | <?= GoogleCharts:: | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ], | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ], | ||
+ | ' | ||
+ | [' | ||
+ | [' | ||
+ | [' | ||
+ | [' | ||
+ | [' | ||
+ | ] | ||
+ | ]) | ||
+ | ?> | ||
+ | </ | ||
- | /** | + | == TCPDF == |
- | * LoginForm is the model behind the login form. | + | |
- | */ | + | |
- | class PasswordForm extends Model | + | |
- | { | + | |
- | //public $username; | + | |
- | public $password; | + | |
- | public $encrypted_password; | + | |
- | //public $rememberMe | + | |
- | | + | * Get component from [[https://github.com/ |
+ | === Automatic Installation === | ||
+ | Automatic installation is NOT recommended (see NOTES below), but these are the steps: | ||
- | /** | + | 1. Run the following command: |
- | * @return array the validation rules. | + | < |
- | */ | + | $ composer require cinghie/yii2-tcpdf " |
- | | + | </code> |
- | { | + | |
- | return [ | + | |
- | [[' | + | |
- | | + | |
- | | + | |
- | | + | |
- | [' | + | |
- | ]; | + | |
- | } | + | |
- | | + | 2. Add reference in '' |
- | * Validates the password. | + | < |
- | * This method | + | " |
- | * | + | ... |
- | * @param string $attribute | + | " |
- | * @param array $params | + | }, |
- | */ | + | </ |
- | | + | |
+ | NOTE: This installation | ||
+ | |||
+ | === Manual Installation === | ||
+ | Manual Installation is the recommended installation method: | ||
+ | |||
+ | 1. Remove | ||
+ | |||
+ | 2. Add reference in your configuration '' | ||
+ | <code php> | ||
+ | ' | ||
+ | ... | ||
+ | // Yii2 TCPDF | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ... | ||
+ | ] | ||
+ | </ | ||
+ | |||
+ | 3. Add reference in '' | ||
+ | <code php> | ||
+ | return array ( | ||
+ | ... | ||
+ | ' | ||
+ | array ( | ||
+ | | ||
+ | //' | ||
+ | ' | ||
+ | //' | ||
+ | ' | ||
+ | array ( | ||
+ | ' | ||
+ | ), | ||
+ | ), | ||
+ | ... | ||
+ | ); | ||
+ | </ | ||
+ | |||
+ | 4. Create controller action. Eg: | ||
+ | <code php> | ||
+ | use yii\web\Response; | ||
+ | ... | ||
+ | class SiteController extends Controller | ||
+ | { | ||
+ | public function actionPdfReport() | ||
{ | { | ||
- | | + | |
- | $this->addError($attribute, | + | |
- | | + | |
- | } | + | |
- | + | ||
- | public function encrypt() | + | |
- | { | + | |
- | if ($this->validate()) { | + | |
- | return password_hash($this-> | + | |
- | //return $this-> | + | |
- | } | + | |
- | return false; | + | |
} | } | ||
} | } | ||
</ | </ | ||
- | Password generation | + | 5. Create |
- | + | ||
- | View '' | + | |
<code php> | <code php> | ||
<?php | <?php | ||
- | /* @var $this yii\web\View | + | /** |
- | /* @var $form yii\bootstrap\ActiveForm | + | * @copyright Copyright & |
- | /* @var $model app\models\PasswordForm | + | * @company Gogodigital - Wide ICT Solutions |
+ | * @website http:// | ||
+ | * @package yii2-tcpdf | ||
+ | * @github https:// | ||
+ | * @license GNU GENERAL PUBLIC LICENSE VERSION 3 | ||
+ | * @tcpdf library 6.0.075 | ||
+ | * @tcpdf documentation http:// | ||
+ | * @tcpdf examples http:// | ||
+ | */ | ||
- | use yii\helpers\Html; | ||
- | use yii\bootstrap\ActiveForm; | ||
- | $this->title = 'Password Encryption'; | + | // Load Component Yii2 TCPDF |
- | $this->params['breadcrumbs'][] = $this->title; | + | \Yii::$app->get(' |
+ | |||
+ | // create new PDF document | ||
+ | $pdf = new TCPDF(PDF_PAGE_ORIENTATION, | ||
+ | |||
+ | // set document information | ||
+ | $pdf->SetCreator(PDF_CREATOR); | ||
+ | $pdf-> | ||
+ | $pdf-> | ||
+ | $pdf-> | ||
+ | $pdf-> | ||
+ | |||
+ | // set header and footer fonts | ||
+ | $pdf-> | ||
+ | $pdf-> | ||
+ | |||
+ | // set default header data | ||
+ | $pdf-> | ||
+ | $pdf-> | ||
+ | |||
+ | // set default monospaced font | ||
+ | $pdf-> | ||
+ | |||
+ | // set margins | ||
+ | $pdf-> | ||
+ | $pdf-> | ||
+ | $pdf-> | ||
+ | |||
+ | // set auto page breaks | ||
+ | $pdf-> | ||
+ | |||
+ | // set image scale factor | ||
+ | $pdf-> | ||
+ | |||
+ | // --------------------------------------------------------- | ||
+ | |||
+ | // set default font subsetting mode | ||
+ | $pdf-> | ||
+ | |||
+ | // Set font | ||
+ | // dejavusans is a UTF-8 Unicode font, if you only need to | ||
+ | // print standard ASCII chars, you can use core fonts like | ||
+ | // helvetica or times to reduce file size. | ||
+ | $pdf-> | ||
+ | |||
+ | // Add a page | ||
+ | // This method has several options, check the source code documentation for more information. | ||
+ | $pdf-> | ||
+ | |||
+ | // set text shadow effect | ||
+ | $pdf-> | ||
+ | |||
+ | // Set some content to print | ||
+ | $html = "< | ||
+ | |||
+ | // Print text using writeHTMLCell() | ||
+ | $pdf->writeHTMLCell(0, | ||
+ | |||
+ | // --------------------------------------------------------- | ||
+ | |||
+ | // Close and output PDF document | ||
+ | // This method has several options, check the source code documentation for more information. | ||
+ | $pdf-> | ||
+ | |||
+ | // | ||
+ | // END OF FILE | ||
+ | // | ||
+ | |||
+ | // Close Yii2 | ||
+ | \Yii:: | ||
?> | ?> | ||
- | <div class=" | + | </code> |
- | <?php if (!empty($encrypted_password)) : ?> | + | |
- | <div class=" | + | |
- | < | + | |
- | </ | + | |
- | <?php endif; ?> | + | |
- | < | + | 6. Test the PDF view: |
+ | * Simple URL: http:// | ||
+ | * Pretty URL: http:// | ||
- | < | + | ==== References ==== |
+ | * [[systems:yii2: | ||
- | | + | == TinyMCE Editor == |
- | ' | + | * Download component from: [[https:// |
- | 'options' => ['class' => 'form-horizontal'], | + | * Install:<code>$ composer require " |
- | 'fieldConfig' => [ | + | * Add widget to your view. |
- | 'template' => " | + | |
- | 'labelOptions' => ['class' => 'col-lg-1 control-label'], | + | Basic example: |
+ | < | ||
+ | <? | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | | ||
+ | | ||
+ | 'toolbar' | ||
+ | alignleft aligncenter alignright alignjustify | | ||
+ | | ||
+ | ' | ||
+ | ], | ||
+ | ]); ?> | ||
+ | </code> | ||
+ | |||
+ | Here is one with more options: | ||
+ | <code php> | ||
+ | <?= $form-> | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ' | ||
+ | // full plugin list: http:// | ||
+ | //' | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | ' | ||
+ | | ||
+ | | ||
+ | [' | ||
], | ], | ||
- | | + | ' |
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ' | ||
+ | [' | ||
+ | [' | ||
+ | ], | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | | ||
+ | | ||
+ | //' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | strikethrough superscript subscript | formats | removeformat' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ' | ||
+ | ], | ||
+ | ]); ?> | ||
+ | </code> | ||
- | <?= $form-> | + | NOTE: |
+ | * Upgrade the TinyMCE editor files by simply replacing the folder | ||
+ | * Add support for media/image file manager using [[http:// | ||
- | <div class=" | + | == Responsive Filemanager |
- | <div class=" | + | |
- | <?= Html:: | + | |
- | </ | + | |
- | </ | + | |
- | <?php ActiveForm::end(); ?> | + | * Download a copy from [[http:// |
+ | * Unpack and upload folder '' | ||
+ | * Create '' | ||
+ | * Create '' | ||
+ | * Edit configuration file '' | ||
+ | * ''' | ||
+ | * ''' | ||
+ | * ''' | ||
+ | * Subscribe to [[http:// | ||
- | </div> | + | Call Options: |
+ | * Open Filemanager. | ||
+ | * Options: '' | ||
+ | * URL: '' | ||
+ | * Select Image: | ||
+ | * Options: '' | ||
+ | * URL: '' | ||
+ | * Select Video: | ||
+ | * Options: '' | ||
+ | * URL: '' | ||
+ | * Select File: | ||
+ | * Options: '' | ||
+ | * URL: '' | ||
+ | |||
+ | Variables: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | === Security === | ||
+ | In the '' | ||
+ | define(' | ||
+ | |||
+ | When set to TRUE, you can only access the RFM using they key in the URL: | ||
+ | <code php> | ||
+ | <input type=" | ||
+ | href=" | ||
+ | value=" | ||
</ | </ | ||
- | View '' | + | When using TinyMCE, add the '' |
<code php> | <code php> | ||
- | | + | ... |
- | ' | + | ' |
+ | ' | ||
+ | //' | ||
+ | ' | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | If requiring access only to a logged users, add all the security checks at beginning of the '' | ||
+ | |||
+ | === Use RFM as Standalone === | ||
+ | |||
+ | In a view: | ||
+ | <code php> | ||
+ | <a type=" | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | === Use RFM in Form Input Field === | ||
+ | |||
+ | In a form in view: | ||
+ | <code php> | ||
+ | <?php | ||
+ | // Load JS script | ||
+ | $this-> | ||
+ | |||
+ | // Bootstrap Modal | ||
+ | $tabImages = '< | ||
+ | |||
+ | // | ||
+ | // Define winModalMediaGallery | ||
+ | // | ||
+ | $tabImages .= '< | ||
+ | $tabImages .= '< | ||
+ | tabindex=" | ||
+ | $tabImages .= '< | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= ' | ||
+ | < | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= ' | ||
+ | | ||
+ | ' | ||
+ | | ||
+ | </ | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= ' | ||
+ | $tabImages .= '</ | ||
+ | $tabImages .= '</ | ||
+ | |||
+ | // | ||
+ | // Intro image (single file) | ||
+ | // | ||
+ | $tabImages .= '< | ||
+ | // Select Image (using Bootstrap Modal window) | ||
+ | $tabImages .= '< | ||
+ | data-target="# | ||
+ | $tabImages .= $form-> | ||
+ | $tabImages .= $form-> | ||
+ | [' | ||
+ | // | ||
+ | ); | ||
+ | |||
+ | // Image Preview | ||
+ | $tabImages .= '<div id=" | ||
+ | if (!empty($model['intro_image' | ||
+ | $tabImages .= '< | ||
+ | } else { | ||
+ | $tabImages .= '< | ||
+ | src="' | ||
+ | } | ||
+ | $tabImages .= '</ | ||
+ | |||
+ | // | ||
+ | // Main image (single file) | ||
+ | // | ||
+ | $tabImages .= '< | ||
+ | // Select Image (using Bootstrap Modal window) | ||
+ | $tabImages .= '< | ||
+ | data-target="# | ||
+ | $tabImages .= $form->field($model, | ||
+ | $tabImages .= $form-> | ||
+ | [' | ||
+ | // | ||
+ | ); | ||
+ | // Image Preview | ||
+ | $tabImages .= '< | ||
+ | if (!empty($model[' | ||
+ | $tabImages .= '< | ||
+ | } else { | ||
+ | $tabImages .= '< | ||
+ | src="' | ||
+ | } | ||
+ | $tabImages .= '</ | ||
+ | $tabImages .= '</ | ||
+ | |||
+ | <?= Tabs:: | ||
' | ' | ||
- | [' | + | [ |
- | // Admin menu only | + | |
- | !Yii:: | + | |
- | | + | 'active' => true |
- | ' | + | |
- | | + | ... |
- | [' | + | [ |
- | ]] : | + | |
- | '' | + | |
+ | ], | ||
], | ], | ||
- | ]); | + | ]); ?> |
- | | + | ?> |
- | ?> | + | <?php |
+ | function getJsFilemanager() | ||
+ | { | ||
+ | | ||
+ | // DOM document ready | ||
+ | $( document ).ready(function() { | ||
+ | // | ||
+ | // Define modal window show.bs.modal event | ||
+ | // | ||
+ | $("# | ||
+ | var button | ||
+ | var fieldName = button.data(" | ||
+ | // | ||
+ | |||
+ | // Update the modal window content. We will use jQuery here, | ||
+ | // but you could use a data binding library or other methods instead. | ||
+ | //var modal = $(this); | ||
+ | // | ||
+ | // | ||
+ | |||
+ | // Update Gallery URL with correct target field_id. | ||
+ | // This is an optional feature, only required when using | ||
+ | // multiple input image fields reusing same Bootstrap modal window. | ||
+ | var url = "' | ||
+ | ' | ||
+ | $("# | ||
+ | // | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | function responsive_filemanager_callback(field_id) | ||
+ | { | ||
+ | // Get URL of selected image (which was stored in specified field) | ||
+ | var url = jQuery("#" | ||
+ | // | ||
+ | |||
+ | // | ||
+ | // Do some work here | ||
+ | // | ||
+ | jQuery("#" | ||
+ | // | ||
+ | |||
+ | $("# | ||
+ | $("# | ||
+ | } | ||
+ | '; | ||
+ | |||
+ | return $jsBlock; | ||
+ | } | ||
</ | </ | ||
- | + | ||
- | Controller '' | + | See also: |
+ | * [[http://getbootstrap.com/ | ||
+ | |||
+ | === Use RFM in TinyMCE Editor === | ||
+ | In a view requiring a text editor, add references to ResponsiveFilemanager in TinyMCE editor: | ||
<code php> | <code php> | ||
- | use app\models\PasswordForm; | + | <?= $form-> |
- | ... | + | ' |
+ | ' | ||
+ | ], | ||
+ | ' | ||
+ | //' | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // full list: http:// | ||
+ | ' | ||
+ | ' | ||
+ | [' | ||
+ | [' | ||
+ | ], | ||
+ | // ResponsiveFileManager plugin settings: | ||
+ | ' | ||
+ | //' | ||
+ | ' | ||
+ | Yii:: | ||
+ | ' | ||
+ | //' | ||
+ | //' | ||
+ | // ' | ||
+ | ' | ||
+ | | ||
+ | ' | ||
+ | | ||
+ | '/ | ||
+ | ], | ||
+ | // Other: | ||
+ | ' | ||
+ | ' | ||
+ | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | | ||
+ | link image media code', | ||
+ | //' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | superscript subscript | formats | removeformat' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ]) ?> | ||
+ | </ | ||
- | class SiteController extends Controller | + | == yii2-photo-gallery == |
- | { | + | Get documentation from: |
- | | + | * [[http:// |
- | { | + | * [[https:// |
- | | + | |
- | 'access' => [ | + | |
- | 'class' => AccessControl:: | + | Install the extension: |
- | 'rules' => [ | + | <code bash> |
- | [ | + | $ composer require --prefer-dist onmotion/ |
- | 'actions' => [..., 'password'], | + | </ |
- | 'allow' => true, | + | |
- | 'roles' => ['@'], | + | Add module to '' |
- | | + | <code php> |
- | ... | + | $config |
+ | | ||
+ | // | ||
+ | ], | ||
+ | | ||
+ | //... | ||
+ | | ||
+ | ' | ||
+ | ], | ||
+ | //... | ||
+ | ], | ||
+ | | ||
+ | ]; | ||
+ | </ | ||
+ | |||
+ | Apply Yii migration: | ||
+ | <code bash> | ||
+ | $ php yii migrate --migrationPath=@vendor/ | ||
+ | </ | ||
+ | |||
+ | Open gallery in your browser: | ||
+ | < | ||
+ | |||
+ | To customize the view (theme), then modify the configuration: | ||
+ | <code php> | ||
+ | 'components' => [ | ||
+ | // | ||
+ | | ||
+ | | ||
+ | ' | ||
+ | | ||
+ | | ||
], | ], | ||
], | ], | ||
- | | + | ], |
- | ]; | + | //... |
- | | + | ], |
- | | + | </ |
+ | After this, copy directory ' | ||
+ | |||
+ | |||
+ | == yii2-menu Menu Manager == | ||
+ | Get documentation from: | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | Install the extension: | ||
+ | <code bash> | ||
+ | $ composer require devtrekker/ | ||
+ | </ | ||
+ | |||
+ | Add module to '' | ||
+ | <code php> | ||
+ | return [ | ||
+ | ... | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ]; | ||
+ | </ | ||
+ | |||
+ | Create database schema. Verify that the db config information is correct, then: | ||
+ | <code bash> | ||
+ | $ php yii migrate/up --migrationPath=@vendor/ | ||
+ | </ | ||
+ | |||
+ | Add the menu to the Nav widget in the layout | ||
+ | <code php> | ||
+ | $menu = new devtrekker\menu\Module([]); | ||
+ | |||
+ | NavBar:: | ||
+ | |||
+ | echo Nav:: | ||
+ | ' | ||
+ | ]); | ||
+ | |||
+ | echo Nav:: | ||
+ | ' | ||
+ | ]); | ||
+ | NavBar:: | ||
+ | </ | ||
+ | |||
+ | Alternatively, | ||
+ | <code php> | ||
+ | $menu = new devtrekker\menu\Module([]); | ||
+ | |||
+ | NavBar:: | ||
+ | | ||
+ | | ||
+ | //' | ||
+ | //' | ||
+ | ' | ||
+ | //' | ||
+ | //' | ||
+ | ' | ||
+ | ], | ||
+ | //' | ||
+ | ]); | ||
+ | $menuItems = [ | ||
+ | [' | ||
... | ... | ||
- | public function actionPassword() | + | ]; |
- | | + | |
- | $encrypted_password | + | // Merge available menu entries into a single menu |
- | $model = new PasswordForm(); | + | // |
- | | + | // |
- | | + | // |
- | $encrypted_password | + | $menuItems |
- | | + | |
+ | echo Nav:: | ||
+ | | ||
+ | ' | ||
+ | ]); | ||
+ | |||
+ | echo Nav:: | ||
+ | ' | ||
+ | ' | ||
+ | //' | ||
+ | ' | ||
+ | ]); | ||
+ | |||
+ | NavBar:: | ||
+ | </ | ||
+ | |||
+ | == yii2-phpexcel PhpExcel == | ||
+ | Get documentation from: | ||
+ | * [[https:// | ||
+ | |||
+ | Install the extension: | ||
+ | <code bash> | ||
+ | $ composer require --prefer-dist moonlandsoft/ | ||
+ | </ | ||
+ | |||
+ | PHPExcel is deprecated. | ||
+ | |||
+ | == yii2-phpspreadsheet PhpSpreadsheet == | ||
+ | Get documentation from: | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | Install the extension: | ||
+ | <code bash> | ||
+ | $ composer require sunmoon/ | ||
+ | </ | ||
+ | == DatePicker == | ||
+ | * run in your project dir: < | ||
+ | $ php composer.phar global require " | ||
+ | $ php composer.phar require --prefer-dist yiisoft/ | ||
+ | </ | ||
+ | * update composer: '' | ||
+ | * In your view file use '' | ||
+ | |||
+ | <code php> | ||
+ | use yii\jui\DatePicker; | ||
+ | ... | ||
+ | <?php | ||
+ | // Today | ||
+ | | ||
+ | date(' | ||
+ | substr($model-> | ||
+ | | ||
+ | ?> | ||
+ | |||
+ | <?= DatePicker:: | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | | ||
+ | ], | ||
+ | ' | ||
+ | ]) ?> | ||
+ | |||
+ | <?= $form-> | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ' | ||
+ | ]) ?> | ||
+ | </ | ||
+ | |||
+ | Example: | ||
+ | <code php> | ||
+ | <?php | ||
+ | // 3 days from today | ||
+ | | ||
+ | date(' | ||
+ | substr($model->ship_date, 0, 10) ); | ||
+ | ?> | ||
+ | |||
+ | <?= $form-> | ||
+ | ' | ||
+ | < | ||
+ | | ||
+ | onclick=" | ||
+ | </ | ||
+ | ])-> | ||
+ | ' | ||
+ | ' | ||
+ | | ||
+ | ' | ||
+ | ' | ||
+ | //' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | //' | ||
+ | //' | ||
+ | //' | ||
+ | // ' | ||
+ | | ||
+ | ], | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ]) ?> | ||
+ | </ | ||
+ | |||
+ | See also: [[# | ||
+ | |||
+ | * [[http:// | ||
+ | |||
+ | |||
+ | == yii2-timepicker TimePicker / DateTimePicker == | ||
+ | Get documentation from: | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | Install the extension: | ||
+ | <code bash> | ||
+ | $ composer require " | ||
+ | </ | ||
+ | |||
+ | Use control in view: | ||
+ | <code php> | ||
+ | <?= \janisto\timepicker\TimePicker:: | ||
+ | //' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ]) ?> | ||
+ | </ | ||
+ | |||
+ | <code php> | ||
+ | <?= $form-> | ||
+ | // All options: http:// | ||
+ | //' | ||
+ | //' | ||
+ | //' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | | ||
+ | //' | ||
+ | ' | ||
+ | ' | ||
+ | //' | ||
+ | //' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
| | ||
- | | + | |
- | ' | + | ' |
- | 'encrypted_password' | + | ' |
- | ]); | + | ] |
+ | ])->label('Due Date' | ||
+ | </ | ||
+ | == yii2-podium Forum == | ||
+ | * Download from: [[https:// | ||
+ | * Get documentation from: [[https:// | ||
+ | |||
+ | Install Role Base Authentication Control (RBAC) in Yii2 for the advanced application: | ||
+ | |||
+ | Make sure these roles get added to User model: | ||
+ | <code php> | ||
+ | ... | ||
+ | class User extends ActiveRecord implements IdentityInterface | ||
+ | { | ||
+ | // Roles | ||
+ | const ROLE_ADMIN | ||
+ | const ROLE_MODERATOR | ||
+ | const ROLE_MEMBER | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Add these lines to the '' | ||
+ | <code php> | ||
+ | return [ | ||
+ | ... | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ' | ||
+ | 'podium' | ||
+ | ' | ||
+ | //' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ]; | ||
+ | </ | ||
+ | |||
+ | === Table Creation === | ||
+ | Start installation: | ||
+ | |||
+ | === Configuration === | ||
+ | * Sign in to Podium using administrator account. | ||
+ | * Go to the Administration section and then click the Settings tab. | ||
+ | * Modify all necessary fields (make sure you set proper Podium " | ||
+ | |||
+ | === Cron Job === | ||
+ | Add and customize the following cron job: | ||
+ | <code bash> | ||
+ | */2 * * * * php / | ||
+ | </ | ||
+ | |||
+ | This will try to send up to 100 emails every other minute. | ||
+ | |||
+ | == ReCaptcha == | ||
+ | Install: | ||
+ | <code php> | ||
+ | $ composer require --prefer-dist " | ||
+ | </ | ||
+ | |||
+ | Add to '' | ||
+ | < | ||
+ | //... | ||
+ | $config = [ | ||
+ | //... | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ], | ||
+ | ]; | ||
+ | //... | ||
+ | </ | ||
+ | |||
+ | Add to form using reCaptcha: | ||
+ | <code php> | ||
+ | // Remove | ||
+ | <?= $form-> | ||
+ | ' | ||
+ | <div class=" | ||
+ | ]) ?> | ||
+ | |||
+ | // Add | ||
+ | <?= $form-> | ||
+ | </ | ||
+ | |||
+ | In the model, add this to the rules() and attributeLabels() methods: | ||
+ | <code php> | ||
+ | public function rules() | ||
+ | { | ||
+ | return [ | ||
+ | [['name', ' | ||
+ | //... | ||
+ | // verifyCode needs to be entered correctly | ||
+ | [' | ||
+ | ]; | ||
+ | } | ||
+ | |||
+ | //... | ||
+ | public function attributeLabels() | ||
+ | { | ||
+ | return [ | ||
+ | // | ||
+ | ' | ||
+ | ]; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | References: [[https:// | ||
+ | |||
+ | == yii2-cookie-consent == | ||
+ | Install: | ||
+ | <code php> | ||
+ | $ composer require cinghie/ | ||
+ | </ | ||
+ | |||
+ | Usage: | ||
+ | <code php> | ||
+ | use cinghie\cookieconsent\widgets\CookieWidget; | ||
+ | |||
+ | <?= CookieWidget:: | ||
+ | ' | ||
+ | ' | ||
+ | | ||
+ | ' | ||
+ | ' | ||
+ | ]); ?> | ||
+ | </ | ||
+ | See: [[https:// | ||
+ | |||
+ | |||
+ | == Yii2 Authorizenet Gateway Extension == | ||
+ | |||
+ | === Installation === | ||
+ | The preferred way to install this extension is through composer. | ||
+ | |||
+ | < | ||
+ | Either run: | ||
+ | <code bash> | ||
+ | php composer.phar require --prefer-dist tenbulls/ | ||
+ | </ | ||
+ | |||
+ | Or add this to the require section of your '' | ||
+ | <code bash> | ||
+ | " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Add this to the '' | ||
+ | <code bash> | ||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
} | } | ||
} | } | ||
</ | </ | ||
+ | |||
+ | Perform a composer update: <code bash> $ composer update </ | ||
+ | |||
+ | === Example === | ||
+ | |||
+ | Include the any of required classes in the controller using it, the funcions calls can be use exactly the shown in [[https:// | ||
+ | <code php> | ||
+ | use AuthorizeNetAIM; | ||
+ | use AuthorizeNetARB; | ||
+ | use AuthorizeNetCIM; | ||
+ | use AuthorizeNetCP; | ||
+ | use AuthorizeNetDPM; | ||
+ | use AuthorizeNetSIM; | ||
+ | use AuthorizeNetSOAP; | ||
+ | use AuthorizeNetTD; | ||
+ | </ | ||
+ | |||
+ | Once the extension is installed, simply use it in a controller : | ||
+ | <code php> | ||
+ | use AuthorizeNetAIM; | ||
+ | ... | ||
+ | define(" | ||
+ | define(" | ||
+ | define(" | ||
+ | |||
+ | class OrderController extends Controller | ||
+ | { | ||
+ | ... | ||
+ | public function actionPay() | ||
+ | { | ||
+ | $sale = new AuthorizeNetAIM; | ||
+ | $sale-> | ||
+ | $sale-> | ||
+ | $sale-> | ||
+ | $response = $sale-> | ||
+ | if ($response-> | ||
+ | echo " | ||
+ | } else { | ||
+ | echo " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Parameters === | ||
+ | <code php> | ||
+ | $loginid | ||
+ | $trankey | ||
+ | $ccnum | ||
+ | $ccexpmonth : 2 digit month string | ||
+ | $ccexpyear | ||
+ | $ccver | ||
+ | $live : Whether to process as a live or test transaction - true : Live Transcation - false : Test Transaction | ||
+ | $amount | ||
+ | $tax : Tax amount charged (if any) | ||
+ | $shipping | ||
+ | $desc : Description of the transaction to be logged into Authorize.net system | ||
+ | $billinginfo: | ||
+ | $email | ||
+ | $phone | ||
+ | $billinginfo: | ||
+ | $invoicenum : The merchant-assigned invoice number for the transaction | ||
+ | $testmode | ||
+ | and to test the AVS response reason code (eg. number 27), submit the test transaction with | ||
+ | the credit card number “4222222222222” and the amount matching the AVS code (eg “27.00.”) | ||
+ | </ | ||
+ | |||
+ | Available fields (and data structure): | ||
+ | <code php> | ||
+ | AuthorizeNetAIM Object | ||
+ | ( | ||
+ | [_x_post_fields: | ||
+ | ( | ||
+ | [version] => 3.1 | ||
+ | [delim_char] => , | ||
+ | [delim_data] => TRUE | ||
+ | [relay_response] => FALSE | ||
+ | [encap_char] => | | ||
+ | [amount] => 0 | ||
+ | [card_num] => 4007000000027 | ||
+ | [exp_date] => 1219 | ||
+ | ) | ||
+ | |||
+ | [_additional_line_items: | ||
+ | ( | ||
+ | ) | ||
+ | |||
+ | [_custom_fields: | ||
+ | ( | ||
+ | ) | ||
+ | |||
+ | [verify_x_fields] => 1 | ||
+ | [_all_aim_fields: | ||
+ | ( | ||
+ | [0] => address | ||
+ | [1] => allow_partial_auth | ||
+ | [2] => amount | ||
+ | [3] => auth_code | ||
+ | [4] => authentication_indicator | ||
+ | [5] => bank_aba_code | ||
+ | [6] => bank_acct_name | ||
+ | [7] => bank_acct_num | ||
+ | [8] => bank_acct_type | ||
+ | [9] => bank_check_number | ||
+ | [10] => bank_name | ||
+ | [11] => card_code | ||
+ | [12] => card_num | ||
+ | [13] => cardholder_authentication_value | ||
+ | [14] => city | ||
+ | [15] => company | ||
+ | [16] => country | ||
+ | [17] => cust_id | ||
+ | [18] => customer_ip | ||
+ | [19] => delim_char | ||
+ | [20] => delim_data | ||
+ | [21] => description | ||
+ | [22] => duplicate_window | ||
+ | [23] => duty | ||
+ | [24] => echeck_type | ||
+ | [25] => email | ||
+ | [26] => email_customer | ||
+ | [27] => encap_char | ||
+ | [28] => exp_date | ||
+ | [29] => fax | ||
+ | [30] => first_name | ||
+ | [31] => footer_email_receipt | ||
+ | [32] => freight | ||
+ | [33] => header_email_receipt | ||
+ | [34] => invoice_num | ||
+ | [35] => last_name | ||
+ | [36] => line_item | ||
+ | [37] => login | ||
+ | [38] => method | ||
+ | [39] => phone | ||
+ | [40] => po_num | ||
+ | [41] => recurring_billing | ||
+ | [42] => relay_response | ||
+ | [43] => ship_to_address | ||
+ | [44] => ship_to_city | ||
+ | [45] => ship_to_company | ||
+ | [46] => ship_to_country | ||
+ | [47] => ship_to_first_name | ||
+ | [48] => ship_to_last_name | ||
+ | [49] => ship_to_state | ||
+ | [50] => ship_to_zip | ||
+ | [51] => split_tender_id | ||
+ | [52] => state | ||
+ | [53] => tax | ||
+ | [54] => tax_exempt | ||
+ | [55] => test_request | ||
+ | [56] => tran_key | ||
+ | [57] => trans_id | ||
+ | [58] => type | ||
+ | [59] => version | ||
+ | [60] => zip | ||
+ | ) | ||
+ | |||
+ | [_api_login: | ||
+ | [_transaction_key: | ||
+ | [_post_string: | ||
+ | [VERIFY_PEER] => 1 | ||
+ | [_sandbox: | ||
+ | [_log_file: | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | === Response === | ||
+ | <code php> | ||
+ | $response : Array (1 based) containing the Payment Gateway Reasons fields | ||
+ | |||
+ | // Important Response Values | ||
+ | $response[1] | ||
+ | $response[2] | ||
+ | $response[3] | ||
+ | $response[4] | ||
+ | $response[5] | ||
+ | $response[6] | ||
+ | (A, P, W, X, Y, Z are default AVS confirmation settings - Use your Authorize.net Merchant Interface to change these settings) | ||
+ | (B, E, G, N, R, S, U are default AVS rejection settings - Use your Authorize.net Merchant Interface to change these settings) | ||
+ | $response[7] | ||
+ | $response[8] | ||
+ | $response[9] | ||
+ | $response[10] = Transaction Amount (Merchant assigned amount for the transaction) | ||
+ | $response[11] = Payment method (CC, ECHECK) | ||
+ | $response[12] = Transaction type (AUTH_CAPTURE, | ||
+ | $response[13] = Customer ID (Merchant-assigned) | ||
+ | $response[14] = First name associated with the customer’s billing address | ||
+ | $response[15] = Last name associated with the customer’s billing address | ||
+ | $response[16] = Company associated with the customer’s billing address | ||
+ | $response[17] = Street for customer’s billing address | ||
+ | $response[18] = City for customer’s billing address | ||
+ | $response[19] = State for customer’s billing address | ||
+ | $response[20] = ZIP Code for customer’s billing address | ||
+ | $response[21] = Country for customer’s billing address | ||
+ | $response[22] = Phone for customer’s billing address | ||
+ | $response[23] = Fax for customer’s billing address | ||
+ | $response[24] = Email | ||
+ | $response[25] = First name for shipping address | ||
+ | $response[26] = Last name for shipping address | ||
+ | $response[27] = Company name for shipping address | ||
+ | $response[28] = Street for shipping address | ||
+ | $response[29] = City for shipping address | ||
+ | $response[30] = State for shipping address | ||
+ | $response[31] = ZIP Code for shipping address | ||
+ | $response[32] = Country for shipping address | ||
+ | $response[33] = Tax | ||
+ | $response[34] = Duty | ||
+ | $response[35] = Freight | ||
+ | $response[36] = Tax Exempt | ||
+ | $response[37] = Purchase Order Number | ||
+ | $response[38] = MD5 Hash (Gateway generated MD5 has used to authenticate transaction response) | ||
+ | $response[39] = Card Code Response (CCV Card Code Verification response code: | ||
+ | M = Match, N = No Match, P = No Processed, S = Should have been present, U = Issuer unable to process request) | ||
+ | $response[40] = Cardholder Authentication Verification Response | ||
+ | $response[51] = Account Number (Last 4-digits Cr Card Number with XXXX prefix) | ||
+ | $response[52] = Card Type (Visa, MasterCard, American Express, Discover) | ||
+ | $response[53] = Split Tender ID | ||
+ | $response[54] = Requested Amount | ||
+ | $response[55] = Balance on card | ||
+ | </ | ||
+ | |||
+ | For more information about the Authorize.net AIM response consult their | ||
+ | AIM Implementation Guide at http:// | ||
+ | go to Section Four : Fields in the Payment Gateway Response for more details. | ||
+ | |||
+ | Available response: | ||
+ | <code php> | ||
+ | AuthorizeNetAIM_Response Object | ||
+ | ( | ||
+ | [_response_array: | ||
+ | ( | ||
+ | [0] => 3 | ||
+ | [1] => 2 | ||
+ | [2] => 13 | ||
+ | [3] => The merchant login ID or password is invalid or the account is inactive. | ||
+ | [4] => | ||
+ | [5] => P | ||
+ | [6] => 0 | ||
+ | [7] => | ||
+ | [8] => | ||
+ | [9] => 0.00 | ||
+ | [10] => | ||
+ | [11] => auth_capture | ||
+ | [12] => | ||
+ | [13] => | ||
+ | [14] => | ||
+ | [15] => | ||
+ | [16] => | ||
+ | [17] => | ||
+ | [18] => | ||
+ | [19] => | ||
+ | [20] => | ||
+ | [21] => | ||
+ | [22] => | ||
+ | [23] => | ||
+ | [24] => | ||
+ | [25] => | ||
+ | [26] => | ||
+ | [27] => | ||
+ | [28] => | ||
+ | [29] => | ||
+ | [30] => | ||
+ | [31] => | ||
+ | [32] => | ||
+ | [33] => | ||
+ | [34] => | ||
+ | [35] => | ||
+ | [36] => | ||
+ | [37] => F68A9C87C1E1472521704EF38C21F647 | ||
+ | [38] => | ||
+ | [39] => | ||
+ | [40] => | ||
+ | [41] => | ||
+ | [42] => | ||
+ | [43] => | ||
+ | [44] => | ||
+ | [45] => | ||
+ | [46] => | ||
+ | [47] => | ||
+ | [48] => | ||
+ | [49] => | ||
+ | [50] => | ||
+ | [51] => | ||
+ | [52] => | ||
+ | [53] => | ||
+ | [54] => | ||
+ | [55] => | ||
+ | [56] => | ||
+ | [57] => | ||
+ | [58] => | ||
+ | [59] => | ||
+ | [60] => | ||
+ | [61] => | ||
+ | [62] => | ||
+ | [63] => | ||
+ | [64] => | ||
+ | [65] => | ||
+ | [66] => | ||
+ | [67] => | ||
+ | [68] => | ||
+ | ) | ||
+ | |||
+ | [approved] => | ||
+ | [declined] => | ||
+ | [error] => 1 | ||
+ | [held] => | ||
+ | [response_code] => 3 | ||
+ | [response_subcode] => 2 | ||
+ | [response_reason_code] => 13 | ||
+ | [response_reason_text] => The merchant login ID or password is invalid or the account is inactive. | ||
+ | [authorization_code] => | ||
+ | [avs_response] => P | ||
+ | [transaction_id] => 0 | ||
+ | [invoice_number] => | ||
+ | [description] => | ||
+ | [amount] => 0.00 | ||
+ | [method] => | ||
+ | [transaction_type] => auth_capture | ||
+ | [customer_id] => | ||
+ | [first_name] => | ||
+ | [last_name] => | ||
+ | [company] => | ||
+ | [address] => | ||
+ | [city] => | ||
+ | [state] => | ||
+ | [zip_code] => | ||
+ | [country] => | ||
+ | [phone] => | ||
+ | [fax] => | ||
+ | [email_address] => | ||
+ | [ship_to_first_name] => | ||
+ | [ship_to_last_name] => | ||
+ | [ship_to_company] => | ||
+ | [ship_to_address] => | ||
+ | [ship_to_city] => | ||
+ | [ship_to_state] => | ||
+ | [ship_to_zip_code] => | ||
+ | [ship_to_country] => | ||
+ | [tax] => | ||
+ | [duty] => | ||
+ | [freight] => | ||
+ | [tax_exempt] => | ||
+ | [purchase_order_number] => | ||
+ | [md5_hash] => F68A9C87C1E1472521704EF38C21F647 | ||
+ | [card_code_response] => | ||
+ | [cavv_response] => | ||
+ | [account_number] => | ||
+ | [card_type] => | ||
+ | [split_tender_id] => | ||
+ | [requested_amount] => | ||
+ | [balance_on_card] => | ||
+ | [response] => |3|, | ||
+ | [error_message] => AuthorizeNet Error: | ||
+ | Response Code: 3 | ||
+ | Response Subcode: 2 | ||
+ | Response Reason Code: 13 | ||
+ | Response Reason Text: The merchant login ID or password is invalid or the account is inactive. | ||
+ | | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | === Notes === | ||
+ | This component is meant to abstract payment processing on a website. | ||
+ | As varying sites require different requirements for information, | ||
+ | or card processing (like changing Address Verification requirement) the | ||
+ | component does not try to provide any logic to determine if a transaction | ||
+ | was successful. It is up to the user implementing this code to process the | ||
+ | response array and provide response accordingly. | ||
+ | |||
+ | === Troubleshooting === | ||
+ | |||
+ | Error 13: The merchant login ID or password is invalid or the account is inactive. | ||
+ | Categories: Integration , Server Integration Method (SIM) , Advanced Integration Method (AIM) | ||
+ | |||
+ | **Answer** | ||
+ | |||
+ | **Response Reason Code:** 13 | ||
+ | |||
+ | **Response Reason Text:** The merchant Login ID is invalid or the account is inactive. | ||
+ | |||
+ | This error indicates you are either posting the incorrect API Login ID within your script, connecting to a server that does not recognize your account, or using an account that is inactive. Please follow these steps to ensure that your software is connecting correctly: | ||
+ | |||
+ | * If you are posting your transaction requests to our Sandbox URL, [[https:// | ||
+ | |||
+ | * If you are submitting your transactions using the HTTP POST method, make sure you are including your name-value pairs in the HTTP body. Do not use parameterized URLs: our servers will not recognize parameters in a URL submitted via HTTP POST, and there are security concerns with using parameterized URLs to submit sensitive details. | ||
+ | * Please check your script and verify you are posting the correct API Login ID for your account. Make sure to manually type the API Login ID, to reduce the risk of copying errors. If you are not posting the correct API Login ID, or if you are not sending an API Login ID, please edit the script and confirm that the field x_login is set to the API Login ID that you may obtain from the Authorize.Net Merchant Interface. For further information on the API Login ID, Transaction Key, or Test Mode, please check out our online video tutorials at [[http:// | ||
+ | |||
+ | * If you are unable to log into your Authorize.Net Merchant Interface, this could indicate that your account is inactive. If this is the case please contact Authorize.Net Customer Support. | ||
+ | * More details: [[https:// | ||
+ | |||
+ | ==== References ==== | ||
+ | * [[https:// | ||
+ | |||
+ | |||
+ |