forked from BuxOrg/bux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient_paymail.go
47 lines (40 loc) · 1.34 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
40
41
42
43
44
45
46
47
package bux
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
}
// Note will return either the configuration value or the application default
func (p *paymailOptions) Note() string {
if len(p.serverConfig.DefaultNote) > 0 {
return p.serverConfig.DefaultNote
}
return defaultAddressResolutionPurpose
}
// ServerConfig will return the Paymail Server configuration from the options struct
func (p *paymailOptions) ServerConfig() *PaymailServerOptions {
return p.serverConfig
}