detsta processing -> move to cart if not successfull, transfer/paymentLater changes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
use \common\components\giro\GiroBase;
|
||||
|
||||
class GiroBankszamla extends GiroBase{
|
||||
|
||||
|
||||
@@ -5,18 +5,43 @@ namespace common\components\giro;
|
||||
use backend\models\GiroKotegForm;
|
||||
class GiroBase {
|
||||
|
||||
/**
|
||||
* @param $input
|
||||
* @param $hossz
|
||||
* @param string $pad_string
|
||||
* @return string
|
||||
*/
|
||||
public function mezoKitolt($input, $hossz, $pad_string = "") {
|
||||
return str_pad($input, $hossz, $pad_string, STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param $input
|
||||
* @param $hossz
|
||||
* @param string $pad_string
|
||||
* @return string
|
||||
*/
|
||||
public function szamKitolt($input, $hossz, $pad_string = "0") {
|
||||
return str_pad($input, $hossz, $pad_string, STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $input
|
||||
* @param $hossz
|
||||
* @param string $pad_string
|
||||
* @return string
|
||||
*/
|
||||
public function szamKitoltJobb($input, $hossz, $pad_string = "0") {
|
||||
return str_pad($input, $hossz, $pad_string, STR_PAD_RIGHT);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $input
|
||||
* @param $hossz
|
||||
* @param string $pad_string
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function szovegKitolt($input, $hossz, $pad_string = " ") {
|
||||
$data = $input;
|
||||
$data = GiroKotegForm::transliterate($data);
|
||||
@@ -28,15 +53,32 @@ class GiroBase {
|
||||
// echo strlen($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function szovegOlvas($row,$start,$length, $padchar = " "){
|
||||
|
||||
/**
|
||||
* @param $row
|
||||
* @param $start
|
||||
* @param $length
|
||||
* @param string $padchar
|
||||
* @return string
|
||||
*/
|
||||
public static function szovegOlvas($row, $start, $length, $padchar = " "){
|
||||
return rtrim(substr($row, $start,$length),$padchar);
|
||||
}
|
||||
|
||||
public static function szamOlvas($row,$start,$length, $padchar = "0"){
|
||||
|
||||
/**
|
||||
* @param $row
|
||||
* @param $start
|
||||
* @param $length
|
||||
* @param string $padchar
|
||||
* @return string
|
||||
*/
|
||||
public static function szamOlvas($row, $start, $length, $padchar = "0"){
|
||||
return ltrim(substr($row, $start,$length),$padchar);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function rekordVege(){
|
||||
return "\r\n";
|
||||
}
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
|
||||
/**
|
||||
*@property common\components\giro\GiroBeszedFej $fej
|
||||
*@property common\components\giro\GiroBeszedLab $lab
|
||||
*@property common\components\giro\GiroBeszedTetel[] $tetelek
|
||||
*@property \common\components\giro\GiroBeszedFej $fej
|
||||
*@property \common\components\giro\GiroBeszedLab $lab
|
||||
*@property \common\components\giro\GiroBeszedTetel[] $tetelek
|
||||
*
|
||||
*/
|
||||
class GiroBeszed extends GiroBase {
|
||||
@@ -18,9 +17,16 @@ class GiroBeszed extends GiroBase {
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
|
||||
public static function createFileContent($number,$datum /**összeállítás dátum*/, $requests, $terhelesiDatum = null) {
|
||||
|
||||
|
||||
/**
|
||||
* @param $number
|
||||
* @param $datum
|
||||
* @param $requests
|
||||
* @param null $terhelesiDatum
|
||||
* @return string
|
||||
*/
|
||||
public static function createFileContent($number, $datum /**összeállítás dátum*/, $requests, $terhelesiDatum = null) {
|
||||
if ( !isset($terhelesiDatum)){
|
||||
$terhelesiDatum = date('Ymd' ,strtotime("+5 day"));
|
||||
}
|
||||
@@ -30,7 +36,12 @@ class GiroBeszed extends GiroBase {
|
||||
$s .= self::createLab($requests);
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $number
|
||||
* @param $daturm
|
||||
* @return string
|
||||
*/
|
||||
public static function createFej($number, $daturm) {
|
||||
$fej = new GiroBeszedFej ();
|
||||
$fej->duplumKod = \Yii::$app->params['ugiro_duplom_kod'];
|
||||
@@ -44,8 +55,13 @@ class GiroBeszed extends GiroBase {
|
||||
|
||||
return $fej->toString ();
|
||||
}
|
||||
|
||||
public static function createTetelek($requests,$terhelesiDatum){
|
||||
|
||||
/**
|
||||
* @param $requests
|
||||
* @param $terhelesiDatum
|
||||
* @return string
|
||||
*/
|
||||
public static function createTetelek($requests, $terhelesiDatum){
|
||||
$s = "";
|
||||
$i = 0;
|
||||
foreach ($requests as $request){
|
||||
@@ -54,10 +70,12 @@ class GiroBeszed extends GiroBase {
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param common\models\TicketInstallmentRequest $request
|
||||
* */
|
||||
* @param \common\models\TicketInstallmentRequest $request
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function createTetel($request,$sorszam,$terhelesiDatum) {
|
||||
$tetel = new GiroBeszedTetel ();
|
||||
$customer = $request->customer;
|
||||
@@ -74,7 +92,11 @@ class GiroBeszed extends GiroBase {
|
||||
|
||||
return $tetel->toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $requests
|
||||
* @return string
|
||||
*/
|
||||
public static function createLab($requests) {
|
||||
$lab = new GiroBeszedLab ();
|
||||
|
||||
@@ -88,8 +110,11 @@ class GiroBeszed extends GiroBase {
|
||||
|
||||
return $lab->toString ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString( ) {
|
||||
$s = "";
|
||||
$s .= $this->fej->toString();
|
||||
|
||||
@@ -2,13 +2,12 @@
|
||||
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @property common\components\giro\GiroDETSTAFej $fej
|
||||
* @property common\components\giro\GiroDETSTALab $lab
|
||||
* @property common\components\giro\GiroDETSTATetel $tetelek
|
||||
* @property \common\components\giro\GiroDETSTAFej $fej
|
||||
* @property \common\components\giro\GiroDETSTALab $lab
|
||||
* @property \common\components\giro\GiroDETSTATetel $tetelek
|
||||
*
|
||||
*/
|
||||
class GiroDETSTA extends GiroBase {
|
||||
@@ -48,11 +47,11 @@ class GiroDETSTA extends GiroBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param common\components\giro\GiroBeszed $beszed
|
||||
* @param \common\components\giro\GiroBeszed $beszed
|
||||
* */
|
||||
public static function createBeszedAnswer($beszed){
|
||||
// /**@var common\components\giro\GiroBeszed $beszed*/
|
||||
$beszed = new GiroBeszed();
|
||||
//$beszed = new GiroBeszed();
|
||||
$detsta = new GiroDETSTA();
|
||||
$detsta->fej = new GiroDETSTAFej();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ namespace common\components\giro;
|
||||
|
||||
|
||||
/**
|
||||
* @property common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* @property \common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property \common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* */
|
||||
class GiroDETSTAFej extends GiroBase{
|
||||
|
||||
@@ -34,7 +34,11 @@ class GiroDETSTAFej extends GiroBase{
|
||||
. $this->rekordVege()
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $row
|
||||
* @return GiroDETSTAFej
|
||||
*/
|
||||
public static function parse($row){
|
||||
$fej = new GiroDETSTAFej();
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace common\components\giro;
|
||||
|
||||
/**
|
||||
*
|
||||
* @property common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* @property \common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property \common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
*
|
||||
*/
|
||||
class GiroDETSTATetel extends GiroBase {
|
||||
@@ -23,7 +23,7 @@ class GiroDETSTATetel extends GiroBase {
|
||||
'99' => "egyéb hiba"
|
||||
];
|
||||
|
||||
public $recordTipus = "01";
|
||||
public $recordTipus = "02";
|
||||
public $tetelSorszam = "0";
|
||||
public $osszeg = "0";
|
||||
public $eredetiTetelElszamolasiDatuma = "";
|
||||
|
||||
Reference in New Issue
Block a user