A PHP library for interacting with the API of the reservation system Planyo. It abstracts some of the "RESTlessness" of the API away and exposes it in a PHP friendly way.
You can install the package via composer:
composer config repositories.plumillage/planyo-php vcs https://github.com/plumvillage/planyo-php
composer require plumvillage/planyo-php:dev-mainuse PV\Planyo\PlanyoClient;
$planyo = new PlanyoClient('your-api-key');
// Get a reservation
$reservation = $planyo->reservations->retreive(50000123);
// Register a refund
$reservation->refund(500, 'py_1HqIC9Llrb75DEF1234wxyz6', 'Refund for cancellation.');The client accepts the following configuration options:
apiKey: Your Planyo API keybaseUrl: (Optional) Custom API base URL, if you want to use the sandbox.
The library doesn't aim to be exhaustive. Methods will be added as needed.
reservations.retreive(int $id)Reservation.hasCustomProduct($name, $price):Reservation.addCustomProduct(string $name, float $price, bool $recalculate = false):Reservation.addPayment(float $amount, int $status, string $transactionId, string $statusText): Register a payment made for a reservationReservation.refund(float $amount, string $transactionId, string $statusText): Register a refund payment for a reservation
- PHP 7.4 or higher
- Composer
composer install
composer test
- Planyo API documentation
- Illuminate HTTP Client
- This library draws some inpsiration from stripe-php
- Write PHP following the PSR-12 Coding Style Guide.
The MIT License (MIT). Please see License File for more information.