-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for APIs in the new API version 2024-09-30.acacia (#1926)
- Loading branch information
1 parent
e9fb4fb
commit 6501578
Showing
32 changed files
with
1,550 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1267 | ||
v1268 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ | |
package stripe | ||
|
||
const ( | ||
apiVersion string = "2024-06-20" | ||
apiVersion string = "2024-09-30.acacia" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// | ||
// File generated from our OpenAPI spec | ||
// | ||
// | ||
|
||
// Package creditbalancesummary provides the /billing/credit_balance_summary APIs | ||
package creditbalancesummary | ||
|
||
import ( | ||
"net/http" | ||
|
||
stripe "github.com/stripe/stripe-go/v79" | ||
) | ||
|
||
// Client is used to invoke /billing/credit_balance_summary APIs. | ||
type Client struct { | ||
B stripe.Backend | ||
Key string | ||
} | ||
|
||
// Retrieves the credit balance summary for a customer | ||
func Get(params *stripe.BillingCreditBalanceSummaryParams) (*stripe.BillingCreditBalanceSummary, error) { | ||
return getC().Get(params) | ||
} | ||
|
||
// Retrieves the credit balance summary for a customer | ||
func (c Client) Get(params *stripe.BillingCreditBalanceSummaryParams) (*stripe.BillingCreditBalanceSummary, error) { | ||
creditbalancesummary := &stripe.BillingCreditBalanceSummary{} | ||
err := c.B.Call( | ||
http.MethodGet, | ||
"/v1/billing/credit_balance_summary", | ||
c.Key, | ||
params, | ||
creditbalancesummary, | ||
) | ||
return creditbalancesummary, err | ||
} | ||
|
||
func getC() Client { | ||
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// | ||
// | ||
// File generated from our OpenAPI spec | ||
// | ||
// | ||
|
||
// Package creditbalancetransaction provides the /billing/credit_balance_transactions APIs | ||
package creditbalancetransaction | ||
|
||
import ( | ||
"net/http" | ||
|
||
stripe "github.com/stripe/stripe-go/v79" | ||
"github.com/stripe/stripe-go/v79/form" | ||
) | ||
|
||
// Client is used to invoke /billing/credit_balance_transactions APIs. | ||
type Client struct { | ||
B stripe.Backend | ||
Key string | ||
} | ||
|
||
// Retrieves a credit balance transaction | ||
func Get(id string, params *stripe.BillingCreditBalanceTransactionParams) (*stripe.BillingCreditBalanceTransaction, error) { | ||
return getC().Get(id, params) | ||
} | ||
|
||
// Retrieves a credit balance transaction | ||
func (c Client) Get(id string, params *stripe.BillingCreditBalanceTransactionParams) (*stripe.BillingCreditBalanceTransaction, error) { | ||
path := stripe.FormatURLPath("/v1/billing/credit_balance_transactions/%s", id) | ||
creditbalancetransaction := &stripe.BillingCreditBalanceTransaction{} | ||
err := c.B.Call(http.MethodGet, path, c.Key, params, creditbalancetransaction) | ||
return creditbalancetransaction, err | ||
} | ||
|
||
// Retrieve a list of credit balance transactions | ||
func List(params *stripe.BillingCreditBalanceTransactionListParams) *Iter { | ||
return getC().List(params) | ||
} | ||
|
||
// Retrieve a list of credit balance transactions | ||
func (c Client) List(listParams *stripe.BillingCreditBalanceTransactionListParams) *Iter { | ||
return &Iter{ | ||
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { | ||
list := &stripe.BillingCreditBalanceTransactionList{} | ||
err := c.B.CallRaw(http.MethodGet, "/v1/billing/credit_balance_transactions", c.Key, b, p, list) | ||
|
||
ret := make([]interface{}, len(list.Data)) | ||
for i, v := range list.Data { | ||
ret[i] = v | ||
} | ||
|
||
return ret, list, err | ||
}), | ||
} | ||
} | ||
|
||
// Iter is an iterator for billing credit balance transactions. | ||
type Iter struct { | ||
*stripe.Iter | ||
} | ||
|
||
// BillingCreditBalanceTransaction returns the billing credit balance transaction which the iterator is currently pointing to. | ||
func (i *Iter) BillingCreditBalanceTransaction() *stripe.BillingCreditBalanceTransaction { | ||
return i.Current().(*stripe.BillingCreditBalanceTransaction) | ||
} | ||
|
||
// BillingCreditBalanceTransactionList returns the current list object which the iterator is | ||
// currently using. List objects will change as new API calls are made to | ||
// continue pagination. | ||
func (i *Iter) BillingCreditBalanceTransactionList() *stripe.BillingCreditBalanceTransactionList { | ||
return i.List().(*stripe.BillingCreditBalanceTransactionList) | ||
} | ||
|
||
func getC() Client { | ||
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} | ||
} |
Oops, something went wrong.