Merge pull request #54 from MizukiSonoko/default-description-uses-db-settings

Make DefaultDescription uses db settings
This commit is contained in:
Peter Rounce 2023-04-22 10:10:18 +01:00 committed by GitHub
commit 24082c831f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -23,6 +23,7 @@ Here are the descriptions of values available to use in the `settings` table:
| FUNCTION_LNURLW | ENABLE | system level switch for LNURLw (bolt card) services |
| FUNCTION_LNURLP | DISABLE | system level switch for LNURLp (lightning address) services |
| FUNCTION_EMAIL | DISABLE | system level switch for email updates on credits & debits |
| DEFAULT_DESCRIPTION | 'bolt card service' | default description of payment |
| AWS_SES_ID | | Amazon Web Services - Simple Email Service - access id |
| AWS_SES_SECRET | | Amazon Web Services - Simple Email Service - access secret |
| AWS_SES_EMAIL_FROM | | Amazon Web Services - Simple Email Service - email from field |

View file

@ -312,11 +312,13 @@ func Response(w http.ResponseWriter, req *http.Request) {
return
}
defalut_description := db.Get_setting("DEFAULT_DESCRIPTION")
response := ResponseData{}
response.Tag = "withdrawRequest"
response.Callback = lnurlw_cb_url
response.LnurlwK1 = lnurlw_k1
response.DefaultDescription = "WWT withdrawal"
response.DefaultDescription = defalut_description
response.MinWithdrawable = min_withdraw_sats * 1000 // milliSats
response.MaxWithdrawable = max_withdraw_sats * 1000 // milliSats

View file

@ -20,6 +20,7 @@ INSERT INTO settings (name, value) VALUES ('LN_TESTNODE', '');
INSERT INTO settings (name, value) VALUES ('FUNCTION_LNURLW', '');
INSERT INTO settings (name, value) VALUES ('FUNCTION_LNURLP', '');
INSERT INTO settings (name, value) VALUES ('FUNCTION_EMAIL', '');
INSERT INTO settings (name, value) VALUES ('DEFAULT_DESCRIPTION', 'bolt card service');
INSERT INTO settings (name, value) VALUES ('AWS_SES_ID', '');
INSERT INTO settings (name, value) VALUES ('AWS_SES_SECRET', '');
INSERT INTO settings (name, value) VALUES ('AWS_SES_EMAIL_FROM', '');