|
| 1 | +package connectorconfig |
| 2 | + |
| 3 | +import ( |
| 4 | + "encoding/json" |
| 5 | + |
| 6 | + "github.com/chargehive/configuration/environment" |
| 7 | + "github.com/chargehive/configuration/v1/connector" |
| 8 | + "github.com/chargehive/proto/golang/chargehive/chtype" |
| 9 | +) |
| 10 | + |
| 11 | +type PagosRealtimeAccountUpdaterCredentials struct { |
| 12 | + MerchantId string `json:"merchantId" yaml:"merchantId"` |
| 13 | +} |
| 14 | + |
| 15 | +func (c *PagosRealtimeAccountUpdaterCredentials) GetMID() string { |
| 16 | + return c.MerchantId |
| 17 | +} |
| 18 | + |
| 19 | +func (c *PagosRealtimeAccountUpdaterCredentials) GetLibrary() Library { |
| 20 | + return LibraryPagosRealtimeAccountUpdater |
| 21 | +} |
| 22 | + |
| 23 | +func (c *PagosRealtimeAccountUpdaterCredentials) GetSupportedTypes() []LibraryType { |
| 24 | + return []LibraryType{LibraryTypeMethodUpdater} |
| 25 | +} |
| 26 | + |
| 27 | +func (c *PagosRealtimeAccountUpdaterCredentials) Validate() error { |
| 28 | + return nil |
| 29 | +} |
| 30 | + |
| 31 | +func (c *PagosRealtimeAccountUpdaterCredentials) GetSecureFields() []*string { |
| 32 | + return []*string{} |
| 33 | +} |
| 34 | + |
| 35 | +func (c *PagosRealtimeAccountUpdaterCredentials) ToConnector() connector.Connector { |
| 36 | + con := connector.Connector{Library: string(c.GetLibrary())} |
| 37 | + con.Configuration, _ = json.Marshal(c) |
| 38 | + return con |
| 39 | +} |
| 40 | + |
| 41 | +func (c *PagosRealtimeAccountUpdaterCredentials) FromJson(input []byte) error { |
| 42 | + return json.Unmarshal(input, c) |
| 43 | +} |
| 44 | + |
| 45 | +func (c *PagosRealtimeAccountUpdaterCredentials) SupportsSca() bool { |
| 46 | + return false |
| 47 | +} |
| 48 | + |
| 49 | +func (c *PagosRealtimeAccountUpdaterCredentials) SupportsMethod(methodType chtype.PaymentMethodType, methodProvider chtype.PaymentMethodProvider) bool { |
| 50 | + if !c.GetLibrary().SupportsMethod(methodType, methodProvider) { |
| 51 | + return false |
| 52 | + } |
| 53 | + return true |
| 54 | +} |
| 55 | + |
| 56 | +func (c *PagosRealtimeAccountUpdaterCredentials) SupportsCountry(country string) bool { |
| 57 | + return true |
| 58 | +} |
| 59 | + |
| 60 | +func (c *PagosRealtimeAccountUpdaterCredentials) CanPlanModeUse(environment.Mode) bool { |
| 61 | + return true |
| 62 | +} |
| 63 | + |
| 64 | +func (c *PagosRealtimeAccountUpdaterCredentials) IsRecoveryAgent() bool { |
| 65 | + return false |
| 66 | +} |
| 67 | + |
| 68 | +func (c *PagosRealtimeAccountUpdaterCredentials) Supports3RI() bool { |
| 69 | + return false |
| 70 | +} |
| 71 | + |
| 72 | +func (c *PagosRealtimeAccountUpdaterCredentials) IsAccountUpdater() bool { |
| 73 | + return true |
| 74 | +} |
0 commit comments