diff --git a/connectorconfig/adyen.go b/connectorconfig/adyen.go index 0cb7883..0a8d053 100644 --- a/connectorconfig/adyen.go +++ b/connectorconfig/adyen.go @@ -2,6 +2,7 @@ package connectorconfig import ( "encoding/json" + "github.com/chargehive/configuration/environment" "github.com/chargehive/configuration/v1/connector" "github.com/chargehive/proto/golang/chargehive/chtype" @@ -15,13 +16,14 @@ const ( ) type AdyenCredentials struct { - Environment AdyenEnvironment `json:"environment" yaml:"environment" validate:"required,oneof=sandbox production"` - MerchantAccount string `json:"merchantAccount" yaml:"merchantAccount" validate:"required"` - ApiKey *string `json:"apiKey" yaml:"apiKey" validate:"required"` - ApiPrefix string `json:"apiPrefix" yaml:"apiPrefix" validate:"required"` - HMACKey *string `json:"hmacKey" yaml:"hmacKey" validate:"required"` - GooglePay *GooglePayCredentials `json:"googlePay,omitempty" yaml:"googlePay,omitempty"` - ApplePay *ApplePayCredentials `json:"applePay,omitempty" yaml:"applePay,omitempty"` + Environment AdyenEnvironment `json:"environment" yaml:"environment" validate:"required,oneof=sandbox production"` + MerchantAccount string `json:"merchantAccount" yaml:"merchantAccount" validate:"required"` + MerchantDescriptor string `json:"merchantDescriptor" yaml:"merchantDescriptor" validate:"-"` + ApiKey *string `json:"apiKey" yaml:"apiKey" validate:"required"` + ApiPrefix string `json:"apiPrefix" yaml:"apiPrefix" validate:"required"` + HMACKey *string `json:"hmacKey" yaml:"hmacKey" validate:"required"` + GooglePay *GooglePayCredentials `json:"googlePay,omitempty" yaml:"googlePay,omitempty"` + ApplePay *ApplePayCredentials `json:"applePay,omitempty" yaml:"applePay,omitempty"` } func (c *AdyenCredentials) GetMID() string { diff --git a/connectorconfig/braintree.go b/connectorconfig/braintree.go index 616422f..ca42601 100644 --- a/connectorconfig/braintree.go +++ b/connectorconfig/braintree.go @@ -19,15 +19,16 @@ const ( // https://articles.braintreepayments.com/control-panel/important-gateway-credentials type BraintreeCredentials struct { - PublicKey *string `json:"publicKey" yaml:"publicKey" validate:"required,gt=0"` - PrivateKey *string `json:"privateKey" yaml:"privateKey" validate:"required,gt=0"` - MerchantID string `json:"merchantID" yaml:"merchantID" validate:"required"` - MerchantAccountID string `json:"merchantAccountID" yaml:"merchantAccountID" validate:"-"` - Currency string `json:"currency" yaml:"currency" validate:"oneof=AED AMD AOA ARS AUD AWG AZN BAM BBD BDT BGN BIF BMD BND BOB BRL BSD BWP BYN BZD CAD CHF CLP CNY COP CRC CVE CZK DJF DKK DOP DZD EGP ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR ISK JMD JPY KES KGS KHR KMF KRW KYD KZT LAK LBP LKR LRD LSL LTL MAD MDL MKD MNT MOP MUR MVR MWK MXN MYR MZN NAD NGN NIO NOK NPR NZD PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SEK SGD SHP SLL SOS SRD STD SVC SYP SZL THB TJS TOP TRY TTD TWD TZS UAH UGX USD UYU UZS VES VND VUV WST XAF XCD XOF XPF YER ZAR ZMK ZWD"` - Environment BraintreeEnvironment `json:"environment" yaml:"environment" validate:"oneof=sandbox production"` - GooglePay *GooglePayCredentials `json:"googlePay,omitempty" yaml:"googlePay,omitempty"` - ApplePay *ApplePayCredentials `json:"applePay,omitempty" yaml:"applePay,omitempty"` - TokenizationKey string `json:"tokenizationKey,omitempty" yaml:"tokenizationKey,omitempty" validate:"required_with=GooglePayEmbedded ApplePay,omitempty,gt=0"` + PublicKey *string `json:"publicKey" yaml:"publicKey" validate:"required,gt=0"` + PrivateKey *string `json:"privateKey" yaml:"privateKey" validate:"required,gt=0"` + MerchantID string `json:"merchantID" yaml:"merchantID" validate:"required"` + MerchantAccountID string `json:"merchantAccountID" yaml:"merchantAccountID" validate:"-"` + MerchantDescriptor string `json:"merchantDescriptor" yaml:"merchantDescriptor" validate:"-"` + Currency string `json:"currency" yaml:"currency" validate:"oneof=AED AMD AOA ARS AUD AWG AZN BAM BBD BDT BGN BIF BMD BND BOB BRL BSD BWP BYN BZD CAD CHF CLP CNY COP CRC CVE CZK DJF DKK DOP DZD EGP ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR ISK JMD JPY KES KGS KHR KMF KRW KYD KZT LAK LBP LKR LRD LSL LTL MAD MDL MKD MNT MOP MUR MVR MWK MXN MYR MZN NAD NGN NIO NOK NPR NZD PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SEK SGD SHP SLL SOS SRD STD SVC SYP SZL THB TJS TOP TRY TTD TWD TZS UAH UGX USD UYU UZS VES VND VUV WST XAF XCD XOF XPF YER ZAR ZMK ZWD"` + Environment BraintreeEnvironment `json:"environment" yaml:"environment" validate:"oneof=sandbox production"` + GooglePay *GooglePayCredentials `json:"googlePay,omitempty" yaml:"googlePay,omitempty"` + ApplePay *ApplePayCredentials `json:"applePay,omitempty" yaml:"applePay,omitempty"` + TokenizationKey string `json:"tokenizationKey,omitempty" yaml:"tokenizationKey,omitempty" validate:"required_with=GooglePayEmbedded ApplePay,omitempty,gt=0"` } func (c *BraintreeCredentials) GetMID() string { diff --git a/connectorconfig/checkout.go b/connectorconfig/checkout.go index 63a26d2..63e402f 100644 --- a/connectorconfig/checkout.go +++ b/connectorconfig/checkout.go @@ -23,6 +23,7 @@ type CheckoutCredentials struct { Platform *string `json:"platform" yaml:"platform" validate:"required,oneof=default previous"` ProcessingChannelID string `json:"processingChannelId" yaml:"processingChannelId"` MerchantID string `json:"merchantID" yaml:"merchantID" validate:"required"` + MerchantDescriptor string `json:"merchantDescriptor" yaml:"merchantDescriptor" validate:"-"` Currency string `json:"currency" yaml:"currency" validate:"oneof=AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BRL BSD BTN BWP BYN BZD CAD CDF CHF CLF CLP CNY COP CRC CUP CVE CZK DJF DKK DOP DZD EEK EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LTL LVL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD UYU UZS VEF VND VUV WST XAF XCD XOF XPF YER ZAR ZMW ZWL"` Environment CheckoutEnvironment `json:"environment" yaml:"environment" validate:"oneof=sandbox production"` GooglePay *GooglePayCredentials `json:"googlePay,omitempty" yaml:"googlePay,omitempty"` diff --git a/connectorconfig/paysafe.go b/connectorconfig/paysafe.go index 22fa01e..bc53c83 100644 --- a/connectorconfig/paysafe.go +++ b/connectorconfig/paysafe.go @@ -28,6 +28,7 @@ const ( type PaySafeCredentials struct { Acquirer string `json:"acquirer" yaml:"acquirer" validate:"-"` MerchantURL string `json:"merchantURL" yaml:"merchantURL" validate:"required"` + MerchantDescriptor string `json:"merchantDescriptor" yaml:"merchantDescriptor" validate:"-"` AccountID string `json:"accountID" yaml:"accountID" validate:"required"` APIUsername *string `json:"apiUsername" yaml:"apiUsername" validate:"required,gt=0"` APIPassword *string `json:"apiPassword" yaml:"apiPassword" validate:"required,gt=0"`