-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from HiEventsDev/revert-127-develop
Send customer data and order metadata to Stripe
- Loading branch information
Showing
10 changed files
with
275 additions
and
7 deletions.
There are no files selected for viewing
118 changes: 118 additions & 0 deletions
118
backend/app/DomainObjects/Generated/StripeCustomerDomainObjectAbstract.php
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,118 @@ | ||
<?php | ||
|
||
namespace HiEvents\DomainObjects\Generated; | ||
|
||
/** | ||
* THIS FILE IS AUTOGENERATED - DO NOT EDIT IT DIRECTLY. | ||
* @package HiEvents\DomainObjects\Generated | ||
*/ | ||
abstract class StripeCustomerDomainObjectAbstract extends \HiEvents\DomainObjects\AbstractDomainObject | ||
{ | ||
final public const SINGULAR_NAME = 'stripe_customer'; | ||
final public const PLURAL_NAME = 'stripe_customers'; | ||
final public const ID = 'id'; | ||
final public const NAME = 'name'; | ||
final public const EMAIL = 'email'; | ||
final public const STRIPE_CUSTOMER_ID = 'stripe_customer_id'; | ||
final public const CREATED_AT = 'created_at'; | ||
final public const UPDATED_AT = 'updated_at'; | ||
final public const DELETED_AT = 'deleted_at'; | ||
|
||
protected int $id; | ||
protected string $name; | ||
protected string $email; | ||
protected string $stripe_customer_id; | ||
protected ?string $created_at = null; | ||
protected ?string $updated_at = null; | ||
protected ?string $deleted_at = null; | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'id' => $this->id ?? null, | ||
'name' => $this->name ?? null, | ||
'email' => $this->email ?? null, | ||
'stripe_customer_id' => $this->stripe_customer_id ?? null, | ||
'created_at' => $this->created_at ?? null, | ||
'updated_at' => $this->updated_at ?? null, | ||
'deleted_at' => $this->deleted_at ?? null, | ||
]; | ||
} | ||
|
||
public function setId(int $id): self | ||
{ | ||
$this->id = $id; | ||
return $this; | ||
} | ||
|
||
public function getId(): int | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function setName(string $name): self | ||
{ | ||
$this->name = $name; | ||
return $this; | ||
} | ||
|
||
public function getName(): string | ||
{ | ||
return $this->name; | ||
} | ||
|
||
public function setEmail(string $email): self | ||
{ | ||
$this->email = $email; | ||
return $this; | ||
} | ||
|
||
public function getEmail(): string | ||
{ | ||
return $this->email; | ||
} | ||
|
||
public function setStripeCustomerId(string $stripe_customer_id): self | ||
{ | ||
$this->stripe_customer_id = $stripe_customer_id; | ||
return $this; | ||
} | ||
|
||
public function getStripeCustomerId(): string | ||
{ | ||
return $this->stripe_customer_id; | ||
} | ||
|
||
public function setCreatedAt(?string $created_at): self | ||
{ | ||
$this->created_at = $created_at; | ||
return $this; | ||
} | ||
|
||
public function getCreatedAt(): ?string | ||
{ | ||
return $this->created_at; | ||
} | ||
|
||
public function setUpdatedAt(?string $updated_at): self | ||
{ | ||
$this->updated_at = $updated_at; | ||
return $this; | ||
} | ||
|
||
public function getUpdatedAt(): ?string | ||
{ | ||
return $this->updated_at; | ||
} | ||
|
||
public function setDeletedAt(?string $deleted_at): self | ||
{ | ||
$this->deleted_at = $deleted_at; | ||
return $this; | ||
} | ||
|
||
public function getDeletedAt(): ?string | ||
{ | ||
return $this->deleted_at; | ||
} | ||
} |
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,7 @@ | ||
<?php | ||
|
||
namespace HiEvents\DomainObjects; | ||
|
||
class StripeCustomerDomainObject extends Generated\StripeCustomerDomainObjectAbstract | ||
{ | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace HiEvents\Models; | ||
|
||
class StripeCustomer extends BaseModel | ||
{ | ||
protected function getCastMap(): array | ||
{ | ||
return []; | ||
} | ||
|
||
protected function getFillableFields(): array | ||
{ | ||
return []; | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
backend/app/Repository/Eloquent/StripeCustomerRepository.php
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,20 @@ | ||
<?php | ||
|
||
namespace HiEvents\Repository\Eloquent; | ||
|
||
use HiEvents\DomainObjects\StripeCustomerDomainObject; | ||
use HiEvents\Models\StripeCustomer; | ||
use HiEvents\Repository\Interfaces\StripeCustomerRepositoryInterface; | ||
|
||
class StripeCustomerRepository extends BaseRepository implements StripeCustomerRepositoryInterface | ||
{ | ||
protected function getModel(): string | ||
{ | ||
return StripeCustomer::class; | ||
} | ||
|
||
public function getDomainObject(): string | ||
{ | ||
return StripeCustomerDomainObject::class; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
backend/app/Repository/Interfaces/StripeCustomerRepositoryInterface.php
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,14 @@ | ||
<?php | ||
|
||
namespace HiEvents\Repository\Interfaces; | ||
|
||
use HiEvents\DomainObjects\StripeCustomerDomainObject; | ||
use HiEvents\Repository\Eloquent\BaseRepository; | ||
|
||
/** | ||
* @extends BaseRepository<StripeCustomerDomainObject> | ||
*/ | ||
interface StripeCustomerRepositoryInterface extends RepositoryInterface | ||
{ | ||
|
||
} |
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
26 changes: 26 additions & 0 deletions
26
backend/database/migrations/2024_08_07_005807_create_stripe_customers_table.php
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,26 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
public function up(): void | ||
{ | ||
Schema::create('stripe_customers', function (Blueprint $table) { | ||
$table->id(); | ||
|
||
$table->string('name'); | ||
$table->string('email'); | ||
$table->string('stripe_customer_id'); | ||
|
||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
|
||
public function down(): void | ||
{ | ||
Schema::dropIfExists('stripe_customers'); | ||
} | ||
}; |