-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manage user transactions + webhook events (#1)
* Add transactions table + Handle webhook events
- Loading branch information
Showing
20 changed files
with
1,309 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Devinweb\LaravelYoucanPay\Database\Factories; | ||
|
||
use Devinweb\LaravelYoucanPay\Enums\YouCanPayStatus; | ||
use Devinweb\LaravelYoucanPay\LaravelYoucanPay; | ||
use Devinweb\LaravelYoucanPay\Models\Transaction; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use Illuminate\Support\Str; | ||
|
||
class TransactionFactory extends Factory | ||
{ | ||
/** | ||
* The name of the factory's corresponding model. | ||
* | ||
* @var string | ||
*/ | ||
protected $model = Transaction::class; | ||
|
||
/** | ||
* Define the model's default state. | ||
* | ||
* @return array | ||
*/ | ||
public function definition() | ||
{ | ||
$model = LaravelYoucanPay::$customerModel; | ||
|
||
return [ | ||
(new $model)->getForeignKey() => ($model)::factory(), | ||
'name' => 'default', | ||
'order_id' => Str::random(40), | ||
'youcanpay_id' => Str::random(40), | ||
'status' => YouCanPayStatus::PAID(), | ||
'price' => null, | ||
'payload'=> [] | ||
]; | ||
} | ||
} |
Oops, something went wrong.