Dwolla\Account::toggleAutoWithdrawalStatus PHP Method

toggleAutoWithdrawalStatus() public method

Sets auto-withdrawal status of the account associated with the current OAuth token under the specified funding ID.
public toggleAutoWithdrawalStatus ( boolean $status, string $fundingId, string $alternate_token = false ) : string
$status boolean Auto-withdrawal boolean.
$fundingId string Funding ID of target account.
$alternate_token string OAuth token value to be used instead of the current setting in the Settings class.
return string Either "Enabled" or "Disabled"
    public function toggleAutoWithdrawalStatus($status, $fundingId, $alternate_token = false)
    {
        if (!isset($status)) {
            return self::_error("toggleAutoWithdrawalStatus() requires `\$status` parameter.\n");
        }
        if (!isset($fundingId)) {
            return self::_error("toggleAutoWithdrawalStatus() requires `\$fundingId` parameter.\n");
        }
        return self::_post('/accounts/features/auto_withdrawl', ['oauth_token' => $alternate_token ? $alternate_token : self::$settings->oauth_token, 'enabled' => $status, 'fundingId' => $fundingId]);
    }