Skip to content

create_payment_connector

create_payment_connector(
    payment_manager_id: PaymentManagerId,
    name: PaymentConnectorName,
    type: PaymentConnectorType,
    credential_provider_configurations: CredentialsProviderConfigurations,
    *,
    config_overrides: Optional[BedrockAgentCoreControlClientConfig] = None,
    description: Optional[PaymentsDescription] = None,
    provision_mode: Optional[PaymentConnectorProvisionMode] = None,
    client_token: Optional[ClientToken] = None,
) -> CreatePaymentConnectorResponse

Creates a new payment connector for a payment manager. A payment connector integrates with a supported payment provider to enable payment processing capabilities.

Parameters:

  • payment_manager_id (PaymentManagerId) –

    The unique identifier of the payment manager to create the connector for.

  • name (PaymentConnectorName) –

    The name of the payment connector.

  • description (Optional[PaymentsDescription], default: None ) –

    A description of the payment connector.

  • type (PaymentConnectorType) –

    The type of payment connector, which determines the payment provider integration.

  • credential_provider_configurations (CredentialsProviderConfigurations) –

    The credential provider configurations for the payment connector. These configurations specify how the connector authenticates with the payment provider.

  • provision_mode (Optional[PaymentConnectorProvisionMode], default: None ) –

    The provision mode for creating the payment connector. If you don't specify a value, the default is MANUAL.

    • MANUAL - You provide the credential provider configurations directly.

    • QUICK_CREATE - The service orchestrates OAuth consent and provisions the credential provider for you.

  • client_token (Optional[ClientToken], default: None ) –

    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.

Raises:

  • AccessDeniedException –

    This exception is thrown when a request is denied per access permissions

  • ConflictException –

    This exception is thrown when there is a conflict performing an operation

  • InternalServerException –

    This exception is thrown if there was an unexpected error during processing of request

  • ResourceNotFoundException –

    This exception is thrown when a resource referenced by the operation does not exist

  • ServiceQuotaExceededException –

    This exception is thrown when a request is made beyond the service quota

  • SubscriptionRequiredException –

    The request failed because it requires an active Amazon Web Services Marketplace subscription that is not present. Subscribe to the required product in Amazon Web Services Marketplace and try again.

  • ThrottlingException –

    This exception is thrown when the number of requests exceeds the limit

  • ValidationException –

    The input fails to satisfy the constraints specified by the service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_bedrock_agentcore_control/_services/bedrock_agent_core_control.py
def create_payment_connector(
    self,
    payment_manager_id: "capo_bedrock_agentcore_control.types.payment_manager_id.PaymentManagerId",
    name: "capo_bedrock_agentcore_control.types.payment_connector_name.PaymentConnectorName",
    type: "capo_bedrock_agentcore_control.types.payment_connector_type.PaymentConnectorType",
    credential_provider_configurations: "capo_bedrock_agentcore_control.types.credentials_provider_configurations.CredentialsProviderConfigurations",
    *,
    config_overrides: Optional[BedrockAgentCoreControlClientConfig] = None,
    description: Optional[
        "capo_bedrock_agentcore_control.types.payments_description.PaymentsDescription"
    ] = None,
    provision_mode: Optional[
        "capo_bedrock_agentcore_control.types.payment_connector_provision_mode.PaymentConnectorProvisionMode"
    ] = None,
    client_token: Optional[
        "capo_bedrock_agentcore_control.types.client_token.ClientToken"
    ] = None,
) -> "capo_bedrock_agentcore_control.types.create_payment_connector_response.CreatePaymentConnectorResponse":
    """<p>Creates a new payment connector for a payment manager. A payment connector integrates with a supported payment provider to enable payment processing capabilities.</p>

    Args:
        payment_manager_id: <p>The unique identifier of the payment manager to create the connector for.</p>
        name: <p>The name of the payment connector.</p>
        description: <p>A description of the payment connector.</p>
        type: <p>The type of payment connector, which determines the payment provider integration.</p>
        credential_provider_configurations: <p>The credential provider configurations for the payment connector. These configurations specify how the connector authenticates with the payment provider.</p>
        provision_mode: <p>The provision mode for creating the payment connector. If you don't specify a value, the default is <code>MANUAL</code>.</p> <ul> <li> <p> <code>MANUAL</code> - You provide the credential provider configurations directly.</p> </li> <li> <p> <code>QUICK_CREATE</code> - The service orchestrates OAuth consent and provisions the credential provider for you.</p> </li> </ul>
        client_token: <p>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 <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>

    Raises:
        capo_bedrock_agentcore_control.errors.access_denied_exception.AccessDeniedException: <p>This exception is thrown when a request is denied per access permissions</p>
        capo_bedrock_agentcore_control.errors.conflict_exception.ConflictException: <p>This exception is thrown when there is a conflict performing an operation</p>
        capo_bedrock_agentcore_control.errors.internal_server_exception.InternalServerException: <p>This exception is thrown if there was an unexpected error during processing of request</p>
        capo_bedrock_agentcore_control.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource referenced by the operation does not exist</p>
        capo_bedrock_agentcore_control.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This exception is thrown when a request is made beyond the service quota</p>
        capo_bedrock_agentcore_control.errors.subscription_required_exception.SubscriptionRequiredException: <p>The request failed because it requires an active Amazon Web Services Marketplace subscription that is not present. Subscribe to the required product in Amazon Web Services Marketplace and try again.</p>
        capo_bedrock_agentcore_control.errors.throttling_exception.ThrottlingException: <p>This exception is thrown when the number of requests exceeds the limit</p>
        capo_bedrock_agentcore_control.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_bedrock_agentcore_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_bedrock_agentcore_control.types.create_payment_connector_request.CreatePaymentConnectorRequest]",
    ) -> OperationResponse[
        "capo_bedrock_agentcore_control.types.create_payment_connector_response.CreatePaymentConnectorResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.create_payment_connector

        output, http_response = (
            capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.create_payment_connector.create_payment_connector(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePaymentConnector")
    )
    input_: capo_bedrock_agentcore_control.types.create_payment_connector_request.CreatePaymentConnectorRequest = {
        "payment_manager_id": payment_manager_id,
        "name": name,
        "type": type,
        "credential_provider_configurations": credential_provider_configurations,
    }
    if description is not None:
        input_["description"] = description
    if provision_mode is not None:
        input_["provision_mode"] = provision_mode
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output