Jump to content

Display Paypal Balance on Homepage


trappedatuf

Recommended Posts

Is this working for 4.0?

 

For anyone who is interested, I have modified the template coding a little to fit nicely in the sidebar above the staff online/income projection etc.

 

Simply place the following code anywhere in the sidebar.tpl (V4), generally around the area of the code:

 

<br />

<span class="plain_header">Staff Online</span>
<div class="smallfont">{$adminsonline}</div>

 

The modified code is:

 

<img src="images/spacer.gif" width="1" height="4"><br>
{php}include('paypalBalance.php'); {/php}
<span class="plain_header">Paypal Balance</span>
<table width=100% cellpadding=2>
<tr><td align="left">Account Balance</td><td class="fieldareasmall"><strong>{php} echo $data['PAYPALBALANCE']; {/php}</strong></td></tr>
</table>

 

 

An example of the final look should be something like this:

 

 

Enjoy! :)

whmcs_paypal.JPG

Edited by hightekhosting
Link to comment
Share on other sites

  • Replies 116
  • Created
  • Last Reply

Top Posters In This Topic

The modified code is:

 

<img src="images/spacer.gif" width="1" height="4"><br>
{php}include('paypalBalance.php'); {/php}
<span class="plain_header">Paypal Balance</span>
<table width=100% cellpadding=2>
<tr><td align="left">Account Balance</td><td class="fieldareasmall"><strong>{php} echo $data['PAYPALBALANCE']; {/php}</strong></td></tr>
</table>

 

 

All i see is the word Paypal Balance after adding the code to sidebar.tpl. No amount, no link to click to show recent transactions

Link to comment
Share on other sites

  • 2 weeks later...

Or if you would like it in the header.

 

Find file: Admin/templates/v4/header.tpl

 

Find :

<div id="logo_container"><img class="banner" src="templates/v4/images/logo.gif" alt="WHMCS" width="400" height="115" border="0" />

 

AND immediately after on the next line place:

{php}
$result = select_query("tbladmins","roleid",array("id"=>$_SESSION['adminid']));
$data = mysql_fetch_array($result);
$this->assign('roleid', $data['roleid']);
{/php}
{if $roleid == "1"}
{literal}
<script language="javascript">
function togglepaypaltrans() {
if (document.getElementById('paypaltrans').style.display=="none") {
	document.getElementById('paypaltrans').style.display="block";
} else {
	document.getElementById('paypaltrans').style.display="none";
}
}
</script>
{/literal}

{include_php file="PayPalBalance/GetBalance.php"}
<div align="right" style="position:absolute;top:35px;right:410px;width:200px;">
<table width="100%" cellspacing="1" cellpadding="0" bgcolor="#8FBCE9">
	<tr>
		<td bgcolor="#ffffff">
			<table width=100% cellpadding=2>
				<tr><td align="left" colspan="2" bgcolor="#EFF2F9" nowrap><img vspace="2" hspace="10" src="PayPalBalance/images/paypal_logo.png" align="left" /><strong>Account Balance</strong></td></tr>
				<tr><td align="right" nowrap>Account Balance</td><td bgcolor="#EFF2F9"" nowrap><strong>{if $paypalfail} {$paypalfail}{else} ${$paypalbalance} {$paypalcurrency}{/if}</strong></td></tr>
				<tr><td align="center" nowrap colspan="2">{$paypaltimestamp} GMT</td></tr>
				<tr><td align="center" nowrap colspan="2"><a href="#" onclick="togglepaypaltrans(); return false;"><strong>{$paypaltransactiontext}</strong> »</a></td></tr>
			</table>
		</td>
	</tr>
</table>
</div>

<div style="display:none;" id="paypaltrans">
<div align="right" style="position:absolute;top:135px;left:110px;z-index:100;max-height:500px;overflow:auto;border:2px #ccc solid;">
	{$paypaltransactions}
</div>
</div>
{/if}

 

This will place the box in the header (as before) but will be on every page you go to instead of just the Admin homepage.

Link to comment
Share on other sites

  • 4 months later...

Hi there anyone know why I am getting the error

 

GetBalance Failed in the box

 

and under Admin Summary

 

PayPal Balance Error

G - G

PayPal Transactions Error

T - T

 

Any seggestions would be great

 

Its a new paypal account I have added the api stuff. Any seggestions would be great

Link to comment
Share on other sites

  • 2 weeks later...
How? I need to loged in to download it. If is FREE why this?

Because there was a really high influx of abuse with the free downloads from a couple of pirate sites linking directly to them so I changed the free downloads to be available to clients only. You can easily become a client by purchasing one of my normal mods and then you will have full access to all of my free downloads.

Link to comment
Share on other sites

Because there was a really high influx of abuse with the free downloads from a couple of pirate sites linking directly to them so I changed the free downloads to be available to clients only. You can easily become a client by purchasing one of my normal mods and then you will have full access to all of my free downloads.

 

OK. I understand but in that case don't wrote FREE because isn't FREE. Be honestly and tell that's ONLY free with purchase of another mod. The same for all yours other "FREE" mods.

For me something something is free only without any requirements.

Link to comment
Share on other sites

OK. I understand but in that case don't wrote FREE because isn't FREE. Be honestly and tell that's ONLY free with purchase of another mod. The same for all yours other "FREE" mods.

For me something something is free only without any requirements.

This has only just changed within the last week so before that there has not been a problem.

Even though it and many others are free, the software and script pirates are not going to use my server for file downloads. You can thank them for that.

You will also now note that I have just updated my sig

Link to comment
Share on other sites

This has only just changed within the last week so before that there has not been a problem.

Even though it and many others are free, the software and script pirates are not going to use my server for file downloads. You can thank them for that.

 

Sorry but where need except us whmcs users your software??? And if you really would to contribute here for whmcs community you can simple post attachment and only registered users can download from here. No pirates to use your server. But this in only my opinion. It's your software and you can do what you will. I have no right to tell you what you need to do.

Link to comment
Share on other sites

wait... so is this not free anymore? i am confused.

and if its free, why does it matter if "pirates" link to your server?

Yes it is free to clients only now as I have already previously mentioned, its quite simple and clear, there is nothing to be confused about.

 

As for them linking to my server, well in australia we actually have to pay for bandwidth and it's not cheap so why allow someone free access when you know that they will not actually purchase anything to be able to recover running costs of the server. Sorry if you don't like or agree to it, but it's a business decicion that I had to make.

 

As you have already found out just before your post here, by trying to do a fake order you will still not have download access.

10/11/2009 10:04 FREE Download Denied - PayPalBalance.zip - Remote IP: **.***.**.** - User ID: 1274 - My365Host My365Host.com

10/11/2009 10:03 Order ID 1387 Failed Fraud Check

10/11/2009 10:03 Order ID 1387 Fraud Check Initiated

10/11/2009 10:03 Email Sent to My365Host My365Host.com (Order Confirmation)

By becomming a legimate client you will then have full access to all of the free downloads.
Link to comment
Share on other sites

wait... so is this not free anymore? i am confused.

and if its free, why does it matter if "pirates" link to your server?

Sparky has recently changed his offers in relation to freebies for good reason. In no particular order:

 

1. Exploitation by nefarious elements

2. The popularity of his work is legendary

3. To provide extra value to genuine customers at a mere $10 entry level (Less than 2 pints of beer!)

4. Because such a change is fully justified both for his genuine customers and for him to be able to support us realistically which he does immaculately to the highest standards of professionalism. No client could reasonably ask for more.

5. Due to Sparky's success and our success as his customers, things have moved on and, not surprisingly, elements of his site may not have reflected this change in the instant you demanded. But they are fast enough for me and the vast majority. So stop complaining and buy something!

 

As a long standing customer I can personally vouch that you will never regret the first $10 and not any other $ afterwards. Whatever your difficulties, the level of support that Sparky provides is exemplary by any standards. My personal vouch on that.

 

IMHO, Sparky has earned the respect and loyalty of every WHMCS user so all that remains is for you to place an order and enjoy!

 

Just one of Sparky's free mods is worth $10 any day of the week. Credit where due!

 

Thank you. ;)

 

PS:

and if its free, why does it matter if "pirates" link to your server?
Are you serious? Edited by redrat
Link to comment
Share on other sites

Yes it is free to clients only now as I have already previously mentioned, its quite simple and clear, there is nothing to be confused about.

 

As for them linking to my server, well in australia we actually have to pay for bandwidth and it's not cheap so why allow someone free access when you know that they will not actually purchase anything to be able to recover running costs of the server. Sorry if you don't like or agree to it, but it's a business decicion that I had to make.

 

As you have already found out just before your post here, by trying to do a fake order you will still not have download access.

By becomming a legimate client you will then have full access to all of the free downloads.

 

i actually tried to order, and it kept saying fraud, so i just didn't bother trying.

Link to comment
Share on other sites

  • 2 months later...

I found a bug with this addon....

 

If api-3t.paypal.com is unreachable the admin page either hangs or gives a error. This needs to change asap. There needs to be a timeout used so and a brief error message in the paypal section the server was unreachable.

Link to comment
Share on other sites

There is a timeout already set

curl_setopt($ch, CURLOPT_TIMEOUT, 150);

If you need it shorter then change the 150 to something like 30

If you need to see the curl error the in your configuration.php remove to comments from the debug line to show like this.

$debug_paypal_output = 'on';
Link to comment
Share on other sites

  • 1 month later...

Anybody managed to get it to do more than just the default currency yet?

I have 15 different currencies and would like to show those that are >0...

Or just show the "Total balance (all currencies, available and pending) converted to Primary Currency:" figure.

Edited by KevinTH
Link to comment
Share on other sites

Anybody managed to get it to do more than just the default currency yet?

I have 15 different currencies and would like to show those that are >0...

Or just show the "Total balance (all currencies, available and pending) converted to Primary Currency:" figure.

 

 

Paypay API has it as RETURNALLCURRENCIES see:

 

https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_GetBalance#id09BKB0Z40HS

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated