From ade758f740c4ada49325e0eb269684eba729af70 Mon Sep 17 00:00:00 2001 From: Duke Date: Mon, 13 May 2024 18:56:20 +0800 Subject: [PATCH] feat(playstore): add VoidedPurchaseRefundType --- playstore/notification.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/playstore/notification.go b/playstore/notification.go index e699137..9de6c42 100644 --- a/playstore/notification.go +++ b/playstore/notification.go @@ -35,6 +35,13 @@ const ( VoidedPurchaseProductTypeOneTime ) +type VoidedPurchaseRefundType int + +const ( + VoidedPurchaseRefundTypeFullRefund VoidedPurchaseRefundType = iota + 1 + VoidedPurchaseRefundTypePartialRefund +) + // DeveloperNotification is sent by a Pub/Sub topic. // Detailed description is following. // https://developer.android.com/google/play/billing/rtdn-reference#json_specification @@ -83,10 +90,12 @@ type OneTimeProductNotification struct { // VoidedPurchaseNotification has token, order and product type to locate the right purchase and order. // To learn how to get additional information about the voided purchase, check out the Google Play Voided Purchases API, // which is a pull model that provides additional data for voided purchases between a given timestamp. +// https://developer.android.com/google/play/billing/rtdn-reference#voided-purchase type VoidedPurchaseNotification struct { PurchaseToken string `json:"purchaseToken"` OrderID string `json:"orderId"` ProductType VoidedPurchaseProductType `json:"productType"` + RefundType VoidedPurchaseRefundType `json:"refundType"` } // TestNotification is the test publish that are sent only through the Google Play Developer Console