2019-10-17 15:04:50 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package coinpayments
|
|
|
|
|
2022-11-29 12:36:41 +00:00
|
|
|
import "net/url"
|
2019-11-12 11:14:34 +00:00
|
|
|
|
|
|
|
// GetCheckoutURL constructs checkout url from auth key and transaction id.
|
|
|
|
func GetCheckoutURL(key string, id TransactionID) string {
|
|
|
|
u, _ := url.Parse("https://coinpayments.net/index.php")
|
|
|
|
|
|
|
|
query := u.Query()
|
|
|
|
query.Add("cmd", "checkout")
|
|
|
|
query.Add("id", id.String())
|
|
|
|
query.Add("key", key)
|
|
|
|
|
|
|
|
u.RawQuery = query.Encode()
|
|
|
|
return u.String()
|
|
|
|
}
|