createCustomer method

Future<bool> createCustomer(
  1. WooCustomer customer
)

Creates a new Woocommerce Customer and returns the customer object.

Accepts a customer object as required parameter.

Implementation

Future<bool> createCustomer(WooCustomer customer) async {
  _printToLog('Creating Customer With info : ' + customer.toString());
  _setApiResourceUrl(path: 'customers');
  final response = await post(queryUri.toString(), customer.toJson());
  _printToLog('created customer : ' + response.toString());
  final cus = WooCustomer.fromJson(response);
  if (cus is WooCustomer) {
    return true;
  } else {
    return false;
  }
  //return WooCustomer.fromJson(response);
}