mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-25 21:27:42 +00:00
add receipt and device deletion
This commit is contained in:
parent
8723bf6c5c
commit
4261c6771c
3 changed files with 20 additions and 0 deletions
|
@ -67,6 +67,10 @@ func (a *api) Routes() *httprouter.Router {
|
|||
router.POST("/v1/device", a.upsertDeviceHandler)
|
||||
router.POST("/v1/device/:apns/test", a.testDeviceHandler)
|
||||
router.POST("/v1/device/:apns/account", a.upsertAccountHandler)
|
||||
router.DELETE("/v1/device/:apns", a.deleteDeviceHandler)
|
||||
|
||||
router.POST("/v1/receipt", a.checkReceiptHandler)
|
||||
router.POST("/v1/receipt/:apns", a.checkReceiptHandler)
|
||||
|
||||
return router
|
||||
}
|
||||
|
|
|
@ -91,3 +91,7 @@ func (a *api) testDeviceHandler(w http.ResponseWriter, r *http.Request, ps httpr
|
|||
}
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
func (a *api) deleteDeviceHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
|
12
internal/api/receipt.go
Normal file
12
internal/api/receipt.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
func (a *api) checkReceiptHandler(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
w.Write([]byte(`{"status_code": 11, "status_message": "Receipt is valid, lifetime subscription", "subscription_type": "lifetime"}`))
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
Loading…
Reference in a new issue