| @@ -111,10 +111,19 @@ func buildLeanworkOutByRpnIn(ri RpnIn) (ret LeanworkOut, err error) { | |||
| } | |||
| func (m *LeanworkOut) UpdateSignature() { | |||
| s := m.SignType + m.OrderNo + m.OrderAmount + m.OrderCurrency + m.TransactionId + m.Status + Config.LeanWork.MD5Key | |||
| s := m.SignType + m.OrderNo + m.OrderAmount + m.OrderCurrency + m.TransactionId + m.Status + m.getLeanworkMD5Key() | |||
| m.Sign = md5str(s) | |||
| } | |||
| func (m *LeanworkOut) getLeanworkMD5Key() string { | |||
| li, err := getLeanworkInById(m.Leanwork) | |||
| if err != nil { | |||
| log.Printf("Error determin P2P or FAT, leanworkIn = %d", m.Leanwork) | |||
| return "" | |||
| } | |||
| return li.MD5Key | |||
| } | |||
| func (m *LeanworkOut) add2db() (ret LeanworkOut, err error) { | |||
| if err = db.conn(Config); err != nil { | |||
| return | |||