i encountered an issue that sometimes arises on my Magento Community Edition 1.8 Store. The problem is that sometimes Magento adds the Cash on Delivery fee, to the order grand total, in spite of the user had selected Paypal as payment method. This happen only if the user selects Paypal as payment method and happen rarely. Sometimes even the amounts of the items through Paypal and Magento are not in compliance. Contact Paypal Support was not helpful.
Any help will be appreciate
Thanks in advance to everyone
Kind Regards
Steelwork Media Solutions
I feel like some necroposter, but I want to share some thoughts about solving this issue.
Recently I got the very same problem: user has chosen PayPal as payment method, but got charged with cash on delivery fee. After some investigating, I found out that cash on delivery module itself was a culprit.
The problem is in module's logic: it adds up COD fee when COD payment method is selected, but it DOES NOT clear that fee from quote, when payment method is changed to another one. So, when order is being created, fields with COD fee are being copied as is to order. And client gets charged for nothing.
The worst thing in this situation is that you don't see that fee applied in checkout. It pops up only in order.
For example, there is a part of code from MSP_CashOnDelivery module:
if (
($_helper->getQuote()->getPayment()->getMethod() == $_model->getCode()) &&
($address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_SHIPPING)
) {
$address->setGrandTotal($address->getGrandTotal() + $amount);
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $baseAmount);
$address->setMspCashondelivery($amount);
$address->setMspBaseCashondelivery($baseAmount);
$address->setMspCashondeliveryInclTax($amountInclTax);
$address->setMspBaseCashondeliveryInclTax($baseAmountInclTax);
$quote->setMspCashondelivery($amount);
$quote->setMspBaseCashondelivery($baseAmount);
$quote->setMspCashondeliveryInclTax($amountInclTax);
$quote->setMspBaseCashondeliveryInclTax($baseAmountInclTax);
}
To solve the problem, you need to add following code below:
if ($_helper->getQuote()->getPayment()->getMethod() != $_model->getCode())
{
$address->setMspCashondelivery(0);
$address->setMspBaseCashondelivery(0);
$address->setMspCashondeliveryInclTax(0);
$address->setMspBaseCashondeliveryInclTax(0);
$quote->setMspCashondelivery(0);
$quote->setMspBaseCashondelivery(0);
$quote->setMspCashondeliveryInclTax(0);
$quote->setMspBaseCashondeliveryInclTax(0);
}
As mentioned in above answer, setting the fields to zero works perfectly. However, it will add a row in invoice and order with a zero charge and that may sound weird to customers. so just add a simple if condition for checking if charge is zero in all the Totals.php block files.
$amt = $this->getSource()->getServiceCharge();
$nameAmt = $this->getSource()->getServiceChargeName();
if ($amt && $amt!=0) {
$this->addTotalBefore(new Varien_Object(array(
'code' => 'service_charge',
'value' => $amt,
'base_value'=> $this->getSource()->getBaseServiceCharge(),
'label' => $nameAmt,
)), 'service_charge');
}
Related
I am building a donation page where I want the user to decide the amount and frequency of the donation for hisself.
I looked up in the Braintree documentation, and I couldn't find out if and how to pass the amount of the subscription.
I am asking now how can I override the amount of the subscription. I am using Cashier/Braintree.
Should I apply them in the add-ons?
Full disclosure, I work at Braintree. If you have any further questions, contact support
You can change the default price of a subscription by passing the price parameter in your Subscription.create() API request. This will override the default price set by the plan you've configured. As an example, your API request may look something similar to this if you wanted to change the price of a single subscription to $20:
$result = $gateway->subscription()->create([
'paymentMethodToken' => 'the_token',
'planId' => 'the_plan_id',
'price' => '20'
]);
I've found that it is much easier to manage the price of subscriptions by using this method, however, you may also find it easier to use add-ons instead. If you choose to use add-ons, you'll need to create each add-on in the Control Panel.
I just upgraded from Magento 1.6 to 1.9.2.1. So far everything came over pretty much correctly except that when I'm using Paypal I have an extension Magentix Fee that adds a certain amount to the subtotal. When the request is sent to Paypal it's including the grand total AMT(that already includes the fee) plus the amount of the fee ITEMAMT (grand total + fee) which brings throws off the calculation. So I getting the error:
"The totals of the cart item amounts do not match order amounts
(#10413: Transaction refused because of an invalid argument.)"
Anyone can help?
The 10413 error is thrown when the totals do not match.
PAYMENTREQUEST_n_AMT must exactly equal:
PAYMENTREQUEST_n_ITEMAMT +
PAYMENTREQUEST_n_SHIPPINGAMT +
PAYMENTREQUEST_n_INSURANCEAMT -
PAYMENTREQUEST_n_SHIPDISCAMT +
PAYMENTREQUEST_n_HANDLINGAMT +
PAYMENTREQUEST_n_TAXAMT
If those do not add up to the AMT field, the error will be thrown.
This error commonly occurs if your cart does any sort of rounding. Check to make sure that the amounts for the items/shipping are not passing with more than 2 decimal places and that the amounts add up correctly.
I added an item to the Paypal cart through an observer. Magentix Fee extension was adding it to the total instead of as an item that paypal need to do proper calculation.
Magentix is only compatible with Magento 1.7 and below.
For magento 1.9, either you disable "transfer cart line items" option in Magento admin Paypal payment method or modify the function updatePaypalTotal() function in Magentix observer class to replace $cart->updateTotal() with $cart->addItem("Fee", 1, $fee, "fee").
We have a website that we are trying add a gift certificate to the cart for every $100 someone spends (i.e. a customer gets a $10 gift certificate for every $100 they spend). We are currently using Magento 1.6.1 and Unirgy Gift Cerificate to do our gift certificate system. Does anyone have a better solution or a way to use our current system to do what we want?
I have looked into a whole bunch of Add to Cart extensions, but all of them don't seem to allow me to add a gift certificate to the cart.
the extension is paid so I cannot help you much here but: If you know how the gift card is added to cart (check extension code to find out) you could try adding observer using 'checkout_cart_product_add_after' event. On how to add events, check here:
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method
In the observer method, check how much $$$ the cart does have by getting quote e.g:
$quote = Mage::getSingleton('checkout/type_onepage')->getQuote();
and gathering grand total (getGrandTotal metod I guess)
and add as many coupons as you would like ($total/100 = $gifcard_amount) and then reuse the code by using
for ($i=0;$i<$giftcard_amount;$i++){
//giftcard add logic
}
Hope this will get you started.
I'm using magento 1.7, and one of the payment options is Paypal (UK) express checkout.
The problem is that I don't want paypal to send out emails with any tax breakdown on, is there a more straightforward way of solving this (at the Magento or Paypal end) rather than hacking the core module to pass sub+tax as sub and 0 as tax?
I can see that a lot of the fields are mapped in Model/Api/Nvp.php, but can't immediately see where I'd modify these values.
As far as I investigated, there is no easy configurable way to prevent taxes to be submitted to Paypal.
But indeed there is a core hack if you don't mind that only the total amount is submitted (no line items, no taxes).
Go to System/Config/Paypal and set Transfer Cart Line Items to No.
In your code go to function _validate() in class Mage_Paypal_Model_Cart.
At the end of this function add the following lines:
$this->_areItemsValid = false;
$this->_areTotalsValid = false;
Of course it is nicer to to rewrite this class in your app/code/local folder.
I ’m in need of setting up approvers for orders that customers submit.
There is no credit card authorization required. For example, an employee from a company puts foo and bar into their shopping cart and checks out. One of the employee’s bosses need to approve it (the superiors will have accounts in magento already) before they can be invoiced. So when an order is placed, an email needs to go to the bosses, with a URL to the order. Then they can accept it or decline it.
Is there an existing extension that does something like this or would be a good starting point?
Yep, there is. :)
Check out the free ZetaPrints Order Approval extension. I have experience with it and it does exactly what you want. ;)