Skip to content

Latest commit

 

History

History
85 lines (57 loc) · 1.58 KB

README.md

File metadata and controls

85 lines (57 loc) · 1.58 KB

Utopia Cryptonat

Crypton Donation Library (Utopia Ecosystem)

Installation with Composer

composer require sagleft/utopia-cryptonat

Usage

An instance of the Cryptonat\Handler object is created based on UtopiaLib\Client:

$cryptonat = new Cryptonat\Handler($client);

or

$cryptonat = new Cryptonat\Handler();
$cryptonat->setUtopiaClient($client);

Then try activating the voucher:

$voucher_code = 'UTP-P3FH-OJQZ-7XWI-CAVT-LYDW';
$result = $cryptonat->activateVoucher($voucher_code);
echo json_encode($result);

response example:

{
	"status": "pending",
	"referenceNumber": "367404A95932624C284B16AF1C1EDF1BB0F9CDCA1CC5136B167378BBF933FAD8",
	"amount": 0
}

check voucher status by reference number:

$referenceNumber = '367404A95932624C284B16AF1C1EDF1BB0F9CDCA1CC5136B167378BBF933FAD8'; $result = $cryptonat->checkVoucherStatus($referenceNumber); echo json_encode($result);

response example:

{
	"status": "done",
	"created": "2020-01-14T13:18:21.232",
	"amount": 2,
	"comments": "",
	"direction": 1,
	"trid": "0ZWTT62Z4DO51"
}

scheme

License

Utopia Cryptonat is licensed under The MIT License.


image


udocs