Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Nov 10, 2021
1 parent 09da216 commit 37d7ee9
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Base/Bill.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ abstract class Bill extends Request implements Contract
*
* @param \Money\Money|\Duit\MYR|int $amount
* @param \Billplz\Contracts\PaymentCompletion|string $paymentCompletion
* @param array<string, mixed> $optional
*
* @throws \InvalidArgumentException
*/
Expand Down Expand Up @@ -62,6 +63,8 @@ public function get(string $id): Response

/**
* Show an existing bill transactions.
*
* @param array<string, mixed> $optional
*/
public function transaction(string $id, array $optional = []): Response
{
Expand Down
2 changes: 2 additions & 0 deletions src/Base/Bill/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ abstract class Transaction extends Request
{
/**
* Show an existing bill transactions.
*
* @param array<string, mixed> $optional
*/
public function get(string $id, array $optional = []): Response
{
Expand Down
4 changes: 4 additions & 0 deletions src/Base/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ abstract class Collection extends Request implements Contract

/**
* Create a new collection.
*
* @param array<string, mixed> $optional
*/
public function create(string $title, array $optional = []): Response
{
Expand All @@ -31,6 +33,8 @@ public function get(string $id): Response

/**
* Get collection index.
*
* @param array<string, mixed> $optional
*/
public function all(array $optional = []): Response
{
Expand Down
2 changes: 2 additions & 0 deletions src/Base/Collection/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public function get(string $collectionId): Response

/**
* Update payment methods.
*
* @param array<int, string> $codes
*/
public function update(string $collectionId, array $codes = []): Response
{
Expand Down
3 changes: 3 additions & 0 deletions src/Base/OpenCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class OpenCollection extends Request implements Contract
* Create a new open collection.
*
* @param \Money\Money|\Duit\MYR|int $amount
* @param array<string, mixed> $optional
*/
public function create(
string $title,
Expand All @@ -37,6 +38,8 @@ public function get(string $collectionId): Response

/**
* Get open collection index.
*
* @param array<string, mixed> $optional
*/
public function all(array $optional = []): Response
{
Expand Down
4 changes: 4 additions & 0 deletions src/Base/PaymentCompletion.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ trait PaymentCompletion
{
/**
* Parse redirect data for a bill.
*
* @param array<string, array<string, mixed>> $data
*/
public function redirect(array $data = []): ?array
{
Expand Down Expand Up @@ -42,6 +44,8 @@ public function redirect(array $data = []): ?array

/**
* Parse webhook data for a bill.
*
* @param array<string, mixed> $data
*/
public function webhook(array $data = []): ?array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Client extends \Laravie\Codex\Client
/**
* List of supported API versions.
*
* @var array
* @var array<string, string>
*/
protected $supportedVersions = [
'v3' => 'Three',
Expand Down
5 changes: 4 additions & 1 deletion src/Contracts/Bill.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ interface Bill extends Request
* Create a new bill.
*
* @param \Money\Money|\Duit\MYR|int $amount
* @param \Billplz\Contracts\PaymentCompletion|string $paymentCompletion
* @param \Billplz\Contracts\PaymentCompletion|string $paymentCompletion
* @param array<string, mixed> $optional
*
* @throws \InvalidArgumentException
*/
Expand All @@ -33,6 +34,8 @@ public function get(string $id): Response;

/**
* Show an existing bill transactions.
*
* @param array<string, mixed> $optional
*/
public function transaction(string $id, array $optional = []): Response;

Expand Down
2 changes: 2 additions & 0 deletions src/Contracts/Bill/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ interface Transaction extends Request
{
/**
* Show an existing bill transactions.
*
* @param array<string, mixed> $optional
*/
public function get(string $id, array $optional = []): Response;
}
4 changes: 4 additions & 0 deletions src/Contracts/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ interface Collection extends Request
{
/**
* Create a new collection.
*
* @param array<string, mixed> $optional
*/
public function create(string $title, array $optional = []): Response;

Expand All @@ -19,6 +21,8 @@ public function get(string $id): Response;

/**
* Get collection index.
*
* @param array<string, mixed> $optional
*/
public function all(array $optional = []): Response;

Expand Down
2 changes: 2 additions & 0 deletions src/Contracts/Collection/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public function get(string $collectionId): Response;

/**
* Update payment methods.
*
* @param array<int, string> $codes
*/
public function update(string $collectionId, array $codes = []): Response;
}
3 changes: 3 additions & 0 deletions src/Contracts/OpenCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface OpenCollection extends Request
* Create a new open collection.
*
* @param \Money\Money|\Duit\MYR|int $amount
* @param array<string, mixed> $optional
*/
public function create(
string $title,
Expand All @@ -26,6 +27,8 @@ public function get(string $collectionId): Response;

/**
* Get open collection index.
*
* @param array<string, mixed> $optional
*/
public function all(array $optional = []): Response;
}
1 change: 1 addition & 0 deletions src/Contracts/Payout.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ interface Payout extends Request
* Create a new mass payment instruction (mpi).
*
* @param int $total
* @param array<string, mixed> $optional
*/
public function create(
string $collectionId,
Expand Down
3 changes: 3 additions & 0 deletions src/Four/Bill.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Bill extends Request
*
* @param \Money\Money|\Duit\MYR|int $amount
* @param array|string $callbackUrl
* @param array<string, mixed> $optional
*
* @throws \InvalidArgumentException
*/
Expand Down Expand Up @@ -51,6 +52,8 @@ public function get(string $id): Response

/**
* Show an existing bill transactions.
*
* @param array<string, mixed> $optional
*/
public function transaction(string $id, array $optional = []): Response
{
Expand Down
2 changes: 2 additions & 0 deletions src/PaymentCompletion.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public function redirectUrl(): ?string

/**
* Convert to array.
*
* @return array<string, string|null>
*/
public function toArray(): array
{
Expand Down
2 changes: 2 additions & 0 deletions src/Sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class Sanitizer extends \Laravie\Codex\Filter\Sanitizer
{
/**
* Construct a new sanitizer.
*
* @param array<string, class-string<\Laravie\Codex\Contracts\Cast>> $casters
*/
public function __construct(array $casters = [])
{
Expand Down
2 changes: 2 additions & 0 deletions src/Three/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class Collection extends Request

/**
* Create a new collection.
*
* @param array<string, mixed> $optional
*/
public function create(string $title, array $optional = []): Response
{
Expand Down

0 comments on commit 37d7ee9

Please sign in to comment.