-
Notifications
You must be signed in to change notification settings - Fork 449
/
client.go
42 lines (35 loc) · 887 Bytes
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
//
// File generated from our OpenAPI spec
//
//
// Package session provides the /billing_portal/sessions APIs
package session
import (
"net/http"
stripe "github.com/stripe/stripe-go/v75"
)
// Client is used to invoke /billing_portal/sessions APIs.
type Client struct {
B stripe.Backend
Key string
}
// New creates a new billing portal session.
func New(params *stripe.BillingPortalSessionParams) (*stripe.BillingPortalSession, error) {
return getC().New(params)
}
// New creates a new billing portal session.
func (c Client) New(params *stripe.BillingPortalSessionParams) (*stripe.BillingPortalSession, error) {
session := &stripe.BillingPortalSession{}
err := c.B.Call(
http.MethodPost,
"/v1/billing_portal/sessions",
c.Key,
params,
session,
)
return session, err
}
func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}