Revision #3 was created by yasen on Dec 22, 2012, 8:22:27 PM.
pts
Content
[...]
}
```
Implementation
-------------- 1I. In the view script add the following hidden fields:
```php
[...]
echo CHtml::hiddenField('URL_CANCEL',Yii::app()->createAbsoluteUrl('order/canceled'));
``` 2II. Further down in the same view file we will put JavaScript code that will send request to OrderController::actionCreate() to create the order record in the database and on success we will send another request to OrderController::actionEpayData() to generate the needed data for the hidden fields ENCODING and CHECKSUM.
```php
[...]
},'json');
``` 3III. In the class OrderController add these methods:
```php
[...]
}
``` 4IV. Create a file in protected/components/EpayBg.php
```php
[...]
}
``` 5V. The Order model would start with:
```php
class Order extends CActiveRecord
{
const STATUS_INITIATED = 1;