protected function doPrepareCheckInput() { return array('term' => '123456', 'amount' => '10.00', 'cur' => 'rub', 'city' => 12, 'name' => 'User Name', 'time' => self::time(), 'email' => uniqid() . '@example.com', 'to' => PaymentNumbers::getValidTo(), 'from' => PaymentNumbers::getValidFrom()); }
public static function response() { $list = array(__LINE__ => array('type' => 'check', 'input' => array('term' => '123456', 'amount' => '10.00', 'cur' => 'rub', 'city' => 12, 'name' => 'User Name', 'time' => self::time(), 'email' => uniqid() . '@example.com', 'to' => PaymentNumbers::getValidTo(), 'from' => PaymentNumbers::getValidFrom()), 'dataPayment' => array('term' => '123456', 'type' => 'check', 'code' => '', 'amount' => '10.00', 'cur' => 'rub', 'status' => Status::ENABLED, 'time' => date('Y-m-d H:i:s', self::time()))), __LINE__ => array('type' => 'check', 'input' => array('term' => '123456', 'amount' => '10.00', 'cur' => 'rub', 'city' => 13, 'name' => 'User Name', 'time' => self::time(), 'email' => uniqid() . '@example.com', 'to' => PaymentNumbers::getValidTo(), 'from' => PaymentNumbers::getValidFrom()), 'dataPayment' => array('type' => 'error', 'code' => 1, 'time' => self::time(), 'message' => 'Undefined city id')), __LINE__ => array('type' => 'check', 'input' => array('term' => '123456', 'amount' => '0.00', 'cur' => 'rub', 'city' => 13, 'name' => 'User Name', 'time' => self::time(), 'email' => uniqid() . '@example.com', 'to' => PaymentNumbers::getValidTo(), 'from' => PaymentNumbers::getValidFrom()), 'dataPayment' => array('type' => 'error', 'code' => 901, 'time' => self::time(), 'message' => 'Invalid parameter value (Invalid amount)'))); // sign4all responses foreach ($list as &$value) { if (empty($value['input']['sign'])) { Secure::sign($value['input'], $value['type'], 'secret'); } } return $list; }
<div class="col-md-12"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">[<?php echo Type::CHECK; ?> ] Проверка возможности платежа</h3> </div> <div class="panel-body"> <div class="col-md-4 post-check"> <div class="form-group"> <?php Views::label('from'); Views::text('from', $from = PaymentNumbers::getValidFrom()); ?> </div> <div class="form-group"> <?php Views::label('to'); Views::text('to', $to = PaymentNumbers::getValidTo()); ?> </div> <div class="form-group"> <?php Views::label('city'); Views::text('city', 1); ?>