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/Service/MerchantService.php

24 lines
640 B
PHP

<?php
declare(strict_types=1);
namespace App\Service;
use App\Model\Merchant;
class MerchantService extends AbstractService
{
public function createMerchant($params) {
$merchant = new Merchant();
$merchant->username = $params['username'];
$merchant->password = $params['password'];
$merchant->email = $params['email'] ?: '';
$merchant->mobile = $params['mobile'] ?: '';
$merchant->register_at = date('Y-m-d H:i:s');
$merchant->register_ip = $params['ip'] ?: '';
$merchant->status = Merchant::STATUS_ACTIVE;
$merchant->save();
return $merchant;
}
}