Jump to:

2076 Posts in 857 Topics by 449 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Add Processing Fee if Paying By Credit Card

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 521 Views
  • VicfromPerth
    Avatar
    Community Member
    8 Posts

    Add Processing Fee if Paying By Credit Card Link to this post

    I am hoping someone might be able to give me some direction on how to make my checkout process apply a 3% fee only if the consumer is paying by credit card. There is a radio button for 'Invoice' or 'Credit Card' and if 'Credit Card' is selected I would like the cart to update with Javascript to show the new total.

    I already have some other custom functions for different fees (eg insurance) but they are all applied irrespective of what payment method.

    I am not sure how to get the SubTotal and Total functions available in the javascript function. I have used the

    function updateForAjax(array &$js) {
    ...
    $insurance = $subTotal * 0.08;
          $insurance = DBField::create('Currency', $this->Insurance())->Nice();
    $js[] = array('id' => $this->InsuranceID(), 'parameter' => 'innerHTML', 'value' => $insurance);
    }


    for the other custom functions, but not sure how to test what option is selected to determine if a fee should be applied or not. Or even if this is the way to do it.

    I am still pretty new to Silverstripe, so still trying to get my head around it.

    Thanks.
    Vic

    521 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.