improve alipay calculation logic