Jump to content



- - - - -

Payment Type Charge


  • Please log in to reply
20 replies to this topic

#1   Ralph2

Ralph2
  • Members
  • 29 posts
  • Real Name:Ralph

Posted 13 February 2007 - 05:58 PM

This is the topic to discuss Payment Type Charge contribution.
Download link follows.

#2   Ralph2

Ralph2
  • Members
  • 29 posts
  • Real Name:Ralph

Posted 13 February 2007 - 06:17 PM

Well, I can't edit the opening post anymore. So, here's the link to the download: Payment Type Charge

#3   Jaapv

Jaapv
  • Members
  • 16 posts
  • Real Name:Jaap Veldhorst
  • Location:Netherlands

Posted 23 April 2007 - 11:34 AM

Great work!
I tried to use your contribution for a payment type percentage discount. (like moneyorder:0:%-2,cod:0:%-2, etc.) The module has no problem with the "negative percentage", but the VAT/BTW does not get changed. It keeps using the product subtotal.

An example:

Subtotal: €100,-
Payment discount: -€2,-
BTW/VAT: €19,-
Shipping: €6,25
Total: € 123,25

It ought to be:

Subtotal: €100,-
Payment discount: -€2,-
BTW/VAT: €18,62
Shipping: €6,25
Total: € 122,87

Could you help me figuring this out?

Thanks!
"My name is Ass, Dumb Ass"

#4   wackychris

wackychris
  • Members
  • 6 posts
  • Real Name:chris

Posted 19 May 2007 - 04:33 PM

I am not a programmer and my knowledge of php is very very limited. I have been using this payment type charge module to add a charge of 3.5% on to every order to pass on paypal fees. The module worked perfectly on the Paypal IPN module but i have since changed to paypal pro direct payment. Now even though the extra charge is added on to the checkout and order with no problems the amount taken from each customers card is with out the additional charge. I believe the new paypay pro direct payments module is only using the Sub Total and not the Total.  Paypay say it is not there modules fault.  Any ideas on how to correct this problem would be fantastic as it is driving me crazy .

Thanks  :blink:

#5   Made in Holanda

Made in Holanda
  • Members
  • 5 posts
  • Real Name:Angelique

Posted 19 May 2007 - 07:25 PM

Hello
I'm totally new to this kind of forums, but could you please help me?
I tried the contribution: Fixed pay charge, but I get the error message: Fatal error: Call to undefined method ot_fixed_payment_chg::get_payment_cost() in **mydomain.com/public_html/catalog/includes/classes/payment.php on line 136

I think I messed up my classes/payment.php
Do I have to send my file so anyone can check? O, I think easier: could anyone send me a working one (with fixed pay charge)?

Thank you very, very much in advance!

#6   Spaceboy

Spaceboy
  • Members
  • 235 posts
  • Real Name:Didier D.
  • Gender:Male
  • Location:Switzerland

Posted 27 September 2007 - 09:29 PM

The text description for each payment type cannot be localised as it is stored in the configuration table. I did a quick change in 2 files and now in the checkout_confirmation page, the label as order total can be localised.

Add this line to ../languages/.../modules/order_total/ot_fixed_payment_chg.php :

define('MODULE_FIXED_PAYMENT_CHG_TYPE_DESCRIPTION', 'moneyorder:Fee for Money Order,cod:Fee for Cash on Delivery');

This can of course be done for each language and must be adapted to your payment methods.

Also, in the class file .../includes/modules/order_total/ot_fixed_payment_chg.php, drop the 2 lines that inserts the label 'MODULE_FIXED_PAYMENT_CHG_TYPE_DESCRIPTION' in the configuration table. You can also change the function "keys" not to insert this one.

Change to code like this :

 
function keys() {
//	  return array('MODULE_FIXED_PAYMENT_CHG_STATUS', 'MODULE_FIXED_PAYMENT_CHG_SORT_ORDER', 'MODULE_FIXED_PAYMENT_CHG_TYPE', 'MODULE_FIXED_PAYMENT_CHG_TYPE_DESCRIPTION', 'MODULE_FIXED_PAYMENT_CHG_TAX_CLASS');
	  return array('MODULE_FIXED_PAYMENT_CHG_STATUS', 'MODULE_FIXED_PAYMENT_CHG_SORT_ORDER', 'MODULE_FIXED_PAYMENT_CHG_TYPE',  'MODULE_FIXED_PAYMENT_CHG_TAX_CLASS');
	}

//tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Payment Type Description', 'MODULE_FIXED_PAYMENT_CHG_TYPE_DESCRIPTION', 'moneyorder:Fee for Money Order,cod:Fee for Cash on Delivery', 'Description for each payment type.', '6', '3', now())");

This should work  :thumbsup:

#7   Spaceboy

Spaceboy
  • Members
  • 235 posts
  • Real Name:Didier D.
  • Gender:Male
  • Location:Switzerland

Posted 27 September 2007 - 10:45 PM

Still working on this contribution.

Did someone has been able to display the extra charge in the checkout_payment page ? I used some parts from another contribution "payment method fee" but I cannot get it too work for one than more payment method. It is well displayed for the first method but not for the second. I added some code in the class "payment.php" (function selection) and added a new function "get_payment_cost".

Someone succeeded here so we can share ?

#8   Spaceboy

Spaceboy
  • Members
  • 235 posts
  • Real Name:Didier D.
  • Gender:Male
  • Location:Switzerland

Posted 30 September 2007 - 10:57 AM

Added new version 1.8 to this contribution with the following changelog :

- Dropped configuration entry for "MODULE_FIXED_PAYMENT_CHG_AMOUNT" as this is not used anymore.
  - Added possibility to display to extra fee charge in the checkout_payment.php page. Attention, it will only display the extra amount and not the percentage. You can display the extra percentage by changing function "get_payment_cost". This is not included in this contribution but it's should be easy to do.
  - dropped Dutch order total file from package as it is impossible to maintain 2 code files (EN + NL). Only the language file can be translated but not the classes and methods. In order to respect the work done by Ralph in v1.7, you can find the dutch configuration entries below. You can replace the English keys by the Dutch ones.
  
Files impacted : module ot_fixed_payment_chg.php, class payment.php, page checkout_payment.php

You can find it here : http://www.oscommerce.com/community/contributions,251

#9   jeckert78

jeckert78
  • Members
  • 4 posts
  • Real Name:Justin

Posted 12 December 2007 - 09:55 PM

I'm trying to use this payment module to do percentage shipping.

I tried using the flatrate but it didnt do what I wanted so I'm trying this plugin.

what I am wanting to do is orders
20 and under, $5 s&h
30 - 20.01, $8  s&h
50 - 30.01 $10  s&h
and everything else is 25% of the order is the  s&h

I'm not sure how to get the percentage of the total, please help.


20:5.00,30:8.00,50:10.00,10000:10,000:25%


Thank You in advance!

#10   Stephan Gebbers

Stephan Gebbers
  • Members
  • 65 posts
  • Real Name:Stephan Gebbers
  • Gender:Male
  • Location:Potsdam/Germany

Posted 18 December 2007 - 06:21 PM

Hi Spaceboy,

Can you give support for the modul?
I have 2 problems.
-the tax is not recalculated. So i get the same tax display with and without the payment charge.
-charge display in checkout_payment does show the fixed charge only, not the percentage + the fixed charge.

Stephan

View PostSpaceboy, on Sep 30 2007, 06:57 AM, said:

Added new version 1.8 to this contribution with the following changelog :

- Dropped configuration entry for "MODULE_FIXED_PAYMENT_CHG_AMOUNT" as this is not used anymore.
  - Added possibility to display to extra fee charge in the checkout_payment.php page. Attention, it will only display the extra amount and not the percentage. You can display the extra percentage by changing function "get_payment_cost". This is not included in this contribution but it's should be easy to do.
  - dropped Dutch order total file from package as it is impossible to maintain 2 code files (EN + NL). Only the language file can be translated but not the classes and methods. In order to respect the work done by Ralph in v1.7, you can find the dutch configuration entries below. You can replace the English keys by the Dutch ones.
  
Files impacted : module ot_fixed_payment_chg.php, class payment.php, page checkout_payment.php

You can find it here : http://www.oscommerce.com/community/contributions,251

..using OSC MS1 loaded5 & OSC MS2 RC1

#11   CGhoST

CGhoST
  • Members
  • 221 posts
  • Real Name:Cyber Ghost

Posted 28 February 2008 - 03:53 AM

How is the surcharge calculated?

This is how i have it:

Subtotal
Shipping
GST
Surcharge
TOTAL

I want the credit card surcharge to have the total charge of products plus shipping cost plus gst and charged on this.

I don't know how the surcharge is being calculated as i checked the calculation manually on a calculator and the result is not the same. It is always being over by aprox $2.

Any help would be much appreciated.

#12   kvk1605

kvk1605
  • Members
  • 2 posts
  • Real Name:Kenneth Kristiansen

Posted 20 June 2008 - 10:27 PM

Hi.

Why is it i cant see the payment fee at paypals opening window - when its clearly at checkout on my page?

Everything else is fine, sub-total, tax, total!

Regards
Kenneth

#13   K8L

K8L
  • Members
  • 6 posts
  • Real Name:K8L
  • Gender:Male

Posted 29 July 2008 - 12:05 PM

View Postkvk1605, on Jun 20 2008, 10:27 PM, said:

Hi.

Why is it i cant see the payment fee at paypals opening window - when its clearly at checkout on my page?

Everything else is fine, sub-total, tax, total!

Regards
Kenneth

Hi ! Did you find a solution ? I have exactly the same problem.
-= K8L =-

#14   cymainformatica

cymainformatica
  • Members
  • 7 posts
  • Real Name:cymainformatica

Posted 16 August 2008 - 11:24 AM

Hi, all. I recently installed the "Payment Type Charge" add-on but I´m getting the following error. I just copied the two files that the install.txt says in the corresponding directories but I don´t know if I have to manually edit any other files. I guess so but I don´t know which files and what I have to modified. Any help, please? Following is the error I get finishing a buying operation when add-on installed:

Warning: order_total::include(includes/languages/espanol/modules/order_total/ot_fixed_payment_chg.php) [function.include]: failed to open stream: No such file or directory in C:\...\catalog\includes\classes\order_total.php on line 25

Warning: order_total::include() [function.include]: Failed opening 'includes/languages/espanol/modules/order_total/ot_fixed_payment_chg.php' for inclusion (include_path='.;C:\php5\pear') in C:\...\catalog\includes\classes\order_total.php on line 25

Warning: order_total::include(includes/modules/order_total/ot_fixed_payment_chg.php) [function.include]: failed to open stream: No such file or directory in C:\...\catalog\includes\classes\order_total.php on line 26

Warning: order_total::include() [function.include]: Failed opening 'includes/modules/order_total/ot_fixed_payment_chg.php' for inclusion (include_path='.;C:\php5\pear') in C:\...\catalog\includes\classes\order_total.php on line 26

Fatal error: Class 'ot_fixed_payment_chg' not found in C:\...\catalog\includes\classes\order_total.php on line 29

Thanks for your help!

Ramon Rodriguez
Spain

Edited by cymainformatica, 16 August 2008 - 11:24 AM.


#15   ivanrok

ivanrok
  • Members
  • 22 posts
  • Real Name:ivan
  • Gender:Male
  • Location:Peru

Posted 19 August 2008 - 12:28 AM

hi

Payment Type Charge 1.8 - doesn't  put the fee in paypal, but in the page is ok,  

why?

#16   ivanrok

ivanrok
  • Members
  • 22 posts
  • Real Name:ivan
  • Gender:Male
  • Location:Peru

Posted 19 August 2008 - 03:51 PM

View Postivanrok, on Aug 18 2008, 07:28 PM, said:

hi

Payment Type Charge 1.8 - doesn't  put the fee in paypal, but in the page (oscommerce) is ok,  

why?


#17   bpopelar

bpopelar
  • Members
  • 324 posts
  • Real Name:Benedict F Popelar
  • Gender:Male
  • Location:Anaheim, CA

Posted 21 November 2010 - 05:07 AM

I had the same problem a few of the poster described above.  Basically, everything looks correct on the confirmation page (i.e, the surcharge is displayed and include in the Total), but when the transaction is performed, the amount charged to the customer's credit card does not include the surcharge. I am using Link Point as the credit card service (not Paypal), but the result was the same.

After digging around in the code, I discovered that in my version of checkout_process.php, the order_total.php module was included, instantiated and called after the credit card transaction was conducted. This logic needs to occur before the credit card transaction as it modifies the order['total'] value which is what the payment processing modules uses as the basis of the transaction.

The solution was to re-order the logic in checkout_process.php (near line 47):

Before:
  require(DIR_WS_CLASSES . 'order.php');
  $order = new order;

// load the before_process function from the payment modules
  $payment_modules->before_process();

  require(DIR_WS_CLASSES . 'order_total.php');
  $order_total_modules = new order_total;

  $order_totals = $order_total_modules->process();

After:
  require(DIR_WS_CLASSES . 'order.php');
  $order = new order;

  require(DIR_WS_CLASSES . 'order_total.php');
  $order_total_modules = new order_total;

  $order_totals = $order_total_modules->process();

// load the before_process function from the payment modules
  $payment_modules->before_process();

Now having described all of this, I'm not sure this isn't something unique to my modified shop.  I'm also not sure what effect this might have on other Order Total modules, but it fixed my problem.

Ben

#18   mdtaylorlrim

mdtaylorlrim
  • Members
  • 2,497 posts
  • Real Name:Mark
  • Gender:Male

Posted 21 November 2010 - 11:42 AM

View Postbpopelar, on 21 November 2010 - 05:07 AM, said:

I had the same problem a few of the poster described above.  Basically, everything looks correct on the confirmation page (i.e, the surcharge is displayed and include in the Total), but when the transaction is performed, the amount charged to the customer's credit card does not include the surcharge. I am using Link Point as the credit card service (not Paypal), but the result was the same.

<snip>

Now having described all of this, I'm not sure this isn't something unique to my modified shop.  I'm also not sure what effect this might have on other Order Total modules, but it fixed my problem.

Ben
It sounds like what you have done it add a surcharge to the order total when a credit card is used, which is a direct violation of every MasterCard/Visa agreement I have ever read...
Avoid the most asked question. See How to Secure My Site and How do I...?

#19   bpopelar

bpopelar
  • Members
  • 324 posts
  • Real Name:Benedict F Popelar
  • Gender:Male
  • Location:Anaheim, CA

Posted 22 November 2010 - 02:58 AM

View Postmdtaylorlrim, on 21 November 2010 - 11:42 AM, said:

It sounds like what you have done it add a surcharge to the order total when a credit card is used, which is a direct violation of every MasterCard/Visa agreement I have ever read...
That might be true...guess I better go read the fine print.

Ben

#20   ramon.cutanda

ramon.cutanda
  • Members
  • 3 posts
  • Real Name:Ramón Cutanda

Posted 29 December 2010 - 03:56 PM

Hi,

My situation is: I want a COD fee of 5 percent (or whichever) BUT with a MINIMAL charge of 3 euros. Right now, if I type this:

cod:3:%5

The addon ADDS BOTH charges; a 5% and an extra fixed fee of 3 euros.

Is there any way to achieve what I need with this addon?

Thanks in advance.

Regards,

Edited by ramon.cutanda, 29 December 2010 - 03:57 PM.