Skip to content

citrus-soft/dhf-pay-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

dhf-pay-php

PHP SDK to integrate with DHFinance in minutes.

Getting Started

  1. 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).
  2. 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).
  3. Install sdk using composer
 "require": {
        dhfinance/dhf-pay-php": "*"

    }

Create payment

$dhfPay = new DHFPay('<API endpoint>', '<Token>');
$params = [
   "amount"=> 2500000000,
   "comment"=> "test comment"
];
$payment = $dhfPay
   ->payments()
   ->add($params);

Payments List

$dhfPay->payments()->getAll();

Get payments by id

$dhfPay->payments()->getOne($id);

Get transactions list

$dhfPay->transaction()->getAll()

Run tests

Unit tests

./vendor/bin/phpunit tests/DhfTestCasse.php 

For a run integration tests set variables in tests/.env file (see .env.example)

TEST_SERVER_API=<API endpoint>
TEST_SERVER_TOKEN=<token>

then run

./vendor/bin/phpunit tests/DhfInIntegrationTestCasse.php

About

PHP SDK to integrate with DHFinance in minutes

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.4%
  • Shell 0.6%