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