diff --git a/stripe.go b/stripe.go index a8da4ec..74e83a5 100644 --- a/stripe.go +++ b/stripe.go @@ -35,7 +35,7 @@ func getstripepaymentintentHandler(response http.ResponseWriter, request *http.R amount := 0 for _, tracker := range trackers { items = strings.Split(tracker, ":") - if len(items) == 2 { + if len(items) >= 2 { abo_count, err := strconv.Atoi(items[1]) if err == nil { abo_years += abo_count @@ -78,7 +78,7 @@ func HandlePayment(user string, charge_data string, amount int64) { amount, _ := strconv.Atoi(res[2]) fmt.Printf("prolongActivation %s: %d\n", deveui, years) prolongActivation(deveui, years) - line := fmt.Sprintf("%-30s %20s %10.2f\n", getDevAlias(deveui), getActiveUntil(deveui), float64(amount / 100)) + line := fmt.Sprintf("%-30s %20s %10.2f\n", getDevAlias(deveui), getActiveUntil(deveui), float64(amount/100)) charge_data_email_text = charge_data_email_text + line } }