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