Compare commits
5 Commits
testing
...
documentat
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ca5bd9bb8 | |||
| c429c1966e | |||
| 50e1ba32f3 | |||
| 85b0c53c0a | |||
| 366d80a9ee |
@@ -180,7 +180,7 @@ func (h *CardHandler) CollectCard(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// SaveCardRequest holds the raw card fields submitted by the TUI.
|
// SaveCardRequest holds the raw card fields submitted by the TUI.
|
||||||
// Tokenization happens server-side so the Stripe secret key never
|
// Tokenization happens server-side so the Stripe secret key never
|
||||||
// touches the SSH client or TUI layer..
|
// touches the SSH client or TUI layer.
|
||||||
type SaveCardRequest struct {
|
type SaveCardRequest struct {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// Package notify provides a simple interface to send notifications to Slack.
|
||||||
package notify
|
package notify
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -14,8 +15,10 @@ import (
|
|||||||
"terminalShop/pkg/models"
|
"terminalShop/pkg/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// slack client
|
||||||
var slackClient = &http.Client{Timeout: 5 * time.Second}
|
var slackClient = &http.Client{Timeout: 5 * time.Second}
|
||||||
|
|
||||||
|
// dollars converts cents to dollars
|
||||||
func dollars(cents int) string {
|
func dollars(cents int) string {
|
||||||
return fmt.Sprintf("$%.2f", float64(cents)/100)
|
return fmt.Sprintf("$%.2f", float64(cents)/100)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user