Skip to content

"error_code":400 Bad Request: STARS_INVOICE_INVALID #751

Description

@vicabert091
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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions