2025-09-09 09:27:43 +08:00

26 lines
688 B
Go

package service
import "git.linkiio.cn/linkpay/protobuf"
/**
* 返回状态 参考 protobuf.State 枚举
* 本方法做为示例,实际业务中,根据渠道返回状态时,需要根据具体情况进行判断和转换
* @see https://git.linkiio.cn/linkpay/protobuf/src/commit/982698cc1cf9d050d21f904563b5403d1f11d987/org.pb.go#L26
* @param void
* @author dc.To
* @version 20250425
*/
func GetState(orgState interface{}) protobuf.State {
var state = protobuf.State_Pending
//当渠道终态 成功时,状态为成功
if orgState == "success" {
state = protobuf.State_Success
} else if orgState == "failed" {
state = protobuf.State_Failure
}
return state
}