-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Payment endpoint can now accept client details (which will be saved…
… in Order model); (#46) - Added more tests and fixed some bugs
- Loading branch information
Showing
17 changed files
with
327 additions
and
19 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
database/migrations/2022_03_08_000001_add_client_information_to_order_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,36 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AddClientInformationToOrderTable extends Migration | ||
{ | ||
public function up(): void | ||
{ | ||
Schema::table('orders', function (Blueprint $table) { | ||
$table->string('client_name')->nullable(); | ||
$table->string('client_street')->nullable(); | ||
$table->string('client_postal')->nullable(); | ||
$table->string('client_city')->nullable(); | ||
$table->string('client_country')->nullable(); | ||
$table->string('client_company')->nullable(); | ||
$table->string('client_taxid')->nullable(); | ||
}); | ||
} | ||
|
||
public function down(): void | ||
{ | ||
Schema::table('orders', function (Blueprint $table) { | ||
$table->dropColumn([ | ||
'client_name', | ||
'client_street', | ||
'client_postal', | ||
'client_city', | ||
'client_country', | ||
'client_company', | ||
'client_taxid', | ||
]); | ||
}); | ||
} | ||
} |
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,67 @@ | ||
<?php | ||
|
||
namespace EscolaLms\Cart\Dtos; | ||
|
||
class ClientDetailsDto | ||
{ | ||
protected ?string $name = null; | ||
protected ?string $street = null; | ||
protected ?string $city = null; | ||
protected ?string $postal = null; | ||
protected ?string $country = null; | ||
protected ?string $company = null; | ||
protected ?string $taxid = null; | ||
|
||
public function __construct( | ||
?string $name = null, | ||
?string $street = null, | ||
?string $city = null, | ||
?string $postal = null, | ||
?string $country = null, | ||
?string $company = null, | ||
?string $taxid = null | ||
) { | ||
$this->name = $name; | ||
$this->street = $street; | ||
$this->city = $city; | ||
$this->postal = $postal; | ||
$this->country = $country; | ||
$this->company = $company; | ||
$this->taxid = $taxid; | ||
} | ||
|
||
public function getName(): ?string | ||
{ | ||
return $this->name; | ||
} | ||
|
||
public function getStreet(): ?string | ||
{ | ||
return $this->street; | ||
} | ||
|
||
public function getCity(): ?string | ||
{ | ||
return $this->city; | ||
} | ||
|
||
public function getPostal(): ?string | ||
{ | ||
return $this->postal; | ||
} | ||
|
||
public function getCountry(): ?string | ||
{ | ||
return $this->country; | ||
} | ||
|
||
public function getCompany(): ?string | ||
{ | ||
return $this->company; | ||
} | ||
|
||
public function getTaxid(): ?string | ||
{ | ||
return $this->taxid; | ||
} | ||
} |
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
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
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
Oops, something went wrong.