Articles Comments

GS Blog » Global Synopsis - GS Tech, Lahore, Pakistan, Web Design and Development » Adding custom manual payment gateways in WP-Ecommerce version

Adding custom manual payment gateways in WP-Ecommerce version

WP Ecommerce from

WP-Ecommerce is a really convenient plugin to setup online stores using wordpress

Suppose you want to add custom payment gateways to your wp ecommerce installation to enable manual payment options such as Cash on Delivery (COD) or Direct Bank Transfer. Further, you also want your customers to see customized messages on the transactions results page when they choose a particular option.

This is really easy to do in WP-Ecommerce version. The method below should also continue to hold true for future releases of the plugin as well.

Necessary precaution: Make a backup of your website, so that you are safe in case anything ungainly happens. Although the method outlined below works like a charm on many websites that we have implemented, it is still better to be on the safe side.

1. Just navigate to the plugins folders of your wordpress installation and then wp-ecommerce/wpsc-merchants folder.

2. Inside the wpsc-merchants folder locate the file testmode.merchants.php

3. Suppose you want to add Cash on Delivery manual payment option to your store. Now just make a local copy of the testmode.merchants.php file and rename it to cod.merchants.php. Do not create this file directly on the server, download the testmode.merchants.php file first to your local system, make a copy and rename it to cod.merchants.php.

4. Open your newly created file (cod.merchants.php), do a CTRL+F on the file with the following tokens and replace all old instances with the new ones:

  • Change the name from ‘Test Gateway’ to ‘Cash on Delivery’
  • Change the class name from ‘wpsc_merchants_testmode’ to ‘wpsc_merchants_cod’
  • Change the display name from ‘Manual Payment’ to ‘Cash on Delivery’
  • Change the name of the function form_testmode() to form_cod()
  • Change the name of the textarea from ‘payment_instructions’ to ‘payment_instructions_cod’. This will enable you to display custom messages on your transaction results page when the user selects Cash on Delivery as their desired payment option. Replace in all places in the file.
  • Lastly Change the name of the function from _wpsc_filter_test_merchant_customer_notification_raw_message to _wpsc_filter_cod_merchant_customer_notification_raw_message. Make sure that you Replace the name on all places.


Your payment gateway is now ready. Simply upload this file to the wp-ecommerce/wpsc-merchants folder of your wordpress installation. Login to your store backend and head over to the Store settings. You will find the Cash on Delivery among the listed payment options. Enable it and customize it by adding the message that you want to display to the user when user opts for Cash on Delivery.

Thats it, you’re done. Make as many manual payment gateways as you like. Happy Ecommercing with WP-Ecommerce.


Filed under: Global Synopsis - GS Tech, Lahore, Pakistan, Web Design and Development · Tags: , , , , ,

4 Responses to "Adding custom manual payment gateways in WP-Ecommerce version"

  1. Jenni says:

    Thank you SO much for this!! Worked like a charm!

    The only thing is in my version of WP E-commerce(, instead of ex wpsc_merchants_testmode it sais wpsc_merchant_testmode. So merchant instead of merchantS in all of the tokens.

    You’ve written both, but maybe it’s like that for

    Thanks again! :)

  2. Patrick says:


    I found your tutorial yesterday, did it as written, it is excellent. Thank you.
    Today I configured it as “Cash On Ordering”.

    But whilst testing it, I go directly from paying (check out completed) to “Transaction results”, without seeing the message I’ve prepared for the manual payment !!

    Any idea what could be wrong ?

    Thanks for any help.


  3. Your style is so unique compared to other people I’ve read stuff from.
    Thank you for posting when you’ve got the opportunity, Guess I’ll
    just bookmark this page.

  4. Walker says:

    Thank you for another informative website. The place else
    may I get that type of information written in such a perfect
    approach? I have a challenge that I’m just now working on,
    and I have been at the glance out for such information.

Leave a Reply