def METHOD_NAME(
    config: ApiConfig, payment_information: "PaymentData"
) -> PaymentResult:
    """Create a new transaction in NP Atobarai.
    On pending status from NP the transaction is cancelled and
    reason for pending is returned as error message.
    """
    action = TRANSACTION_REGISTRATION
    result, error_codes = register(config, payment_information)
    if error_codes:
        error_messages = get_error_messages_from_codes(action, error_codes=error_codes)
        return errors_payment_result(error_messages)
    status = result["authori_result"]
    transaction_id = result["np_transaction_id"]
    error_messages = []
    if status == PaymentStatus.PENDING:
        if cancel_error_codes := cancel(config, transaction_id).error_codes:
            handle_unrecoverable_state(
                None, "cancel", transaction_id, cancel_error_codes
            )
        error_messages = get_error_messages_from_codes(
            action, error_codes=result["authori_hold"]
        )
    return PaymentResult(
        status=status,
        psp_reference=transaction_id,
        errors=error_messages,
    )