-
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
1 parent
964d137
commit 88896cb
Showing
19 changed files
with
206 additions
and
12 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Shimmer\LaravelTebexCheckout\Resources; | ||
|
||
use Saloon\Contracts\Response; | ||
use Shimmer\LaravelTebexCheckout\Requests\Baskets\CreateBasketRequest; | ||
use Shimmer\LaravelTebexCheckout\Requests\Baskets\GetBasketRequest; | ||
|
||
class BasketResource extends Resource | ||
{ | ||
public function get(string $id): Response | ||
{ | ||
return $this->connector->send(new GetBasketRequest($id)); | ||
} | ||
|
||
public function create(string $returnUrl, string $completeUrl): Response | ||
{ | ||
return $this->connector->send(new CreateBasketRequest($returnUrl, $completeUrl)); | ||
} | ||
} |
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 Shimmer\LaravelTebexCheckout\Resources; | ||
|
||
use Saloon\Contracts\Response; | ||
use Shimmer\LaravelTebexCheckout\Requests\Checkout\CreateCheckoutRequest; | ||
|
||
class CheckoutResource extends Resource | ||
{ | ||
public function create(array $basket, array $items): Response | ||
{ | ||
return $this->connector->send(new CreateCheckoutRequest($basket, $items)); | ||
} | ||
} |
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 Shimmer\LaravelTebexCheckout\Resources; | ||
|
||
use Saloon\Contracts\Response; | ||
use Shimmer\LaravelTebexCheckout\Requests\Baskets\Packages\AddPackageRequest; | ||
use Shimmer\LaravelTebexCheckout\Requests\Baskets\Packages\DeletePackageRequest; | ||
|
||
class PackageResource extends Resource | ||
{ | ||
public function create(string $id, array $package, string $type): Response | ||
{ | ||
return $this->connector->send(new AddPackageRequest($id, $package, $type)); | ||
} | ||
|
||
public function delete(string $id, string $rowID): Response | ||
{ | ||
return $this->connector->send(new DeletePackageRequest($id, $rowID)); | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace Shimmer\LaravelTebexCheckout\Resources; | ||
|
||
use Saloon\Contracts\Response; | ||
use Shimmer\LaravelTebexCheckout\Requests\Payments\GetPaymentRequest; | ||
use Shimmer\LaravelTebexCheckout\Requests\Payments\RefundPaymentRequest; | ||
|
||
class PaymentResource extends Resource | ||
{ | ||
public function get(string $txnID): Response | ||
{ | ||
return $this->connector->send(new GetPaymentRequest($txnID)); | ||
} | ||
|
||
public function refund(string $txnID): Response | ||
{ | ||
return $this->connector->send(new RefundPaymentRequest($txnID)); | ||
} | ||
|
||
public function delete(string $txnID): Response | ||
{ | ||
return $this->refund($txnID); | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
namespace Shimmer\LaravelTebexCheckout\Resources; | ||
|
||
use Saloon\Contracts\Response; | ||
use Shimmer\LaravelTebexCheckout\Requests\RecurringPayments\CancelRecurringPaymentRequest; | ||
use Shimmer\LaravelTebexCheckout\Requests\RecurringPayments\GetRecurringPaymentRequest; | ||
use Shimmer\LaravelTebexCheckout\Requests\RecurringPayments\UpdateRecurringPaymentRequest; | ||
|
||
class RecurringPaymentResource extends Resource | ||
{ | ||
public function get(string $reference): Response | ||
{ | ||
return $this->connector->send(new GetRecurringPaymentRequest($reference)); | ||
} | ||
|
||
public function update(string $reference, array $items): Response | ||
{ | ||
return $this->connector->send(new UpdateRecurringPaymentRequest($reference, $items)); | ||
} | ||
|
||
public function cancel(string $reference): Response | ||
{ | ||
return $this->connector->send(new CancelRecurringPaymentRequest($reference)); | ||
} | ||
|
||
public function delete(string $reference): Response | ||
{ | ||
return $this->cancel($reference); | ||
} | ||
} |
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,12 @@ | ||
<?php | ||
|
||
namespace Shimmer\LaravelTebexCheckout\Resources; | ||
|
||
use Saloon\Contracts\Connector; | ||
|
||
class Resource | ||
{ | ||
public function __construct( | ||
protected Connector $connector | ||
){} | ||
} |
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 Shimmer\LaravelTebexCheckout\Resources; | ||
|
||
use Saloon\Contracts\Response; | ||
use Shimmer\LaravelTebexCheckout\Requests\Baskets\Sales\CreateSaleRequest; | ||
|
||
class SaleResource extends Resource | ||
{ | ||
public function create(string $id, string $name, string $discountType, float $amount): Response | ||
{ | ||
return $this->connector->send(new CreateSaleRequest($id, $name, $discountType, $amount)); | ||
} | ||
} |
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