updateAttributes method
Updates the attributes of a Checkout
Implementation
Future<void> updateAttributes(
String checkoutId, {
bool? allowPartialAddresses,
Map<String, String>? customAttributes,
String? note,
}) async {
final MutationOptions _options = MutationOptions(
document: gql(checkoutAttributesUpdateMutation),
variables: {
'checkoutId': checkoutId,
'input': {
'allowPartialAddresses': ?allowPartialAddresses,
if (customAttributes != null)
'customAttributes': [
for (var entry in customAttributes.entries)
{'key': entry.key, 'value': entry.value},
],
'note': ?note,
},
},
);
final QueryResult result = await _graphQLClient!.mutate(_options);
checkForError(
result,
key: 'checkoutAttributesUpdateV2',
errorKey: 'checkoutUserErrors',
);
}