stripe_api_sdk 1.0.2+3 copy "stripe_api_sdk: ^1.0.2+3" to clipboard
stripe_api_sdk: ^1.0.2+3 copied to clipboard

Unofficial Stripe API SDK

Stripe API SDK #

Unofficial Stripe API SDK(under development) #

Hecho en đŸ‡”đŸ‡· por RadamĂ©s J. ValentĂ­n Reyes #

Import #

import 'package:stripe_api_sdk/stripe_api_sdk.dart';
import 'package:stripe_api_sdk/objects.dart';

Get Started #

Create an instance of Stripe

Stripe stripe = Stripe(
  secretKey: secretKey,
);

API Functions #

Get my balance #

Balance myBalance = await stripe.getMyBalance();

List all balance transactions #

ListOfBalanceTransactions balanceTransactions = await stripe.listAllBalanceTransactions();

Get balance transaction #

BalanceTransaction balanceTransaction = await getBalanceTransaction(
  balanceTransactionID : balanceTransactionID,
);

Create Charge #

Create a Customer #

Customer customer = await stripe.createACustomer(
  customer: Customer(
    description: "Radamés account", 
    email: "valentin.radames@outlook.com", 
    name: "Radamés Valentín", 
    phone: "1234567890", 
  ),
);

Retrieve a customer #

Customer retrievedCustomer = await stripe.retrieveCustomer(
  customerId: "customerId",
);

Update a customer #

Customer modifiedCustomer = await stripe.updateCustomer(
  customerId: "customer_id",
  name: "Juan del Pueblo",
);

Delete a customer #

bool deleted = await stripe.deleteCustomer(customerId: customer.id!);

List all customers #

AllCustomersList allCustomersList = await stripe.listAllCustomers();

List all customers(next page) #

AllCustomersList allCustomersList = await stripe.listAllCustomers();
AllCustomersList nextPage = await stripe.listAllCustomers(
  startingAfter: allCustomersList.customers.last.id,
);

Search customers #

Create a PaymentIntent #

PaymentIntent paymentIntent = await stripe.createPaymentIntent(
  amount: 100,
);

Contribute/donate by tapping on the Pay Pal logo/image #


References #