From 7a79e93b27534d3b5f8b3bac100476a3f954a4e7 Mon Sep 17 00:00:00 2001 From: Felippe Date: Fri, 27 Mar 2026 11:57:53 +0000 Subject: [PATCH] Add Google Play Store connector configuration Add GoogleStoreCredentials struct and implement Credentials interface for Google Play Store third-party store integration. --- connectorconfig/googleStore.go | 77 ++++++++++++++++++++++++++++++++++ connectorconfig/library.go | 10 ++++- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 connectorconfig/googleStore.go diff --git a/connectorconfig/googleStore.go b/connectorconfig/googleStore.go new file mode 100644 index 0000000..64d8d53 --- /dev/null +++ b/connectorconfig/googleStore.go @@ -0,0 +1,77 @@ +package connectorconfig + +import ( + "encoding/json" + + "github.com/chargehive/configuration/environment" + "github.com/chargehive/configuration/v1/connector" + "github.com/chargehive/configuration/v1/scheduler" + "github.com/chargehive/proto/golang/chargehive/chtype" +) + +type GoogleStoreCredentials struct { +} + +func (c *GoogleStoreCredentials) GetMID() string { + return "" +} + +func (c *GoogleStoreCredentials) GetLibrary() Library { + return LibraryGoogleStore +} +func (c *GoogleStoreCredentials) GetSupportedTypes() []LibraryType { + return []LibraryType{LibraryTypeThirdPartyStore} +} + +func (c *GoogleStoreCredentials) Validate() error { + return nil +} + +func (c *GoogleStoreCredentials) GetSecureFields() []*string { + return nil +} + +func (c *GoogleStoreCredentials) ToConnector() connector.Connector { + con := connector.Connector{Library: string(c.GetLibrary())} + con.Configuration, _ = json.Marshal(c) + return con +} + +func (c *GoogleStoreCredentials) FromJson(input []byte) error { + return json.Unmarshal(input, c) +} + +func (c *GoogleStoreCredentials) SupportsSca() bool { + return false +} + +func (c *GoogleStoreCredentials) SupportsMethod(methodType chtype.PaymentMethodType, methodProvider chtype.PaymentMethodProvider) bool { + if !c.GetLibrary().SupportsMethod(methodType, methodProvider) { + return false + } + return true +} + +func (c *GoogleStoreCredentials) SupportsCountry(country string) bool { + return true +} + +func (c *GoogleStoreCredentials) CanPlanModeUse(mode environment.Mode) bool { + return true +} + +func (c *GoogleStoreCredentials) IsRecoveryAgent() bool { + return false +} + +func (c *GoogleStoreCredentials) Supports3RI() bool { + return false +} + +func (c *GoogleStoreCredentials) IsAccountUpdater() bool { + return false +} + +func (c *GoogleStoreCredentials) SupportedTokenTypes() []scheduler.TokenSource { + return nil +} diff --git a/connectorconfig/library.go b/connectorconfig/library.go index e385ced..48d355d 100644 --- a/connectorconfig/library.go +++ b/connectorconfig/library.go @@ -68,7 +68,8 @@ const ( LibraryPagosNetworkTokenization Library = "pagos-networktokenization" // Apple Store - LibraryAppleStore Library = "apple-store" + LibraryAppleStore Library = "apple-store" + LibraryGoogleStore Library = "google-store" ) type LibraryType string @@ -429,4 +430,11 @@ var LibraryRegister = map[Library]LibraryDef{ return false }, }, + LibraryGoogleStore: { + DisplayName: "Google Play Store", + Credentials: func() Credentials { return &GoogleStoreCredentials{} }, + SupportsMethod: func(methodType chtype.PaymentMethodType, methodProvider chtype.PaymentMethodProvider) bool { + return false + }, + }, }