Subiendo proyecto completo sin restricciones de git ignore
This commit is contained in:
10
vendor/sebacarrasco93/laravel-payku/src/Models/PaykuPayment.php
vendored
Normal file
10
vendor/sebacarrasco93/laravel-payku/src/Models/PaykuPayment.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace SebaCarrasco93\LaravelPayku\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PaykuPayment extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
}
|
||||
43
vendor/sebacarrasco93/laravel-payku/src/Models/PaykuTransaction.php
vendored
Normal file
43
vendor/sebacarrasco93/laravel-payku/src/Models/PaykuTransaction.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace SebaCarrasco93\LaravelPayku\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PaykuTransaction extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
public $incrementing = false;
|
||||
|
||||
public function payment()
|
||||
{
|
||||
return $this->hasOne(PaykuPayment::class, 'transaction_id');
|
||||
}
|
||||
|
||||
public function scopeRegister($query)
|
||||
{
|
||||
$query->where('status', 'register');
|
||||
}
|
||||
|
||||
public function scopeSuccess($query)
|
||||
{
|
||||
$query->where('status', 'success');
|
||||
}
|
||||
|
||||
public function scopePending($query)
|
||||
{
|
||||
$query->where('status', 'pending');
|
||||
}
|
||||
|
||||
public function markAsNotified()
|
||||
{
|
||||
return $this->update(['notified_at' => now()]);
|
||||
}
|
||||
|
||||
public function notifyForFirstTime()
|
||||
{
|
||||
if (! $this->notified_at) {
|
||||
return $this->markAsNotified();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user