update method
Future<NotchPayCustomer>
update(
- String reference, {
- String? name,
- String? email,
- String? phone,
- String? description,
- NotchPayAddress? address,
- NotchPayAddress? shipping,
Updates an existing customer.
Implementation
Future<NotchPayCustomer> update(
String reference, {
String? name,
String? email,
String? phone,
String? description,
NotchPayAddress? address,
NotchPayAddress? shipping,
}) async {
final json = await _client.post(
'/customers/$reference',
body: {
'name': name,
'email': email,
'phone': phone,
'description': description,
if (address != null) 'address': address.toJson(),
if (shipping != null) 'shipping': shipping.toJson(),
},
);
return NotchPayCustomer.fromJson(_unwrap(json));
}