- refactor.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package elmapi
|
||||
|
||||
const (
|
||||
OrderEffective = 10
|
||||
OrderValid = 10
|
||||
MerchantValid = 12
|
||||
OrderCanceled = 14
|
||||
MerchantInvalid = 15
|
||||
@@ -23,3 +23,7 @@ type ELMCallbackMsg struct {
|
||||
UserId int64 `json:"userId"`
|
||||
Signature string `json:"signature"`
|
||||
}
|
||||
|
||||
var (
|
||||
ELMResponseOK = &ELMCallbackResponse{"ok"}
|
||||
)
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
package elmapi
|
||||
|
||||
const (
|
||||
ELMOrderStatusPending = "pending"
|
||||
ELMOrderStatusUnprocessed = "unprocessed"
|
||||
ELMOrderStatusRefunding = "refunding"
|
||||
ELMOrderStatusValid = "valid"
|
||||
ELMOrderStatusInvalid = "invalid"
|
||||
ELMOrderStatusSettled = "settled"
|
||||
)
|
||||
|
||||
func (e *ELMAPI) GetOrder(orderId string) (map[string]interface{}, error) {
|
||||
result, err := e.AccessELM("eleme.order.getOrder", map[string]interface{}{
|
||||
"orderId": orderId,
|
||||
})
|
||||
|
||||
if err == nil {
|
||||
innerResult := map[string]interface{}(result.Result.(map[string]interface{}))
|
||||
innerResult := result.Result.(map[string]interface{})
|
||||
return innerResult, nil
|
||||
}
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user