Support » Plugin: WP eCommerce » What is the correct directory for payment gateways?

  • Resolved jorisw

    (@jorisw)


    Hi,

    This may seem like a dumb topic but please bear with me. I’ve tried the search function but the results are chaotic and include results outside this support forum.

    A lot of third party payment gateway plugins, come with installation instructions to put them in /wp-content/plugins/wp-ecommerce/wpsc-merchants/ . Doing this, makes them work, but often they disappear from this directory whenever wp-ecommerce is updated.

    Is there an alternative to this directory? If so, where is this documented?

    Is there a totally different way people should be writing payment gateway plugins? If so, where is this documented?

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • As you have noticed, the merchants directory is liable to get wiped clean during an upgrade.

    I have written a number of gateways (but not for the last year or so).

    You need to create a new plugin. It needs to contain this:

    
    add_filter('wpsc_merchants_modules','xbank_gateway_add_gateway');
    function xbank_gateway_add_gateway ($nzshpcrt_gateways) {
        $nzshpcrt_gateways[] = array(
            'name'                   => 'XBank Gateway',
    // ---- etc 
    

    The rest of it is much the same as it used to be. I have not seen any up to date documentation on this.

    Thanks whitelamp. I urge the WP Ecommerce developers to get this documented, like any extensible software does. Almost every third party is doing it wrong now.

    You can write a payment gateway integration using a plugin. While I won’t hold it up as a shining example, here’s one that integrates with WP eCommerce without being lost each time you upgrade that plugin.

    https://en-au.wordpress.org/plugins/eway-payment-gateway/

    You can browse the source code in GitHub. Selected bits of interest:

    Hooking WP eCommerce to register a new gateway integration
    The gateway integration class

    NB: WP eCommerce did have some very sparse doco about writing payment gateway integrations once, but it’s been lost since the doco site was rearranged.

    cheers,
    Ross

    Plugin Author Justin Sainton

    (@justinsainton)

    Yep, we are definitely aware of the abysmal state of our documentation – very much on our radar for an overhaul this year!

    In the meantime, here’s an example: https://github.com/wp-e-commerce/Stripe/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What is the correct directory for payment gateways?’ is closed to new replies.