fix order payment bug and add statistics code