move server/* to scnserver/*

This commit is contained in:
2022-12-21 12:35:56 +01:00
parent 2b4d77bab4
commit bbf7962e29
123 changed files with 0 additions and 0 deletions

38
scnserver/google/dummy.go Normal file
View File

@@ -0,0 +1,38 @@
package google
import (
"context"
_ "embed"
"fmt"
"gogs.mikescher.com/BlackForestBytes/goext/langext"
"strings"
"time"
)
type DummyGoogleAPIClient struct{}
func NewDummy() AndroidPublisherClient {
return &DummyGoogleAPIClient{}
}
func (d DummyGoogleAPIClient) GetProductPurchase(ctx context.Context, packageName string, productId string, token string) (*ProductPurchase, error) {
if strings.HasPrefix(token, "PURCHASED:") {
return &ProductPurchase{
Kind: "",
PurchaseTimeMillis: fmt.Sprintf("%d", time.Date(2000, 1, 1, 12, 0, 0, 0, time.UTC).UnixMilli()),
PurchaseState: langext.Ptr(PurchaseStatePurchased),
ConsumptionState: ConsumptionStateConsumed,
DeveloperPayload: "{}",
OrderId: "000",
PurchaseType: nil,
AcknowledgementState: AcknowledgementStateAcknowledged,
PurchaseToken: nil,
ProductId: langext.Ptr("1234-5678"),
Quantity: nil,
ObfuscatedExternalAccountId: "000",
ObfuscatedExternalProfileId: "000",
RegionCode: "DE",
}, nil
}
return nil, nil // = purchase not found
}