[轉]Magento REST API Cart
https://bitbucket.org/snippets/lbanka/qne7/magento-rest-api-cart
https://bitbucket.org/snippets/lbanka/qne7/magento-rest-api-cart
http://www.demacmedia.com/magento-commerce/mini-tutorial-creating-shopping-cart-rules-programatically/
pay moeny API2Cart Moltin
https://gist.github.com/roberto-butti/3509401
最近再試,發現 Math.round() 又正確了….奇了! 116.55出來是116 ========== 一般的說法是Math.round() 但實際上跑 decimal num = 116.55 Math.round(num) 結果是 117 這是錯的!! 所以 參考這個 https://windperson.wordpress.com/2013/02/21/c-%E5%B0%87%E5%B0%8F%E6%95%B8%E9%BB%9E%E5%BE%8C%E6%8C%87%E5%AE%9A%E4%BD%8D%E6%95%B8%E7%9A%84%E6%95%B8%E5%80%BC%E5%8E%BB%E6%8E%89%E7%9A%84%E6%96%B9%E6%B3%95/ 改成 decimal GetFrag1(decimal input,int digit) //這個四捨六入五成雙才正確 { if (digit < 0) { return Math.Floor(input); } double pow = Math.Pow(10, digit); decimal sign = input >= 0 ? 1 : -1; return sign * Math.Floor(sign * input * (decimal)pow) / (decimal)pow; } GetFrag1(num, 0).ToString() 結果 116