Exemplo n.º 1
0
 public function create($attributes)
 {
     if (!isset($attributes['txid']) and !isset($attributes['request_id'])) {
         throw new Exception("TXID or request ID is required", 1);
     }
     if (!isset($attributes['payment_address_id'])) {
         throw new Exception("payment_address_id is required", 1);
     }
     if (!isset($attributes['user_id'])) {
         throw new Exception("user_id is required", 1);
     }
     if (!isset($attributes['destination']) and !isset($attributes['destinations'])) {
         throw new Exception("destination is required", 1);
     }
     if (!isset($attributes['quantity_sat'])) {
         throw new Exception("quantity_sat is required", 1);
     }
     if (!isset($attributes['asset'])) {
         throw new Exception("asset is required", 1);
     }
     if (!isset($attributes['uuid'])) {
         $attributes['uuid'] = Uuid::uuid4()->toString();
     }
     return Send::create($attributes);
 }