You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
payment/app/Model/Refund.php

36 lines
940 B
PHP

<?php
declare(strict_types=1);
namespace App\Model;
class Refund extends Model
{
public const STATUS_PREPARE = 'PREPARE';
public const STATUS_APPLY_SUCCESS = 'APPLY_SUCCESS';
public const STATUS_APPLY_FAILED = 'APPLY_FAILED';
public const STATUS_CONFIRM_FAILED = 'CONFIRM_FAILED';
public const STATUS_INIT = 'INIT';
public const STATUS_PROCESS = 'PROCESS';
public const STATUS_SUCCESS = 'SUCCESS';
public const STATUS_FAILED = 'FAILED';
protected $table = 'refunds';
protected $casts = [
'org_refund_split_info_list' => 'array',
];
public static $shortStatusAndStatusMap = [
'I' => self::STATUS_INIT,
'P' => self::STATUS_PROCESS,
'S' => self::STATUS_SUCCESS,
'F' => self::STATUS_FAILED,
];
public static function getStatusByShortStatus($shortStatus)
{
return self::$shortStatusAndStatusMap[$shortStatus] ?: null;
}
}