Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/job-board.corals.io/vendor/xendit/xendit-php/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/job-board.corals.io/vendor/xendit/xendit-php/src/Disbursements.php
<?php

/**
 * Disbursements.php
 * php version 7.2.0
 *
 * @category Class
 * @package  Xendit
 * @author   Ellen <[email protected]>
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     https://api.xendit.co
 */

namespace Xendit;

/**
 * Class Disbursements
 *
 * @category Class
 * @package  Xendit
 * @author   Ellen <[email protected]>
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     https://api.xendit.co
 */
class Disbursements
{
    use ApiOperations\Request;
    use ApiOperations\Create;
    use ApiOperations\Retrieve;

    /**
     * Instantiate base URL
     *
     * @return string
     */
    public static function classUrl()
    {
        return '/disbursements';
    }

    /**
     * Instantiate required params for Create
     *
     * @return array
     */
    public static function createReqParams()
    {
        return [
            'external_id',
            'bank_code',
            'account_holder_name',
            'account_number',
            'description',
            'amount'
        ];
    }

    /**
     * Send a create batch request
     *
     * @param array $params user's params
     *
     * @return array[
     * 'created'=> string,
     * 'reference'=> string,
     * 'total_uploaded_amount'=> int,
     * 'total_uploaded_count'=> int,
     * 'status'=> 'NEEDS_APPROVAL',
     * 'id'=> string
     * ]
     * @throws Exceptions\ApiException
     */
    public static function createBatch($params = [])
    {
        $requiredParams = ['reference', 'disbursements'];

        self::validateParams($params, $requiredParams);

        $url = '/batch_disbursements';

        return static::_request('POST', $url, $params);
    }

    /**
     * Send GET request to retrieve data by external id
     *
     * @param string $external_id external id
     *
     * @return array[
     *  [
     * 'user_id'=> '5785e6334d7b410667d355c4',
     * 'external_id'=> 'disbursement_12345',
     * 'amount'=> 500000,
     * 'bank_code'=> 'BCA',
     * 'account_holder_name'=> 'Rizky',
     * 'disbursement_description'=> 'Custom description',
     * 'status'=> 'PENDING',
     * 'id'=> '57c9010f5ef9e7077bcb96b6'
     * ],[
     * 'user_id'=> '5785e6334d7b410667d355c4',
     * 'external_id'=> 'disbursement_12345',
     * 'amount'=> 450000,
     * 'bank_code'=> 'BNI',
     * 'account_holder_name'=> 'Jajang',
     * 'disbursement_description'=> 'Custom description',
     * 'status'=> 'COMPLETED',
     * 'id'=> '5a963089fd5fe5b6508f0b7b',
     * 'email_to'=> ['[email protected]','[email protected]'],
     * 'email_cc'=> ['[email protected]'],
     * 'email_bcc'=> ['[email protected]']
     * ]
     * ]
     * @throws Exceptions\ApiException
     */
    public static function retrieveExternal($external_id, $params = [])
    {
        $url = static::classUrl() . '?external_id=' . $external_id;
        return static::_request('GET', $url, $params);
    }

    /**
     * Send GET request to retrieve available banks
     *
     * @return array[
     * [
     * 'name'=> 'Bank Mandiri',
     * 'code'=> 'MANDIRI',
     * 'can_disburse'=> true,
     * 'can_name_validate'=> true
     * ],[
     * 'name'=> 'Bank Rakyat Indonesia (BRI)',
     * 'code'=> 'BRI',
     * 'can_disburse'=> true,
     * 'can_name_validate'=> true
     * ],[
     * 'name'=> 'Bank Central Asia (BCA)',
     * 'code'=> 'BCA',
     * 'can_disburse'=> true,
     * 'can_name_validate'=> true
     * ]]
     * @throws Exceptions\ApiException
     */
    public static function getAvailableBanks()
    {
        $url = '/available_disbursements_banks';
        return static::_request('GET', $url);
    }
}

Spamworldpro Mini