Skip to content

Instantly share code, notes, and snippets.

@chrisjsimpson
Created December 2, 2022 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisjsimpson/e8ba92bc97efde72331279d5a345dad1 to your computer and use it in GitHub Desktop.
Save chrisjsimpson/e8ba92bc97efde72331279d5a345dad1 to your computer and use it in GitHub Desktop.
package main
import "github.com/stripe/stripe-go/v74"
import "github.com/stripe/stripe-go/v74/account"
import "encoding/json"
import "fmt"
import "os"
func main() {
stripe_api_key := os.Getenv("STRIPE_API_KEY")
stripe.Key = stripe_api_key
fmt.Println("The Go library stripe version is", stripe.APIVersion)
params := &stripe.AccountListParams{}
params.Filters.AddFilter("limit", "", "3")
i := account.List(params)
for i.Next() {
ac := i.Account()
prettyJSON, _ := json.MarshalIndent(ac, "", " ")
fmt.Println("%s\n", string(prettyJSON))
fmt.Println("The account: " + ac.ID)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment