Skip to content

Commit f606f05

Browse files
committed
Integrate saloon php
Signed-off-by: Lloric Mayuga Garcia <lloricode@gmail.com>
1 parent 1b60cb4 commit f606f05

57 files changed

Lines changed: 1618 additions & 1349 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 198 additions & 228 deletions
Large diffs are not rendered by default.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"require": {
2121
"php": "^8.3",
2222
"ext-json": "*",
23-
"guzzlehttp/guzzle": "^7.5.1"
23+
"saloonphp/saloon": "^3.0"
2424
},
2525
"require-dev": {
2626
"composer-runtime-api": "^2.2.2",

src/Client/BaseClient.php

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/Client/Checkout/CheckoutClient.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Client/Checkout/CustomizationClient.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/Client/WebhookClient.php

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/Constant.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Lloricode\Paymaya;
6+
7+
use Lloricode\Paymaya\Enums\Environment;
8+
9+
final class Constant
10+
{
11+
public static Environment $environment;
12+
13+
public static string $secretKey;
14+
15+
public static string $publicKey;
16+
17+
private function __construct() {}
18+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
declare(strict_types=1);
44

5-
namespace Lloricode\Paymaya\Request;
5+
namespace Lloricode\Paymaya\DataTransferObjects;
66

77
use ErrorException;
88
use JsonSerializable;
99
use ReflectionClass;
1010
use ReflectionProperty;
1111

12-
abstract class Base // implements JsonSerializable
12+
abstract class BaseDto // implements JsonSerializable
1313
{
1414
public function __call(string $name, mixed $arguments): static
1515
{
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Lloricode\Paymaya\DataTransferObjects\Checkout\Amount;
6+
7+
use Lloricode\Paymaya\DataTransferObjects\BaseDto;
8+
9+
/**
10+
* @method self setDiscount(float|int|string $discount)
11+
* @method self setServiceCharge(float|int|string $serviceCharge)
12+
* @method self setShippingFee(float|int|string $shippingFee)
13+
* @method self setTax(float|int|string $tax)
14+
* @method self setSubtotal(float|int|string $subtotal)
15+
*/
16+
class AmountDetailDto extends BaseDto
17+
{
18+
public function __construct(
19+
public float|int|string $discount = 0,
20+
public float|int|string $serviceCharge = 0,
21+
public float|int|string $shippingFee = 0,
22+
public float|int|string $tax = 0,
23+
public float|int|string $subtotal = 0,
24+
) {}
25+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Lloricode\Paymaya\DataTransferObjects\Checkout\Amount;
6+
7+
use Lloricode\Paymaya\DataTransferObjects\BaseDto;
8+
9+
/**
10+
* @method self setValue(float $value)
11+
* @method self setDetails(AmountDetailDto $details)
12+
*/
13+
class AmountDto extends BaseDto
14+
{
15+
public function __construct(
16+
public float $value = 0.0,
17+
public ?AmountDetailDto $details = null
18+
) {
19+
$this->details ??= new AmountDetailDto;
20+
}
21+
}

0 commit comments

Comments
 (0)