dojo-engineering / dojo-php
The official Dojo PHP library, supporting PHP 7.4+
v1.1.0
2023-12-06 10:07 UTC
Requires
- php: >=7.4
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2024-11-21 15:23:47 UTC
README
The official Dojo PHP library, supporting Payments API.
Installation
Use Composer to install the Dojo PHP library:
composer require dojo-engineering/dojo-php
Build source code
In order to build, PHP 7.4+ is required. Alternatively, use the VSCode devcontainer. Do the following:
- Run:
composer install
- Run from the root of the repository (with
execute
permission):
./build/generate-openapi.sh
- Copy all files from
/generated/src
into/src
Documentation
For a comprehensive list of examples, check out the API documentation.
Usage
use Dojo_PHP\ApiFactory; $apiKey = "YOUR_API_KEY"; $apiPaymentIntent = ApiFactory::createPaymentIntentApi($apiKey); $req = new CreatePaymentIntentRequest(); $req->setReference("test"); $money = new Money(); $money->setValue(100); $money->setCurrencyCode("GBP"); $req->setAmount($money); $pi = $apiPaymentIntent->paymentIntentsCreatePaymentIntent(\Dojo_PHP\API_VERSION, $req);
For any requests, bugs, or comments, please open an issue or submit a pull request. You can also reach out to us on our Discord server.