generated from spatie/package-skeleton-laravel
-
-
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.
- Loading branch information
Morten Bak
committed
Jan 8, 2024
1 parent
b81417c
commit c27468a
Showing
10 changed files
with
234 additions
and
22 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,43 @@ | ||
<?php | ||
|
||
namespace Netbums\Quickpay\DataObjects; | ||
|
||
readonly class PaymentLink | ||
{ | ||
|
||
public function __construct( | ||
public int $id, // transaction id | ||
public int $amount, // Amount to authorize | ||
public ?string $language, | ||
public ?string $continue_url, | ||
public ?string $cancel_url, | ||
public ?string $callback_url, | ||
) | ||
{ | ||
} | ||
|
||
public static function fromArray(array $data): static | ||
{ | ||
return new static( | ||
id: $data['id'], | ||
amount: $data['amount'], | ||
language: $data['language'], | ||
continue_url: $data['continue_url'], | ||
cancel_url: $data['cancel_url'], | ||
callback_url: $data['callback_url'], | ||
); | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'id' => $this->id, | ||
'amount' => $this->amount, | ||
'language' => $this->language, | ||
'continue_url' => $this->continue_url, | ||
'cancel_url' => $this->cancel_url, | ||
'callback_url' => $this->callback_url, | ||
]; | ||
} | ||
|
||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace Netbums\Quickpay\Exceptions; | ||
|
||
use Exception; | ||
|
||
class CreatePaymentFailed extends Exception | ||
{ | ||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace Netbums\Quickpay\Exceptions; | ||
|
||
use Exception; | ||
|
||
class CreatePaymentLinkFailed extends Exception | ||
{ | ||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace Netbums\Quickpay\Exceptions; | ||
|
||
use Exception; | ||
|
||
class DeletePaymentLinkFailed extends Exception | ||
{ | ||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace Netbums\Quickpay\Exceptions; | ||
|
||
use Exception; | ||
|
||
class FetchPaymentFailed extends Exception | ||
{ | ||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace Netbums\Quickpay\Exceptions; | ||
|
||
use Exception; | ||
|
||
class FetchPaymentsFailed extends Exception | ||
{ | ||
} |
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