I have this code, from the examples on Stripe API docs site:
stripe.Key = "my_key"
s, err := sub.New(&stripe.SubParams{
Customer: "test_customer",
Plan: "month-plan",
})
This code works just fine. But I couldn't find how to add metadata to this request, like Product: "special-services"
.
Can I do it in one request on subscription creation, and if so, then how?
Thanks!
subParams := &stripe.SubParams{
Customer: "test_customer",
Plan: "month-plan",
}
subParams.AddMeta("Product","special-services")
s, err := sub.New(subParams)
stripe.SubParams
embeds stripe.Params
which has a method AddMeta
, which adds meta info to a map[string]string
.