updateCustomerDefaultSource method

Future<Customer> updateCustomerDefaultSource(
  1. String customerId,
  2. String sourceId,
  3. String secret
)

Implementation

Future<Customer> updateCustomerDefaultSource(
    String customerId, String sourceId, String secret) async {
  final String url = "$LIVE_API_PATH/customers/$customerId";
  final options = RequestOptions(publishableApiKey: secret);
  final response = await _getStripeResponse(
    RequestMethod.post,
    url,
    options,
    params: {"default_source": sourceId},
  );
  final customer = Customer.fromJson(response);
  return customer;
}