public function fundTransfers(
        $oauth_token,
        $amount,
        $sourceAccountNumber,
        $beneficiaryAccountNumber,
        $referenceID,
        $remark1,
        $remark2,
        $transactionID
    ) {
        $corp_id = $this->settings['corp_id'];
        $apikey = $this->settings['api_key'];
        $secret = $this->settings['secret_key'];

        $uriSign = "POST:/banking/corporates/transfers";
        
        $isoTime = self::generateIsoTime();

        $headers                    = array();
        $headers['Accept']          = 'application/json';
        $headers['Content-Type']    = 'application/json';
        $headers['Authorization']   = "Bearer $oauth_token";
        $headers['X-BCA-Key']       = $apikey;
        $headers['X-BCA-Timestamp'] = $isoTime;

        $request_path = "banking/corporates/transfers";
        $domain       = $this->ddnDomain();
        $full_url     = $domain . $request_path;

        $bodyData                             = array();
        $bodyData['Amount']                   = $amount;
        $bodyData['BeneficiaryAccountNumber'] = strtolower(str_replace(' ', '', $beneficiaryAccountNumber));
        $bodyData['CorporateID']              = strtolower(str_replace(' ', '', $corp_id));
        $bodyData['CurrencyCode']             = 'idr';
        $bodyData['ReferenceID']              = strtolower(str_replace(' ', '', $referenceID));
        $bodyData['Remark1']                  = strtolower(str_replace(' ', '', $remark1));
        $bodyData['Remark2']                  = strtolower(str_replace(' ', '', $remark2));
        $bodyData['SourceAccountNumber']      = strtolower(str_replace(' ', '', $sourceAccountNumber));
        $bodyData['TransactionDate']          = $isoTime;
        $bodyData['TransactionID']            = strtolower(str_replace(' ', '', $transactionID));

        // Harus disort agar mudah kalkulasi HMAC
        ksort($bodyData);

        $authSignature = self::generateSign($uriSign, $oauth_token, $secret, $isoTime, $bodyData);

        $headers['X-BCA-Signature'] = $authSignature;

        \Unirest\Request::curlOpts(array(
            CURLOPT_SSL_VERIFYHOST => 0,
            CURLOPT_SSLVERSION => 6,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_TIMEOUT => $this->settings['timeout'] !== 30 ? $this->settings['timeout'] : 30
        ));

        // Supaya jgn strip "ReferenceID" "/" jadi "/\" karena HMAC akan menjadi tidak cocok
        $encoderData = json_encode($bodyData, JSON_UNESCAPED_SLASHES);

        $body     = \Unirest\Request\Body::form($encoderData);
        $response = \Unirest\Request::post($full_url, $headers, $body);

        return $response;
    }
public function fundTransfers(
        $oauth_token,
        $amount,
        $sourceAccountNumber,
        $beneficiaryAccountNumber,
        $referenceID,
        $remark1,
        $remark2,
        $transactionID
    ) {
        $corp_id = $this->settings['corp_id'];
        $apikey = $this->settings['api_key'];
        $secret = $this->settings['secret_key'];

        $uriSign = "POST:/banking/corporates/transfers";
        
        $isoTime = self::generateIsoTime();

        $headers                    = array();
        $headers['Accept']          = 'application/json';
        $headers['Content-Type']    = 'application/json';
        $headers['Authorization']   = "Bearer $oauth_token";
        $headers['X-BCA-Key']       = $apikey;
        $headers['X-BCA-Timestamp'] = $isoTime;

        $request_path = "banking/corporates/transfers";
        $domain       = $this->ddnDomain();
        $full_url     = $domain . $request_path;

        $bodyData                             = array();
        $bodyData['Amount']                   = $amount;
        $bodyData['BeneficiaryAccountNumber'] = strtolower(str_replace(' ', '', $beneficiaryAccountNumber));
        $bodyData['CorporateID']              = strtolower(str_replace(' ', '', $corp_id));
        $bodyData['CurrencyCode']             = 'idr';
        $bodyData['ReferenceID']              = strtolower(str_replace(' ', '', $referenceID));
        $bodyData['Remark1']                  = strtolower(str_replace(' ', '', $remark1));
        $bodyData['Remark2']                  = strtolower(str_replace(' ', '', $remark2));
        $bodyData['SourceAccountNumber']      = strtolower(str_replace(' ', '', $sourceAccountNumber));
        $bodyData['TransactionDate']          = $isoTime;
        $bodyData['TransactionID']            = strtolower(str_replace(' ', '', $transactionID));

        // Harus disort agar mudah kalkulasi HMAC
        ksort($bodyData);

        $authSignature = self::generateSign($uriSign, $oauth_token, $secret, $isoTime, $bodyData);

        $headers['X-BCA-Signature'] = $authSignature;

        \Unirest\Request::curlOpts(array(
            CURLOPT_SSL_VERIFYHOST => 0,
            CURLOPT_SSLVERSION => 6,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_TIMEOUT => $this->settings['timeout'] !== 30 ? $this->settings['timeout'] : 30
        ));

        // Supaya jgn strip "ReferenceID" "/" jadi "/\" karena HMAC akan menjadi tidak cocok
        $encoderData = json_encode($bodyData, JSON_UNESCAPED_SLASHES);

        $body     = \Unirest\Request\Body::form($encoderData);
        $response = \Unirest\Request::post($full_url, $headers, $body);

        return $response;
    }
public function fundTransfers ( $ oauth_token , $ amount , $ sourceAccountNumber , $ beneficiaryAccountNumber , $ referenceID , $ remark1 , $ remark2 , $ transactionID ) { $ corp_id = $ this -> settings [ 'corp_id' ] ; $ apikey = $ this -> settings [ 'api_key' ] ; $ secret = $ this -> settings [ 'secret_key' ] ; $ uriSign = "POST:/banking/corporates/transfers" ; $ isoTime = self :: generateIsoTime ( ) ; $ headers = array ( ) ; $ headers [ 'Accept' ] = 'application/json' ; $ headers [ 'Content-Type' ] = 'application/json' ; $ headers [ 'Authorization' ] = "Bearer $oauth_token" ; $ headers [ 'X-BCA-Key' ] = $ apikey ; $ headers [ 'X-BCA-Timestamp' ] = $ isoTime ; $ request_path = "banking/corporates/transfers" ; $ domain = $ this -> ddnDomain ( ) ; $ full_url = $ domain . $ request_path ; $ bodyData = array ( ) ; $ bodyData [ 'Amount' ] = $ amount ; $ bodyData [ 'BeneficiaryAccountNumber' ] = strtolower ( str_replace ( ' ' , '' , $ beneficiaryAccountNumber ) ) ; $ bodyData [ 'CorporateID' ] = strtolower ( str_replace ( ' ' , '' , $ corp_id ) ) ; $ bodyData [ 'CurrencyCode' ] = 'idr' ; $ bodyData [ 'ReferenceID' ] = strtolower ( str_replace ( ' ' , '' , $ referenceID ) ) ; $ bodyData [ 'Remark1' ] = strtolower ( str_replace ( ' ' , '' , $ remark1 ) ) ; $ bodyData [ 'Remark2' ] = strtolower ( str_replace ( ' ' , '' , $ remark2 ) ) ; $ bodyData [ 'SourceAccountNumber' ] = strtolower ( str_replace ( ' ' , '' , $ sourceAccountNumber ) ) ; $ bodyData [ 'TransactionDate' ] = $ isoTime ; $ bodyData [ 'TransactionID' ] = strtolower ( str_replace ( ' ' , '' , $ transactionID ) ) ; // Harus disort agar mudah kalkulasi HMAC ksort ( $ bodyData ) ; $ authSignature = self :: generateSign ( $ uriSign , $ oauth_token , $ secret , $ isoTime , $ bodyData ) ; $ headers [ 'X-BCA-Signature' ] = $ authSignature ; \ Unirest \ Request :: curlOpts ( array ( CURLOPT_SSL_VERIFYHOST => 0 , CURLOPT_SSLVERSION => 6 , CURLOPT_SSL_VERIFYPEER => false , CURLOPT_TIMEOUT => $ this -> settings [ 'timeout' ] !== 30 ? $ this -> settings [ 'timeout' ] : 30 ) ) ; // Supaya jgn strip "ReferenceID" "/" jadi "/\" karena HMAC akan menjadi tidak cocok $ encoderData = json_encode ( $ bodyData , JSON_UNESCAPED_SLASHES ) ; $ body = \ Unirest \ Request \ Body :: form ( $ encoderData ) ; $ response = \ Unirest \ Request :: post ( $ full_url , $ headers , $ body ) ; return $ response ; }
Transfer dana kepada akun lain dengan jumlah nominal tertentu.

@param string $oauth_token nilai token yang telah didapatkan setelah login
@param int $amount nilai dana dalam RUPIAH yang akan ditransfer, Format: 13.2
@param string $beneficiaryAccountNumber  BCA Account number to be credited (Destination)
@param string $referenceID Sender's transaction reference ID
@param string $remark1 Transfer remark for receiver
@param string $remark2 ransfer remark for receiver
@param string $sourceAccountNumber Source of Fund Account Number
@param string $transactionID Transcation ID unique per day (using UTC+07 Time Zone). Format: Number
@param string $corp_id nilai CorporateID yang telah diberikan oleh pihak BCA [Optional]

@return \Unirest\Response
Transfer dana kepada akun lain dengan jumlah nominal tertentu .