Documentation
¶
Index ¶
- Variables
- func CallCallBack(event stripe.Event)
- func CheckIfEmailIsBeingUsedInStripe(email string) bool
- func CheckIfIDBeingUsedInStripe(id string) bool
- func CheckUserPaymentMethod(userID int) (bool, error)
- func CreateFreeTrial(userID int, start time.Time, duration time.Duration, PriceID string, ...) (*stripe.Subscription, error)
- func CreatePayment(userID int, amount float64, extraMetadata map[string]string) (*stripe.PaymentIntent, error)
- func CreatePaymentPage(userID int, amount float64, imageURL, description string, ...) (*stripe.CheckoutSession, error)
- func CreateScheduledSubscription(userID int, start time.Time, trial_duration time.Duration, PriceID string, ...) (*stripe.SubscriptionSchedule, error)
- func CreateSubscription(userID int, trial_duration time.Duration, PriceID string, ...) (*stripe.Subscription, error)
- func CreateSubscriptionPage(userID int, priceID string, extraMetadata map[string]string, ...) (*stripe.CheckoutSession, error)
- func GetCustomer(id string) (*stripe.Customer, error)
- func GetEndDateUserStripe(userId int) (database.Date, error)
- func GetUserIdWithStripeID(stripeID string) (int, error)
- func HandleCreatingCustomer(usr database.User) (*stripe.Customer, error)
- func SetOtherEventCallback(callback func(event stripe.Event))
- type Subscription
Constants ¶
This section is empty.
Variables ¶
View Source
var OtherEventCallback func(event stripe.Event)
Functions ¶
func CallCallBack ¶
func CheckUserPaymentMethod ¶
func CreateFreeTrial ¶
func CreatePayment ¶
func CreatePaymentPage ¶
func CreateScheduledSubscription ¶
func CreateScheduledSubscription(userID int, start time.Time, trial_duration time.Duration, PriceID string, extraMetadata map[string]string) (*stripe.SubscriptionSchedule, error)
callback only calls when the start time is reached
func CreateSubscription ¶
func CreateSubscriptionPage ¶
func GetUserIdWithStripeID ¶
func HandleCreatingCustomer ¶
if custumer already exists in stripe it does not create a new one and uses the existing one
func SetOtherEventCallback ¶ added in v0.3.4
Types ¶
type Subscription ¶
type Subscription struct {
ID string `json:"id"`
ScheduleID string `json:"ScheduleID"`
UserID int `json:"user_id"`
StartDate database.Date `json:"start_date"`
EndDate database.Date `json:"end_date"`
Active bool `json:"active"`
Trial bool `json:"trial"`
Used bool `json:"used"`
Schedule bool `json:"schedule"`
}
subscription funs
func GetAllSubscriptions ¶
func GetAllSubscriptions(userID int) ([]Subscription, error)
func (Subscription) String ¶
func (s Subscription) String() string
Click to show internal directories.
Click to hide internal directories.