Exemplo n.º 1
0
 public function create($attributes)
 {
     if (!isset($attributes['user_id']) or !$attributes['user_id']) {
         throw new Exception("User ID is required", 1);
     }
     return parent::create($attributes);
 }
Exemplo n.º 2
0
 public function create($attributes)
 {
     if (!isset($attributes['user_id']) or !$attributes['user_id']) {
         throw new Exception("User ID is required", 1);
     }
     if (!isset($attributes['payment_address_id']) or !$attributes['payment_address_id']) {
         throw new Exception("Payment Address ID is required", 1);
     }
     if (!isset($attributes['active'])) {
         $attributes['active'] = true;
     }
     return parent::create($attributes);
 }
Exemplo n.º 3
0
 public function create($attributes)
 {
     if (!isset($attributes['account_id']) or !$attributes['account_id']) {
         throw new Exception("Account ID is required", 1);
     }
     if (!isset($attributes['direction']) or !is_numeric($attributes['direction'])) {
         throw new Exception("direction is required", 1);
     }
     // require either an api call or a transaction
     if ((!isset($attributes['api_call_id']) or !$attributes['api_call_id']) and (!isset($attributes['txid']) or !$attributes['txid'])) {
         throw new Exception("API Call ID or Transaction ID is required", 1);
     }
     if (!isset($attributes['type']) or !$attributes['type']) {
         throw new Exception("Type is required", 1);
     }
     return parent::create($attributes);
 }