我需要拒绝折扣,但我也希望只适用于某些产品的折扣金额。
例如:我的购物车是A,B,我有10%的订单折扣。我不想B产品打折,但我只想打折A,我的方法是这样
if cart.discount_code&.percentage
discount = cart.discount_code.percentage / 100.0
discount = 1.0 - discount.to_s.to_f # there's probably a better way to do this... but :)
cart.line_items.each do |line_item|
我刚刚成功地将文件写入Google云存储并读取它。将应用程序部署到appspot后,一切正常,但在本地运行时出现错误:
INTERNAL_SERVER_ERROR
Caused by:java.io.IOException
at com.google.appengine.api.files.FileServiceImpl.translateException(FileServiceImpl.java:586)
at com.google.appengine.api.files.FileServiceImpl.makeSyncCall(FileServic