x/payments/config.go

26 lines
434 B
Go
Raw Normal View History

2019-09-30 14:54:54 -04:00
package payments
import (
"fmt"
"os"
)
2019-09-30 14:54:54 -04:00
type Config struct {
StripeKey string
StripeProductID string
RedirectURL string
TenantSetup func(subscriptionID, customerID string) (tenantID string)
}
func FromEnv() Config {
return Config{
StripeKey: os.Getenv("STRIPE_KEY"),
StripeProductID: os.Getenv("STRIPE_PRODUCT_ID"),
RedirectURL: "/",
}
}
func PrintConfig() {
fmt.Printf("%#v\n", FromEnv())
2019-09-30 14:54:54 -04:00
}