From 94cc694a188296377fc90d6c9b7076b0f6714717 Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Fri, 5 Dec 2025 13:41:38 +0000 Subject: [PATCH 1/5] add apple store config --- connectorconfig/applestore.go | 72 +++++++++++++++++++++++++++++++++++ connectorconfig/library.go | 4 ++ 2 files changed, 76 insertions(+) create mode 100644 connectorconfig/applestore.go diff --git a/connectorconfig/applestore.go b/connectorconfig/applestore.go new file mode 100644 index 0000000..21467d6 --- /dev/null +++ b/connectorconfig/applestore.go @@ -0,0 +1,72 @@ +package connectorconfig + +import ( + "encoding/json" + + "github.com/chargehive/configuration/environment" + "github.com/chargehive/configuration/v1/connector" + "github.com/chargehive/proto/golang/chargehive/chtype" +) + +type AppleStoreCredentials struct { +} + +func (c *AppleStoreCredentials) GetMID() string { + return "" +} + +func (c *AppleStoreCredentials) GetLibrary() Library { + return LibraryAppleStore +} +func (c *AppleStoreCredentials) GetSupportedTypes() []LibraryType { + return []LibraryType{LibraryTypeThirdPartyStore} +} + +func (c *AppleStoreCredentials) Validate() error { + return nil +} + +func (c *AppleStoreCredentials) GetSecureFields() []*string { + return nil +} + +func (c *AppleStoreCredentials) ToConnector() connector.Connector { + con := connector.Connector{Library: string(c.GetLibrary())} + con.Configuration, _ = json.Marshal(c) + return con +} + +func (c *AppleStoreCredentials) FromJson(input []byte) error { + return json.Unmarshal(input, c) +} + +func (c *AppleStoreCredentials) SupportsSca() bool { + return false +} + +func (c *AppleStoreCredentials) SupportsMethod(methodType chtype.PaymentMethodType, methodProvider chtype.PaymentMethodProvider) bool { + if !c.GetLibrary().SupportsMethod(methodType, methodProvider) { + return false + } + return true +} + +func (c *AppleStoreCredentials) SupportsCountry(country string) bool { + return true +} + +func (c *AppleStoreCredentials) CanPlanModeUse(mode environment.Mode) bool { + return true +} + +func (c *AppleStoreCredentials) IsRecoveryAgent() bool { + return false +} + +func (c *AppleStoreCredentials) Supports3RI() bool { + return false +} + +func (c *AppleStoreCredentials) IsAccountUpdater() bool { + return false +} diff --git a/connectorconfig/library.go b/connectorconfig/library.go index 6a8c29a..5206e9c 100644 --- a/connectorconfig/library.go +++ b/connectorconfig/library.go @@ -66,6 +66,9 @@ const ( // Tokenization Libraries LibraryTokenExNetworkTokenization Library = "tokenex-networktokenization" LibraryPagosNetworkTokenization Library = "pagos-networktokenization" + + // Apple Store + LibraryAppleStore Library = "applestore" ) type LibraryType string @@ -78,6 +81,7 @@ const ( LibraryTypeAuthentication LibraryType = "authentication" LibraryTypeScheduler LibraryType = "scheduler" LibraryTypeNetworkTokenization LibraryType = "networkTokenization" + LibraryTypeThirdPartyStore LibraryType = "thirdPartyStore" ) var LibraryTypeRegister = map[LibraryType]bool{ From da03e1804e0609385ed64ad406ad0cc6082aed05 Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Fri, 5 Dec 2025 13:50:11 +0000 Subject: [PATCH 2/5] add to register --- connectorconfig/library.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/connectorconfig/library.go b/connectorconfig/library.go index 5206e9c..81a32c2 100644 --- a/connectorconfig/library.go +++ b/connectorconfig/library.go @@ -422,4 +422,11 @@ var LibraryRegister = map[Library]LibraryDef{ return methodType == chtype.PAYMENT_METHOD_TYPE_CARD }, }, + LibraryAppleStore: { + DisplayName: "Apple Store", + Credentials: func() Credentials { return &AppleStoreCredentials{} }, + SupportsMethod: func(methodType chtype.PaymentMethodType, methodProvider chtype.PaymentMethodProvider) bool { + return false + }, + }, } From f0a88d491ce199f96cc286c068c9aa3a2accf80f Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Tue, 10 Feb 2026 14:47:43 +0000 Subject: [PATCH 3/5] rename library --- connectorconfig/library.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectorconfig/library.go b/connectorconfig/library.go index 81a32c2..e385ced 100644 --- a/connectorconfig/library.go +++ b/connectorconfig/library.go @@ -68,7 +68,7 @@ const ( LibraryPagosNetworkTokenization Library = "pagos-networktokenization" // Apple Store - LibraryAppleStore Library = "applestore" + LibraryAppleStore Library = "apple-store" ) type LibraryType string From 362223d08e74fed1c0ff69bfa39508bcec1495c5 Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Wed, 11 Mar 2026 16:37:46 +0000 Subject: [PATCH 4/5] add supported token types for apple store credentials --- connectorconfig/applestore.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connectorconfig/applestore.go b/connectorconfig/applestore.go index 21467d6..f654d21 100644 --- a/connectorconfig/applestore.go +++ b/connectorconfig/applestore.go @@ -5,6 +5,7 @@ import ( "github.com/chargehive/configuration/environment" "github.com/chargehive/configuration/v1/connector" + "github.com/chargehive/configuration/v1/scheduler" "github.com/chargehive/proto/golang/chargehive/chtype" ) @@ -70,3 +71,7 @@ func (c *AppleStoreCredentials) Supports3RI() bool { func (c *AppleStoreCredentials) IsAccountUpdater() bool { return false } + +func (c *AppleStoreCredentials) SupportedTokenTypes() []scheduler.TokenSource { + return []scheduler.TokenSource{} +} From 1dcc44612ad88a3b464a2b753863a86aca33415b Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Wed, 11 Mar 2026 16:38:56 +0000 Subject: [PATCH 5/5] return nil --- connectorconfig/applestore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectorconfig/applestore.go b/connectorconfig/applestore.go index f654d21..d27d17c 100644 --- a/connectorconfig/applestore.go +++ b/connectorconfig/applestore.go @@ -73,5 +73,5 @@ func (c *AppleStoreCredentials) IsAccountUpdater() bool { } func (c *AppleStoreCredentials) SupportedTokenTypes() []scheduler.TokenSource { - return []scheduler.TokenSource{} + return nil }