News:

Looking for documentation? Take a look on our wiki

Main Menu

NETBANX Payment module

Started by charliex, February 02, 2006, 05:04:44 AM

Previous topic - Next topic

charliex

Hi all,

Has any one got any information or is maybe successfully integrate Netbanx as a VirtueMart / phpShop payment module? Any info or idea where to start, which existing module to modify, what to modify etc will be really appreciated as I'm stuck here.

Netbanx is, as they say, "most popular and longest standing generally available payment solution in the UK" so I hope somebody already worked this out. In any case will be good to have it integrated to VirtueMart, so if I succeed will make available for other users.

Netbanx site is at http://www.netinvest.co.uk/ncr/netbanx/

Cheers

Yereverluvinunclebert

Payment Method Name:     NETBANX
Code:    nbs
Payment class name (e.g. ps_netbanx):   ps_nbx
Payment method type:    PayPal (or related)

<?php
    $amount = $db->f("order_total");
   
   $q  = "SELECT * FROM #__vm_order_user_info WHERE order_id='$order_id' AND address_type='BT'";
   $db->query( $q );
   $db->next_record();
   
   
   $user->email = $db->f("user_email");

   //Authnet vars to send
   $formdata = array (
   
    
    
     'cardholder_name' => $db->f("first_name").' '.$db->f("last_name"),
     'payment_amount' => $amount,
   
     'email' => $db->f("user_email"),
     'houseno' => $db->f("address_1"),
   
     'mobile' => $db->f("phone_1"),
   
     'postcode' => $db->f("zip"),

          'order_id' => $order_id
    
   
    );
   
   
   

    $url = "https://www.netbanx.com/cgi-bin/payment/YOUR PAYMENT ID HERE";
   
    //build the post string
    $poststring = '';
    foreach($formdata AS $key => $val){
      $poststring .= "<input type='hidden' name='$key' value='$val' />
   ";
    }
   
   ?>
   <form action="<?php echo $url ?>" method="post"   name="frmnetbanx">
   <?php echo $poststring ?>
   
   </form>
   <script>document.frmnetbanx.submit();</script>
Yereverluvinunclebert - Maker of some steampunk widgets of distinction

gtech

Hi
Thank you for posting this integration. I have one problem with it:
All information's are passed to NETBANX form but for some reason field:
Amount to charge:        £ (UK Sterling)
is not filled out.
Can anyone help? Please?
my website address:
http://www.gtechonline.co.uk/
I love what I do  - I do www
Suknie Slubne Suknie Wieczorowe

exhost

Can you post a step by step for setting this up?

kzar

If the amount to charge field isn't filled out it means the payment amount parameter hasn't been passed over successfully.

There are three things it could be, most likely the amount you are passing over contains a symbol or characters other than a number. (Make sure you don't put a £ symbol in the field for example!)

If that's not it you need to make sure the amount is really being sent, a firefox plugin called tamperdata can help you see which parameters are being sent and what they contain.)

Finally if that all looks OK the last step is to confirm with NETBANX what the name of the amount field they are expecting is, although payment_amount is the default and most commonly used it can be changed.

I hope that helps anyway, I speshitpille in NETBANX integrations so if you need more help check out my NETBANX integration enquiry form.