Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Clone a payment module

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-25-2012, 06:00 AM
 
yamadan yamadan is offline
 

Member
  
Join Date: Mar 2011
Posts: 27
 

Default Clone a payment module

Hi,

I need to have an option at checkout for;

1, Debit card
2, Credit card - surcharge applies

The cart uses Ogone and is re-directed to their payment site.

The only way I see this possible is to have a duplicate clone of the Ogone module and then add the surcharge.

It does rely on trusting the customer clicking the right option though.

I presume it may not be as simple as:
1, copy and rename related files
2, copy and rename database

Or maybe I can edit the Ogone Direct payment to re-direct to the Ogone Web Based?
This sounds easier??

Any tips on the best way to do this much appreciated..
__________________
Gold 4.4.4
Reply With Quote
  #2  
Old 10-25-2012, 08:32 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Clone a payment module

I would actually attempt to adjust the order total based on the added checkbox. Take a look at the JavaScript method that applies the surcharge to the order total. I am assuming you are using OPC.

When you select a payment method that has an associated surcharge, see how the order total updates? I would pursue the same method for my extra checkbox. Seems easier than having two payment methods.

If you want to "keep them honest", add an extra input for the pin number when using the debit card method. Even if you just throw these values away, you can set an alert to pop if the field isn't filled out, and that would make them think that it mattered and reconsider their selection method...

Out of curiosity, do you save a lot when they use a debit card? Even without the pin?
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 10-26-2012, 04:47 AM
 
yamadan yamadan is offline
 

Member
  
Join Date: Mar 2011
Posts: 27
 

Default Re: Clone a payment module

Thanks, yes I only need the surcharge bit not the full clone of payment.
But thought trying to split out the bits I need could take longer.
Will give it a go.
__________________
Gold 4.4.4
Reply With Quote
  #4  
Old 10-26-2012, 08:06 AM
 
yamadan yamadan is offline
 

Member
  
Join Date: Mar 2011
Posts: 27
 

Default Re: Clone a payment module

Quote:
Originally Posted by totaltec

Out of curiosity, do you save a lot when they use a debit card? Even without the pin?

2.5% for credit card.

And do you have any tips how to split out the code I need for this... been scratching my head all day.
__________________
Gold 4.4.4
Reply With Quote
  #5  
Old 10-26-2012, 10:30 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Clone a payment module

Well I have to admit that it is extremely difficult unless you are a JavaScript guru. I have done stuff like this before, but it is at the very limit of my abilities.

The JS that controls OPC, is located in /common_files/modules/One_Page_Checkout/ajax.checkout.js

Very tricky file to work with, you will be interested in "_callbackPaymentMethodListChanged" I believe. Let us know how you progress with this, I am very interested in this subject. Hopefully someone with more experience than me will weigh in on this as well. I'd like to know who wrote the OPC code, it is fairly brilliant.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:02 PM.

   

 
X-Cart forums © 2001-2020