Beispiel #1
0
 public static function refund($accountId, $refundInfo)
 {
     $refund = new self();
     $refundNumber = StringUtil::getUniqueCode('refund', 'T');
     $refund->transactionId = empty($refundInfo['transactionId']) ? '' : $refundInfo['transactionId'];
     $refund->refundNumber = $refundNumber;
     $refund->accountId = $accountId;
     $refund->orderNumber = $refundInfo['orderNumber'];
     $refund->expectedAmount = $refundInfo['expectedAmount'];
     $refund->realAmount = $refundInfo['realAmount'];
     $refund->admin = $refundInfo['admin'];
     $refund->user = $refundInfo['user'];
     $refund->refundMode = $refundInfo['refundMode'];
     $refund->refundAt = empty($refundInfo['refundAt']) ? new MongoDate() : new MongoDate(TimeUtil::ms2sTime($refundInfo['refundAt']));
     $comments = empty($refundInfo['comments']) ? '' : $refundInfo['comments'];
     $refund->comments = $comments;
     $refund->subject = $refundInfo['subject'];
     return $refund->Save();
 }