lmw
2023-05-12 f67802a41f9e01444d1115f34ecc6e1beb05fc3b
1
package com.fuban.user.utils.pay; import android.text.TextUtils; public class PayResult {     private String resultStatus;     private String result;     private String memo;     public PayResult(String rawResult) {         if (TextUtils.isEmpty(rawResult))             return;         String[] resultParams = rawResult.split(";");         for (String resultParam : resultParams) {             if (resultParam.startsWith("resultStatus")) {                 resultStatus = gatValue(resultParam, "resultStatus");             }             if (resultParam.startsWith("result")) {                 result = gatValue(resultParam, "result");             }             if (resultParam.startsWith("memo")) {                 memo = gatValue(resultParam, "memo");             }         }     }     @Override     public String toString() {         return "resultStatus={" + resultStatus + "};memo={" + memo                 + "};result={" + result + "}";     }     private String gatValue(String content, String key) {         String prefix = key + "={";         return content.substring(content.indexOf(prefix) + prefix.length(),                 content.lastIndexOf("}"));     }     /**      * @return the resultStatus      */     public String getResultStatus() {         return resultStatus;     }     /**      * @return the memo      */     public String getMemo() {         return memo;     }     /**      * @return the result      */     public String getResult() {         return result;     } }