bitocredit/php-gateway

A PHP Library for integrate with bitocredit API.

v1.1.1 2022-10-24 07:45 UTC

This package is not auto-updated.

Last update: 2024-05-06 15:22:13 UTC


README

Bitocredit PHP Library

This library used for integrate with Bitocredit api

usage

copy config.sample.php file in your project and rename it to config.php

fill the variables inside config.php file.

and use library like this:

    require "vendor/autoload.php";
    include_once "your_project_path/config.php"; // path to your config.php file
    
    use Bitocredit\PhpGateway\ApiPhp;
    
    // if you set variables inside config file . you don't have to pass constructor values 
    $api = new ApiPhp("base_url" , "your_token");
    $result = $api->createWallet("wallet_id" , "network"); // replace wallet_id with your wallet id and set network type

methods

createWallet

This method used for creating wallet for user

endpoint : https://bitocredit.com/api/create/wallet/{token}

    $result = $api->createWallet("wallet_id" , "network"); // replace wallet_id with your wallet id and set network type

transactionCheck

This method used for check a transaction is confirmed or not

endpoint : https://bitocredit.com/api/transaction/check/{token}

    $result = $api->transactionCheck("transaction_hash" , "wallet_address"); // replace transaction_hash and wallet_address with your transaction hash and wallet address

transactionRecovery

This method used for check a transaction that is lost in blockchain

endpoint : https://bitocredit.com/api/transaction/recovery/{token}

    $result = $api->transactionRecovery("transaction_hash"); // replace transaction_hash with your transaction hash

transactionFee

This method used for check a transaction that is lost in blockchain

endpoint : https://bitocredit.com/api/transaction/fee/{token}

    $result = $api->transactionFee(); 

transactionExample

Please only use this api for test ! it's only an example to show how the server sends data to callback after payment confirmation

endpoint : https://bitocredit.com/api/transaction/example/callback

    $result = $api->transactionExample("transaction_hash"); // replace transaction_hash with your transaction hash