Skip to content

Commit

Permalink
Fix field APIEnvType
Browse files Browse the repository at this point in the history
  • Loading branch information
haritsfahreza committed Jul 24, 2018
1 parent a85dc40 commit 30bf364
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example/simplepay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func main() {
http.Handle("/snap", &templateHandler{
filename: "snap_index.html",
dataInitializer: func(t *templateHandler) {
snapResp, err := snapGateway.GetTokenQuick(generateOrderId(), 200000)
snapResp, err := snapGateway.GetTokenQuick(generateOrderID(), 200000)
t.data = make(map[string]interface{})

if err != nil {
Expand All @@ -48,7 +48,7 @@ func setupMidtrans() {
midclient = midtrans.NewClient()
midclient.ServerKey = "VT-server-7CVlR3AJ8Dpkez3k_TeGJQZU"
midclient.ClientKey = "VT-client-IKktHiy3aRYHljsw"
midclient.ApiEnvType = midtrans.Sandbox
midclient.APIEnvType = midtrans.Sandbox

coreGateway = midtrans.CoreGateway{
Client: midclient,
Expand All @@ -66,7 +66,7 @@ func chargeDirect(w http.ResponseWriter, r *http.Request) {
TokenID: r.FormValue("card-token"),
},
TransactionDetails: midtrans.TransactionDetails{
OrderID: generateOrderId(),
OrderID: generateOrderID(),
GrossAmt: 200000,
},
})
Expand All @@ -75,6 +75,6 @@ func chargeDirect(w http.ResponseWriter, r *http.Request) {
fmt.Println(chargeResp.StatusMessage)
}

func generateOrderId() string {
func generateOrderID() string {
return strconv.FormatInt(time.Now().UnixNano(), 10)
}

0 comments on commit 30bf364

Please sign in to comment.