createPaymentManager method
Creates a new payment manager in your Amazon Web Services account. A payment manager serves as the top-level resource for managing payment processing capabilities, including payment connectors that integrate with supported payment providers.
If you specify CUSTOM_JWT as the authorizerType,
you must provide an authorizerConfiguration.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter authorizerType :
The type of authorizer to use for the payment manager.
-
CUSTOM_JWT- Authorize with a bearer token. -
AWS_IAM- Authorize with your Amazon Web Services IAM credentials.
Parameter name :
The name of the payment manager.
Parameter roleArn :
The Amazon Resource Name (ARN) of the IAM role that the payment manager
assumes to access resources on your behalf.
Parameter authorizerConfiguration :
The authorizer configuration for the payment manager.
Parameter clientToken :
A unique, case-sensitive identifier to ensure that the API request
completes no more than one time. If you don't specify this field, a value
is randomly generated for you. If this token matches a previous request,
the service ignores the request, but doesn't return an error. For more
information, see Ensuring
idempotency.
Parameter description :
A description of the payment manager.
Parameter tags :
A map of tag keys and values to assign to the payment manager.
Implementation
Future<CreatePaymentManagerResponse> createPaymentManager({
required PaymentsAuthorizerType authorizerType,
required String name,
required String roleArn,
AuthorizerConfiguration? authorizerConfiguration,
String? clientToken,
String? description,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'authorizerType': authorizerType.value,
'name': name,
'roleArn': roleArn,
if (authorizerConfiguration != null)
'authorizerConfiguration': authorizerConfiguration,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/payments/managers',
exceptionFnMap: _exceptionFns,
);
return CreatePaymentManagerResponse.fromJson(response);
}