-
Notifications
You must be signed in to change notification settings - Fork 968
Open
Description
func TestStar(t *testing.T) {
price := make([]tgbotapi.LabeledPrice, 0)
price = []tgbotapi.LabeledPrice{
tgbotapi.LabeledPrice{
Label: "XTR",
Amount: 1,
},
}
invoice := tgbotapi.NewInvoice(ChatID, "star pay", "start", "v-1",
"", "uZzZW3MS1XcCnEyrbBvsFRE8m96dqzQL",
"XTR", price)
api, err := tgbotapi.NewBotAPI(token)
if err != nil {
t.Fatal(err)
}
api.Debug = true
invoice.MaxTipAmount = 500
invoice.SuggestedTipAmounts = []int{100, 200, 300}
send, err := api.Send(invoice)
if err != nil {
t.Fatal(err)
}
fmt.Println(send)
}
err: Endpoint: sendInvoice, response: {"ok":false,"error_code":400,"description":"Bad Request: STARS_INVOICE_INVALID"}
star_test.go:36: Bad Request: STARS_INVOICE_INVALID
Metadata
Metadata
Assignees
Labels
No labels