Is the extension compatible with Checkout by Amazon or AmazonPayments (both Creativestyle) ?
No for AmazonPayments.
Yes for Checkout by Amazon. Please use the below workaround when installing Fooman Surcharge with Checkout By Amazon:
1. Edit the following file: /app/code/community/Creativestyle/CheckoutByAmazon/controllers/CheckoutController.php
2. Look for the following code:
foreach ($order->getItemsCollection() as $item) {
$productId = $this->_getProductId($item);
if (!$productId) continue;
$product = Mage::getModel('catalog/product')->load($productId);
$amazonItem = Mage::getModel('checkoutbyamazon/api_model_checkout_purchaseItem', array(
'MerchantItemId' => $item->getId(),
'SKU' => Mage::helper('checkoutbyamazon')->sanitizeSku($item->getSku()),
'Title' => $item->getName(),
'UnitPrice' => array('Amount' => Mage::helper('checkoutbyamazon')-
>sanitizePrice($item->getBasePriceInclTax())),
'Quantity' => round($item->getQtyOrdered())
));
$amazonItem->setItemTax($this->_getAmazonPrice($item->getBaseTaxAmount()));
$itemList->addItem($amazonItem);
unset($product);
}
3. Directly after the code above, add the following code:
if ($order->getBaseFoomanSurchargeAmount() != 0) {
$amazonItem = Mage::getModel('checkoutbyamazon/api_model_checkout_purchaseItem', array(
'MerchantItemId' => 'surcharge',
'SKU' => Mage::helper('checkoutbyamazon')->sanitizeSku($order->getFoomanSurchargeDescription()),
'Title' => $order->getFoomanSurchargeDescription(),
'UnitPrice' => array(
'Amount' => Mage::helper('checkoutbyamazon')->sanitizePrice($order>getBaseFoomanSurchargeAmount()+$order->getBaseFoomanSurchargeTaxAmount())),
'Quantity' => 1
)
);
$amazonItem->setItemTax($this->_getAmazonPrice($order->getBaseFoomanSurchargeTaxAmount()));
$itemList->addItem($amazonItem);
}