PHP SDK to integrate with DHFinance in minutes.
- Sign up - Before you begin, you need to sign up for your payment gateway account (https://pay.dhfi.online as example) and retrieve your store API token (add Store - APIKey Generate) and API url (https://pay.dhfi.online/api/ as example).
- Requirements – To run the SDK, your system will need to have PHP >= 7.2, cURL and Composer installed . We highly recommend having it compiled with the cURL extension and cURL 7.16.2+ compiled with a TLS backend (e.g., NSS or OpenSSL).
- Install sdk using composer
"require": {
dhfinance/dhf-pay-php": "dev-main"
}
$dhfPay = new DHFPay('<API endpoint>', '<Token>');
$params = [
"amount"=> 2500000000,
"comment"=> "test comment"
];
$payment = $dhfPay
->payments()
->add($params);
$dhfPay->payments()->getAll();
$dhfPay->payments()->getOne($id);
$dhfPay->transaction()->getAll()
Install dependencies
composer install
Set variables in tests/.env file (see .env.example)
TEST_SERVER_API=<API endpoint>
TEST_SERVER_TOKEN=<token>
TEST_STORE_ID=<store id>
then run
./vendor/bin/phpunit tests/DhfInIntegrationTestCasse.php