generated from mrz1836/go-template
/
client_paymail.go
39 lines (33 loc) · 1.11 KB
/
client_paymail.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package engine
import (
"github.com/bitcoin-sv/go-paymail"
)
// PaymailClient will return the Paymail if it exists
func (c *Client) PaymailClient() paymail.ClientInterface {
if c.options.paymail != nil && c.options.paymail.client != nil {
return c.options.paymail.Client()
}
return nil
}
// GetPaymailConfig will return the Paymail server config if it exists
func (c *Client) GetPaymailConfig() *PaymailServerOptions {
if c.options.paymail != nil && c.options.paymail.serverConfig != nil {
return c.options.paymail.serverConfig
}
return nil
}
// Client will return the paymail client from the options struct
func (p *paymailOptions) Client() paymail.ClientInterface {
return p.client
}
// FromSender will return either the configuration value or the application default
func (p *paymailOptions) FromSender() string {
if len(p.serverConfig.DefaultFromPaymail) > 0 {
return p.serverConfig.DefaultFromPaymail
}
return defaultSenderPaymail
}
// ServerConfig will return the Paymail Server configuration from the options struct
func (p *paymailOptions) ServerConfig() *PaymailServerOptions {
return p.serverConfig
}