github.com/stripe/stripe-go/v76@v76.25.0/confirmationtoken/client.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 // Package confirmationtoken provides the /confirmation_tokens APIs 8 package confirmationtoken 9 10 import ( 11 "net/http" 12 13 stripe "github.com/stripe/stripe-go/v76" 14 ) 15 16 // Client is used to invoke /confirmation_tokens APIs. 17 type Client struct { 18 B stripe.Backend 19 Key string 20 } 21 22 // Get returns the details of a confirmation token. 23 func Get(id string, params *stripe.ConfirmationTokenParams) (*stripe.ConfirmationToken, error) { 24 return getC().Get(id, params) 25 } 26 27 // Get returns the details of a confirmation token. 28 func (c Client) Get(id string, params *stripe.ConfirmationTokenParams) (*stripe.ConfirmationToken, error) { 29 path := stripe.FormatURLPath("/v1/confirmation_tokens/%s", id) 30 confirmationtoken := &stripe.ConfirmationToken{} 31 err := c.B.Call(http.MethodGet, path, c.Key, params, confirmationtoken) 32 return confirmationtoken, err 33 } 34 35 func getC() Client { 36 return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} 37 }