Jump to content

Allow Clients to Set Default Payment Method


Excel

Recommended Posts

We developed custom code to enable clients to set their payment method preference themselves, without requesting it manually or having an administrator make the change.

 

For example, say a client has been paying using PayPal, but then decides to use a credit card payment gateway. Currently, WHMCS would continue to send out PayPal invoices even with the credit card on file, since the default payment method would still be set to what they originally signed up with. The only way to have the default payment method changed is if an administrator changes the default payment gateway manually in the client's profile.

 

It's not too complicated to code on your own, but since we already developed this, I am wondering if anyone else would be interested to obtain a copy of the modifications. The script also features the following:

 

- Prevents switching of default payment gateway to credit card when a credit card is not stored on billing system

- Displays the Unique Package ID on the Product details screen (enables clients to easily refer to them on tickets, etc.)

- Clients can set different payment gateway as default for each product/service they have

- Notifies customer if they currently have a PayPal Subscription vs. manual PayPal (it only checks if subscription ID is present on WHMCS, not actual PayPal Subscription status)

- Displays PayPal Subscription ID if applicable to client

 

If anyone is interested in this script, or have suggestions to improve it, please post here so I can judge interest before releasing it as free or paid contribution.

 

Cheers,

Excel

Link to comment
Share on other sites

  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

Sure, here are 4 screenshots. Since this forum seems to crop the images, I have linked them to imageshack:

 

65387402.th.png

The first one shows the "main" page displayed once a client clicks on the "Set Default Payment Method" link from the Client Area > My Details section. It allows the client to select the appropriate package to make the payment method changed.

 

68213406.th.png

The second screenshot shows a client having a credit card on file with WHMCS.

 

34230835.th.png

The third screenshot shows a client having a PayPal Subscription on file, as well as what happens when a client tries to switch to the credit card gateway without having a CC on file.

 

26376141.th.png

The fourth screenshot shows a client having only a manual PayPal payment method, and a drop down list of available gateways to choose from.

 

-----

 

Due to the interest shown, I want to provide the script for free... but I am considering releasing this script as closed source (i.e. encrypted). The template file, where the bulk of the end-user options are configured, can still be customized easily, and without issue.

 

Users can also pay a nominal fee to get the full source of the code and customize according to their needs.

 

Please let me know your feedback and any suggestions or questions you may have

Edited by Excel
Link to comment
Share on other sites

I do like what you have done but its never not too much inconvenience for us to change it for a user and its rarely asked for, but id add it for an extra feature.

 

We would not be able to use encrypted script on our installation, its just too risky not knowing what's in the file... Could you possibly PM me letting me know what you are thinking of charging for open source? Not for modifying but more checking before use.

 

Thanks

Link to comment
Share on other sites

Hi Everyone,

 

I'm excited to announce the immediate availability of the script: Set Payment Method v1.1!

 

As mentioned, the free release is encoded with Zend Optimizer (v3.30+ required on your server), but without any license checks or restrictions. It's 100% clean and safe code that we use on our own sites. You also have full editing capabilities on the template file.

 

However, if you would like to purchase the unencoded PHP file, the fee is $25 (one-time), which includes 6 months of free updates. To order, go to https://clients.excellenthost.com/cart.php?a=add&pid=34. We will do the best to process your order within 1-24 hours.

 

To download the free encoded version, click on the attachment below. The README file contains important install instructions and tips for customization, so I have included a copy below:

 

CHANGE LOG
-----------

v1.1 - April 18, 2010 - First Public Release
[+] automatically identifies default CC gateway, if applicable
[+] automatically generates list of payment gateways to select from

v1.0 - October 2009 - Initial Internal Release


INFORMATION
-----------

This WHMCS custom page allows a client to set their preferred payment method, without having the administrator set it manually. This 

script also ensures that a client has an existing credit card on file when attempting to switch to a CC-type payment gateway (or it will 

display an informative error message to add one). 


ENCODED FILE
-----------

The main PHP file is encoded with Zend Optimizer if downloaded for free in order to protect intellectual property. No license is 

required. However, the template is fully editable and customizable, and this is where the bulk of customization can be done.

To get an unencoded release for further customization purposes, the fee is currently set at $25, with free updates for six months from 

date of purchase. A nominal fee applies for unencoded updates thereafter.

Please note the unencoded release ONLY entitles you to modify for your own personal customization purposes on your registered domain. 

You may NOT distribute, resell or repackage the product without the prior written consent of the author.

TO ORDER UNENCODED RELEASE: https://clients.excellenthost.com/cart.php?a=add&pid=34


INSTALL INSTRUCTIONS
-----------

1) Unzip archive to your computer
2) Upload (in **BINARY MODE ** if encoded) paymentgateway.php to your WHMCS main directory (e.g. where index.php resides)
3) Upload paymentgateway.tpl to your WHMCS templates directory (usually under /templates/portal/)
4) Edit clientareadetails.tpl (usually under /templates/portal) and add the following near the top, before the HTML code for changing 

the user's password:

===CODE===
|  <span style="background: #FFFF66;" class="bold"><a href="paymentmethod.php?action=select">Set Default Payment Method</a></span> |
==========


CUSTOMIZATION INSTRUCTIONS
----------

1) If you have a SSL certificate and want to make sure it is enforced when displaying this file (as it displays sensitive payment 

details):

a) Edit your header.tpl (under templates/portal) and add the following just after the closing </title> tag:

===CODE===
{php}global $CONFIG;$this->assign('url', (($_SERVER['HTTPS'] == 'on') ? $CONFIG['SystemSSLURL'] : $CONFIG['SystemURL']));{/php}
==========

b) (optional) Edit the same header.tpl file and add this at the very beginning, before any HTML code:

===CODE===
{php}if($_SERVER["PHP_SELF"] == '/paymentmethod.php') {
if ($_SERVER['SERVER_PORT'] != 443) {
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
} 
}{/php}
==========

SUPPORT
----------

This product is provided as-is, and we make no claims or warranties as to its fitness for use. We assume no liability for any improper 

use of the product. We will make updates from time to time to enhance the functionality of the product based on user feedback.

Visit the thread at http://forum.whmcs.com/showthread.php?t=28512 for help, suggestions and further updates.

 

 

Thank you for using this product, we appreciate your support! Hope you enjoy using it as much as I do! :)

 

Please let me know if you have any suggestions, feature requests or other feedback with respect to this contribution.

set_payment_method_v1.1.zip

Edited by Excel
Link to comment
Share on other sites

Please note: for the credit card gateway to be detected properly (if you have one setup, and want the user to add a credit card to their profile before proceeding to switch to the CC gateway), ensure you have sorted the payment gateways in WHMCS Admin area, otherwise all new gateways default to "0" for the order

Link to comment
Share on other sites

The only way to have the default payment method changed is if an administrator changes the default payment gateway manually in the client's profile

please, i dont know what you mean.

 

EDIT: do you mean Backend->Clients Profile->Products/Services-><service>->Paymentmethod (Select)?

 

Regards

Edited by HerrZ
Link to comment
Share on other sites

Yes, that is the manual method an admin can change a client's payment method for a service. But this script allows clients to change the default payment method themselves, and get more information about their payment preferences ( eg their PayPal Subscription ID, etc.)

Link to comment
Share on other sites

  • 2 months later...

Hi All,

 

We have diligently incorporated suggestions we received, and we are now making available a new version of this script: Set Payment Method v1.2

 

CHANGE LOG
-----------
v1.2 - June 19, 2010 - New Features Release
[+] ability to set payment method for domain registration products
[+] displays package name instead of just ID
[+] better multilingual support

v1.1 - April 18, 2010 - First Public Release
[+] automatically identifies default CC gateway, if applicable
[+] automatically generates list of payment gateways to select from

v1.0 - October 2009 - Initial Internal Release

 

NOTE: For default Credit Card gateway autodetection to work properly, please make sure to sort payment gateways in WHMCS Admin area to set an order, or else all new gateways default to "0" and the script will not be able to identify the preferred CC gateway.

 

For a limited time, you can obtain the fully commented UNENCODED version for only $19. The coupon code to use during checkout at https://clients.excellenthost.com/cart.php?a=add&pid=34 is "EXCEL19"

 

Remember, by buying the unencoded version, you also obtain at least 6 months of free updates and have more say into making suggestions for future versions of the product.

 

We currently encode the free version of this script using Zend. If you would like an IonCube version, please request it here, and it will be posted as well.

 

All feedback and suggestions are appreciated on this thread.

set_payment_method_v1.2.zip

Edited by Excel
Link to comment
Share on other sites

Hi All,

 

We have diligently incorporated suggestions we received, and we are now making available a new version of this script: Set Payment Method v1.2

 

CHANGE LOG
-----------
v1.2 - June 19, 2010 - New Features Release
[+] ability to set payment method for domain registration products
[+] displays package name instead of just ID
[+] better multilingual support

v1.1 - April 18, 2010 - First Public Release
[+] automatically identifies default CC gateway, if applicable
[+] automatically generates list of payment gateways to select from

v1.0 - October 2009 - Initial Internal Release

 

NOTE: For default Credit Card gateway autodetection to work properly, please make sure to sort payment gateways in WHMCS Admin area to set an order, or else all new gateways default to "0" and the script will not be able to identify the preferred CC gateway.

 

For a limited time, you can obtain the fully commented UNENCODED version for only $19. The coupon code to use during checkout at https://clients.excellenthost.com/cart.php?a=add&pid=34 is "EXCEL19"

 

Remember, by buying the unencoded version, you also obtain at least 6 months of free updates and have more say into making suggestions for future versions of the product.

 

We currently encode the free version of this script using Zend. If you would like an IonCube version, please request it here, and it will be posted as well.

 

All feedback and suggestions are appreciated on this thread.

 

+1 for Ioncube, i dont like mixing encryption methods on my installation.

 

Thanks

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