增加荣耀支付

This commit is contained in:
ayflying
2025-07-29 10:15:57 +08:00
parent 7c19a66cb5
commit d1a7ba8119
4 changed files with 136 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package honor
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
"net/http"
)
func (p *Pay) Notification(r *http.Request) {
}
// ConsumeProduct 商品消耗
func (p *Pay) ConsumeProduct(purchaseToken string) (err error) {
url := Host + "/iap/server/consumeProduct"
_, err = g.Client().ContentJson().Post(gctx.New(), url, g.Map{
"purchaseToken": purchaseToken,
"developerChallenge": "",
})
if err != nil {
return
}
return
}