Commit 9dfccb66 by pye52

完善PayOfflineViewModel注释

parent dee7658c
......@@ -133,6 +133,8 @@ public class PayOfflineViewModel extends ViewModel {
}
};
// 当支付时websocket未链接,则走离线支付流程
// 此时直接标记订单为"离线支付"状态
private class MarkRunnable implements Runnable {
private PayData payData;
......@@ -207,6 +209,7 @@ public class PayOfflineViewModel extends ViewModel {
return;
}
// 保存服务器返回的结果
PayResponse payResponse = gson.fromJson(response, PayResponse.class);
payOfflineState.postValue(new PayOfflineState(PayOfflineState.SUCCESS, payResponse.getMessage()));
long lastInsertId = payResponseRepository.insertPayResponse(payResponse);
......@@ -215,7 +218,7 @@ public class PayOfflineViewModel extends ViewModel {
}
List<PayData> dataList = payRequest.getData();
// 设置所有离线支付订单状态为支付成功
// 设置离线支付订单状态为支付成功
// 同时在日志中记录所有订单的payCode
StringBuilder ids = new StringBuilder();
for (PayData data : dataList) {
......@@ -238,6 +241,7 @@ public class PayOfflineViewModel extends ViewModel {
}
}
// 离线订单发送到后台超时后,重置其标志位保存到数据库
private class TimeoutRunnable implements Runnable {
@Override
public void run() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment