stripe_api_client 0.2.4
stripe_api_client: ^0.2.4 copied to clipboard
Stripe API Client generated from OpenAPI specification
example/README.md
Example: List Customers #
This example demonstrates how to use the Stripe API client to list customers from your Stripe account.
Setup #
-
Navigate to the example directory:
cd example -
Install dependencies:
dart pub get -
Create a
.envfile in the project root (parent directory):cp ../.env.example ../.env -
Edit
../.envand add your Stripe API key:STRIPE_API_KEY=sk_test_your_actual_api_key_hereYou can get your API key from the Stripe Dashboard.
Running the Example #
From the example directory:
dart run list_customers.dart
Or from the project root:
cd example && dart run list_customers.dart
What This Example Does #
- Loads the Stripe API key from the
.envfile - Creates a custom authentication provider that adds the API key to the Authorization header
- Initializes the Stripe client
- Fetches and displays a list of customers from your Stripe account
Customization #
You can modify this example to:
- Create new customers
- Update customer information
- Access other Stripe API endpoints
- Add error handling for specific error types
See the Stripe API documentation for available endpoints and operations.